<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Aust Gate &#187; php</title>
	<atom:link href="http://austgate.co.uk/tags/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://austgate.co.uk</link>
	<description>Open Knowledge and Literature</description>
	<lastBuildDate>Tue, 08 May 2012 20:33:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Weeknotes: Talks, Open Correspondence, XMPP</title>
		<link>http://austgate.co.uk/2010/07/weeknotes-talks-open-correspondence-xmpp/</link>
		<comments>http://austgate.co.uk/2010/07/weeknotes-talks-open-correspondence-xmpp/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 15:19:13 +0000</pubDate>
		<dc:creator>iain_emsley</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[weeknotes]]></category>
		<category><![CDATA[open_correspondence]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[xmpp]]></category>

		<guid isPermaLink="false">http://austgate.co.uk/?p=191</guid>
		<description><![CDATA[I gave a talk at the Oxford Geek Nights about Open Correspondence and letters. At some point I really ought to learn how to give talks. Anyhow Russell Davies was the main speakers and he showed how you could make physical objects from data derived from social networks. (He has a marvellously sane post about [...]]]></description>
			<content:encoded><![CDATA[<p>I gave a talk at the Oxford Geek Nights about <a title="Open correspondence site" href="http://opencorrespondence.org" target="_blank">Open Correspondence</a> and letters. At some point I really ought to learn how to give talks. Anyhow <a title="russell davies' blog" href="http://russelldavies.typepad.com/" target="_blank">Russell Davies</a> was the main speakers and he showed how you could make physical objects from data derived from social networks. (He has a marvellously sane <a title="Russell Davies on Raoul Moat facebook page " href="http://russelldavies.typepad.com/planning/2010/07/this-is-facebook-this-is-the-internet.html" target="_blank">post about the Raoul Moat facebook page</a>.) Anyhow its gathered some people who are interested in contributing. Now I&#8217;ve finished the book, I&#8217;ve got more time to make changes to the codebase which urgently needs it. Finishing off stuff really. Then making the real changes.</p>
<p>Accounts has been slightly on hold since the wages needed to be run and I didn&#8217;t see that accounts or operations would be happy with fugures potentially changing.</p>
<p>The main project has been setting up a notification service to set up the service layer correctly. I&#8217;ve finally got the server working so I&#8217;m just building a framework. I thought of porting parts of <a title="Djabberd server" href="http://danga.com/djabberd/" target="_blank">djabberd</a> projects into PHP but I&#8217;m just  looking at parts of it but XMPP is certainly a useful tool in getting machines to speak to each other and to develop event driven services.</p>
]]></content:encoded>
			<wfw:commentRss>http://austgate.co.uk/2010/07/weeknotes-talks-open-correspondence-xmpp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weeknotes: PHP, SOAP, and Open Letters</title>
		<link>http://austgate.co.uk/2010/06/weeknotes-php-soap-and-open-letters/</link>
		<comments>http://austgate.co.uk/2010/06/weeknotes-php-soap-and-open-letters/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 10:15:22 +0000</pubDate>
		<dc:creator>iain_emsley</dc:creator>
				<category><![CDATA[weeknotes]]></category>
		<category><![CDATA[open_correspondence]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://austgate.co.uk/?p=171</guid>
		<description><![CDATA[It has been a fairly quiet week with the boss away. I&#8217;ve managed to complete a service to upload details from spreadsheets sent via email. I&#8217;ve also managed to complete a SOAP service in PHP to listen for status updates and just doing the final tests to it now. Once its up it can be [...]]]></description>
			<content:encoded><![CDATA[<p>It has been a fairly quiet week with the boss away. I&#8217;ve managed to complete a service to upload details from spreadsheets sent via email.</p>
<p>I&#8217;ve also managed to complete a SOAP service in PHP to listen for status updates and just doing the final tests to it now. Once its up it can be repurposed for other companies. One of the things that I think  will come up is how to store XML files most efficiently as MySQL 5 appears to be tied to uploading files rather than just taking POST strings. I&#8217;m thinking of using something like <a title="Oracle Berkeley DB XML" href="http://www.oracle.com/database/berkeley-db/xml/index.html" target="_blank">Oracle&#8217;s BDB XML</a> database (though the license appears to preclude our uses) or <a title="eXist sourceforge page" href="http://exist.sourceforge.net/index.html" target="_blank">eXist</a> but that is something to come back to much later.</p>
<p>I&#8217;ve been thinking about the Open Correspondence site and the best way to allow it to be extended by other people. I think that the best way forward to create an internal XML format which the load command can use and anybody can use to create their own files and databases. Its along the lines of the stuff I partially did some work on in the Open Shakespeare project.</p>
<p>Given the boss is away, time for finishing more things off next week. I&#8217;ve also created a <a title="Trac website" href="http://trac.edgewall.org" target="_blank">Trac</a> instance for internal purposes but I think it&#8217;ll help on that bane if developing live &#8211; documentation.</p>
]]></content:encoded>
			<wfw:commentRss>http://austgate.co.uk/2010/06/weeknotes-php-soap-and-open-letters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weeknotes: Redis, PHP, mail and SOAP</title>
		<link>http://austgate.co.uk/2010/06/weeknotes-redis-php-mail-and-soap/</link>
		<comments>http://austgate.co.uk/2010/06/weeknotes-redis-php-mail-and-soap/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 11:05:18 +0000</pubDate>
		<dc:creator>iain_emsley</dc:creator>
				<category><![CDATA[Information Retrieval]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[redis]]></category>
		<category><![CDATA[soap]]></category>

		<guid isPermaLink="false">http://austgate.co.uk/?p=164</guid>
		<description><![CDATA[I&#8217;ve spent some time writing a queueing library using Redis as a backend. I started with the notion that it would need to be a FIFO queue but didn&#8217;t want to only use the in-built parts of PHP as a stack using array_pop or array_push. Whilst it might be faster, it doesn&#8217;t allow for queue [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve spent some time writing a queueing library using Redis as a backend. I started with the notion that it would need to be a FIFO queue but didn&#8217;t want to only use the in-built parts of PHP as a stack using array_pop or array_push. Whilst it might be faster, it doesn&#8217;t allow for queue storage if the worker / router calling the queue does not run until a certain time so I looked at Redis. I  drew some inspiration from <a title="MEMQ blog post" href="http://abhinavsingh.com/blog/2010/02/memq-fast-queue-implementation-using-memcached-and-php-only/" target="_blank">MEMQ</a>, a queue implementation using memcached. I wrote a quick set of functions to handle connection, enqueuing and dequeueing with the ever present Rediska as the underlying Redis connection library. I&#8217;m tempted to revisit this and to write my own connection to remove the reliance on Rediska. What I did learn was how to increase and decrease the number of items that could be dequeued. For some stupid reason, I&#8217;d got into my head that it would either by one or all items.</p>
<p>However if you think about the LLEN command, you can pop as many items as you want, drop them into an array and iterate across them. I need to try this but you could feasibly call items from the middle of the array by changing the start and end points in LLEN. Normally I&#8217;d do something like  &lt;list name&gt; LLEN 0, -1 for all items or &lt;list name&gt; LLEN 0, 2 for the first two but if you change 0 to something else where you know there are 30 items but only want 5 from position 20 then you could pop in LLEN 20, 5 to achieve the result. It is not really germaine to the queueing that I&#8217;ve been looking at (for system updates where I need everything or just the first item) but could be a useful adaptation for somebody else.</p>
<p>The main challenge this week has been reading Excel attachments from email. PHP&#8217;s <a title="PHP's imap functions" href="http://php.net/manual/en/book.imap.php" target="_blank">imap</a> library  allows you to read the structure of an email but is curiously reticent in retrieving data if you have mime parts. I spent ethe best part of a day and a half getting a script to iterate over an incoming email, filter the parts so that it just explored the attachments mime type and then retrive any attachments either from a flat structure or iterating over each part before calling imap_fetchbody(). So far the fix appears to work and has allowed me to create a prototype mail service for receiving email data. It seems odd that in the era of web services that financial data is still sent by insecure methods but we must accomodate.</p>
<p>I&#8217;ve also been looking at PHP&#8217;s<a title="PHP's soap functions" href="http://php.net/manual/en/book.soap.php" target="_blank"> SOAP</a> library to create a status update service which will probably utilise <a title="Wikipedia on Service Orientated Architecture" href="http://en.wikipedia.org/wiki/Service-oriented_architecture" target="_blank">Service Orientated Architecture</a> to create a stable, scalable service. Initially I created a <a title="W3 on WSDL" href="http://www.w3.org/TR/wsdl" target="_blank">WSDL</a> file using the <a title="Eclipse ide" href="http://www.eclipse.org/" target="_blank">Eclipse IDE</a> but that threw all sorts of issues and ended up using Zend&#8217;s WSDL generator tool running across the existing server. Must look into this but there might be a conflict in versions of WSDL as well as first time learning curve. I&#8217;m hoping to get the first version of the service up this week.</p>
<p>I suspect that this week is going to complete the commission and service status services as well as possibly doing some documentation as it is beginning to pile up.</p>
]]></content:encoded>
			<wfw:commentRss>http://austgate.co.uk/2010/06/weeknotes-redis-php-mail-and-soap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Full text search using PHP and MySQL</title>
		<link>http://austgate.co.uk/2009/12/full-text-search-using-php-and-mysql/</link>
		<comments>http://austgate.co.uk/2009/12/full-text-search-using-php-and-mysql/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 19:38:19 +0000</pubDate>
		<dc:creator>iain_emsley</dc:creator>
				<category><![CDATA[Information Retrieval]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://austgate.co.uk/?p=106</guid>
		<description><![CDATA[I&#8217;ve been thinking about full text searching for the letters project and trying to find various solutions that are open source. On the Open Shakespeare and Open Milton sites, we used the Xapian  project which is an excellent search engine. However I wanted to try and find a way of getting a search running using [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been thinking about full text searching for the letters project and trying to find various solutions that are open source. On the <a title="The Open Shakespeare site" href="http://openshakespeare.org/" target="_blank">Open Shakespeare</a> and <a title="Open Milton site" href="http://openmilton.org/" target="_blank">Open Milton</a> sites, we used the Xapian  project which is an excellent search engine. However I wanted to try and find a way of getting a search running using PHP and MySQL which is what the site uses at the moment although I&#8217;d be happy to also use Perl. (I also wanted to impose a limit to use technologies that I currently use at my current job.)</p>
<p>I started with reading an <a title="Zend article on full text searching with PHP and MySQL" href="http://devzone.zend.com/article/1304" target="_blank">article  on the Zend</a> site that offers an overview of setting up a table to run with a <a title="MySQL manual on full text searching" href="http://dev.mysql.com/doc/refman/5.1/en/fulltext-search.html" target="_blank">Full-Text</a> index. As the article mentions, you have to ensure that the column which is being searched is either VARCHAR or TEXT as MySQL. If it is not in either form, then just alter the column using</p>
<blockquote><p>ALTER TABLE &lt;tablename&gt; MODIFY &lt;column&gt; TEXT</p></blockquote>
<p>(or VARCHAR but TEXT is probably preferable). What the Zend article does not mention is that the table type needs to by MyISAM rather than use InnoDB (which means that transactions won&#8217;t work on the table). Having made the alteration, I ran the query:</p>
<blockquote>
<div>SELECT * , MATCH (&lt;table&gt;) AGAINST (&#8216;&lt;search term&gt;&#8217;) AS score FROM &lt;table&gt; WHERE MATCH (&lt;table&gt;) AGAINST (&#8216;&lt;search term&gt;&#8217;)</div>
</blockquote>
<p>The table returns all the columns with a score against the term.</p>
<p>The SQL code just needs calling as you would any other form of database code. I&#8217;m still playing with this but I&#8217;ve been ordering the table by the score descending (ORDER BY score DESC) so that the most relevant results are posted for the user.</p>
<p>I do think that I need to do some pre-processing on my own results set to highlight relevance and to extract further semantic meanings for results. For example the publisher &#8216;Chapman and Hall&#8217; that I could run on the Dickens letters (<a title="Dickens letters search example" href="http://austgate.co.uk/dickens/search.php?term=Chapman&amp;submit=Submit+Query" target="_blank">http://austgate.co.uk/dickens/search.php?term=Chapman&amp;submit=Submit+Query</a>) could equally pull up other businesses or people. I still need to write a parser that can make some sort of judgement even if it is a guess.</p>
<p>I&#8217;m sure as I carry on developing the engine and bringing everything together for the project, I&#8217;ll have further thoughts on the creation of an engine and creating a more advanced version. This does at least give me a start using current tools (though it is perhaps not as good as Xapian but sometimes you have to at least learn some of the basics).</p>
]]></content:encoded>
			<wfw:commentRss>http://austgate.co.uk/2009/12/full-text-search-using-php-and-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

