<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Topbit Technicals - php</title>
    <link>http://www.topbit.co.uk/serendipity/</link>
    <description>@todo 'write technical blog'</description>
    <dc:language>en</dc:language>
    <admin:errorReportsTo rdf:resource="mailto:topbit+s9yblog@gmail.com" />
    <generator>Serendipity 1.3-beta1 - http://www.s9y.org/</generator>
    <managingEditor>topbit+editor@gmail.com</managingEditor>
<webMaster>topbit+webmaster@gmail.com</webMaster>
<ttl>3600</ttl>
<pubDate>Wed, 07 Oct 2009 10:36:51 GMT</pubDate>

    <image>
        <url>http://www.topbit.co.uk/serendipity/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Topbit Technicals - php - @todo 'write technical blog'</title>
        <link>http://www.topbit.co.uk/serendipity/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Doing the work elsewhere - Adding a job to the queue</title>
    <link>http://www.topbit.co.uk/serendipity/archives/23-Doing-the-work-elsewhere-Adding-a-job-to-the-queue.html</link>
            <category>php</category>
    
    <comments>http://www.topbit.co.uk/serendipity/archives/23-Doing-the-work-elsewhere-Adding-a-job-to-the-queue.html#comments</comments>
    <wfw:comment>http://www.topbit.co.uk/serendipity/wfwcomment.php?cid=23</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.topbit.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=23</wfw:commentRss>
    

    <author>topbit+s9y@gmail.com (Topbit)</author>
    <content:encoded>
    I&#039;ve previously shown you why you may want to put some tasks through a queuing system, what sort of jobs you could define, plus how to keep a worker process running for as long as you would like (but still be mindful of problems that happen).&lt;br /&gt;
&lt;br /&gt;
In this post, I&#039;ll show you how to put the messages into the queue, and we&#039;ll also make a start on reading them back out.&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.topbit.co.uk/serendipity/archives/23-Doing-the-work-elsewhere-Adding-a-job-to-the-queue.html#extended&quot;&gt;Continue reading &quot;Doing the work elsewhere - Adding a job to the queue&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Tue, 06 Oct 2009 23:30:26 +0100</pubDate>
    <guid isPermaLink="false">http://www.topbit.co.uk/serendipity/archives/23-guid.html</guid>
    <category>php</category>
<category>scaling</category>
<category>tools</category>

</item>
<item>
    <title>Doing the work elsewhere - Sidebar - running the worker</title>
    <link>http://www.topbit.co.uk/serendipity/archives/22-Doing-the-work-elsewhere-Sidebar-running-the-worker.html</link>
            <category>OtherTech</category>
            <category>php</category>
    
    <comments>http://www.topbit.co.uk/serendipity/archives/22-Doing-the-work-elsewhere-Sidebar-running-the-worker.html#comments</comments>
    <wfw:comment>http://www.topbit.co.uk/serendipity/wfwcomment.php?cid=22</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://www.topbit.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=22</wfw:commentRss>
    

    <author>topbit+s9y@gmail.com (Topbit)</author>
    <content:encoded>
    I&#039;m taking a slight diversion now, to show you how the main worker processor runs.  There are two parts to it - the actual worker, written in PHP, and the script that keeps running it. &lt;br /&gt;&lt;a href=&quot;http://www.topbit.co.uk/serendipity/archives/22-Doing-the-work-elsewhere-Sidebar-running-the-worker.html#extended&quot;&gt;Continue reading &quot;Doing the work elsewhere - Sidebar - running the worker&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Tue, 23 Jun 2009 22:19:33 +0100</pubDate>
    <guid isPermaLink="false">http://www.topbit.co.uk/serendipity/archives/22-guid.html</guid>
    <category>php</category>
<category>scaling</category>
<category>tools</category>

</item>
<item>
    <title>Doing the work elsewhere - Asynchronous Message Queues</title>
    <link>http://www.topbit.co.uk/serendipity/archives/21-Doing-the-work-elsewhere-Asynchronous-Message-Queues.html</link>
            <category>OtherTech</category>
            <category>best-practices</category>
            <category>php</category>
    
    <comments>http://www.topbit.co.uk/serendipity/archives/21-Doing-the-work-elsewhere-Asynchronous-Message-Queues.html#comments</comments>
    <wfw:comment>http://www.topbit.co.uk/serendipity/wfwcomment.php?cid=21</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.topbit.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=21</wfw:commentRss>
    

    <author>topbit+s9y@gmail.com (Topbit)</author>
    <content:encoded>
    	&lt;h1&gt;The use of Beanstalkd as a queueing system&lt;/h1&gt;

	&lt;h2&gt;What is an asynchronous queue&lt;/h2&gt;

&lt;p&gt;The classic &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/en.wikipedia.org/wiki/Message_queue&#039;);&quot;  href=&quot;http://en.wikipedia.org/wiki/Message_queue&quot;&gt;wikipedia quote (Message queue)&lt;/a&gt;&lt;/p&gt;

	&lt;blockquote&gt;
		&lt;p&gt;In computer science, message queues and mailboxes are software-engineering components used for interprocess communication, or for inter-thread communication within the same process. They use a queue for messaging &amp;#8211; the passing of control or of content. Group communication systems provide similar kinds of functionality.&lt;/p&gt;
	&lt;/blockquote&gt;

	&lt;p&gt;So one part of a system puts a message into a queue for another part to read from, and then act upon.  The asynchronous nature means that each side is otherwise independent from the other, and does not wait for a response.  That independence is an important part of the nature of the system though &amp;#8211; and we&amp;#8217;ll see later how some of the more advanced functionality for our software of choice here can give some extraordinary flexibility to what can be done.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.topbit.co.uk/serendipity/archives/21-Doing-the-work-elsewhere-Asynchronous-Message-Queues.html#extended&quot;&gt;Continue reading &quot;Doing the work elsewhere - Asynchronous Message Queues&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Wed, 10 Jun 2009 16:43:29 +0100</pubDate>
    <guid isPermaLink="false">http://www.topbit.co.uk/serendipity/archives/21-guid.html</guid>
    <category>advanced</category>
<category>php</category>
<category>scaling</category>

</item>
<item>
    <title>(me instanceOf ZCE) === true</title>
    <link>http://www.topbit.co.uk/serendipity/archives/19-me-instanceOf-ZCE-true.html</link>
            <category>php</category>
            <category>quick</category>
    
    <comments>http://www.topbit.co.uk/serendipity/archives/19-me-instanceOf-ZCE-true.html#comments</comments>
    <wfw:comment>http://www.topbit.co.uk/serendipity/wfwcomment.php?cid=19</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.topbit.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=19</wfw:commentRss>
    

    <author>topbit+s9y@gmail.com (Topbit)</author>
    <content:encoded>
    	&lt;p&gt;Phew.  That would have been embarrassing if I&amp;#8217;d not passed my &lt;span class=&quot;caps&quot;&gt;ZCE&lt;/span&gt; on Thursday afternoon.&lt;/p&gt;

	&lt;p&gt;The rant on how useful it actually is though, will be coming early next week.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sat, 06 Jun 2009 12:50:00 +0100</pubDate>
    <guid isPermaLink="false">http://www.topbit.co.uk/serendipity/archives/19-guid.html</guid>
    <category>exams</category>
<category>zce</category>

</item>
<item>
    <title>I laugh at your ZCE exam prep tests #2</title>
    <link>http://www.topbit.co.uk/serendipity/archives/17-I-laugh-at-your-ZCE-exam-prep-tests-2.html</link>
            <category>php</category>
    
    <comments>http://www.topbit.co.uk/serendipity/archives/17-I-laugh-at-your-ZCE-exam-prep-tests-2.html#comments</comments>
    <wfw:comment>http://www.topbit.co.uk/serendipity/wfwcomment.php?cid=17</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.topbit.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=17</wfw:commentRss>
    

    <author>topbit+s9y@gmail.com (Topbit)</author>
    <content:encoded>
    	&lt;p&gt;Back at the &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; London Conference at the end of February, iBuildings was offering a little test, with prize for people that could do well answering the sort of questions that are on the &lt;span class=&quot;caps&quot;&gt;ZCE&lt;/span&gt; exam.  Never one to turn down something for free, I took ten minutes to answer the eight questions.  A few weeks later, I get an email from them/Zend to say I&amp;#8217;d won the chance to take an exam &amp;#8211; &lt;span class=&quot;caps&quot;&gt;ZCE&lt;/span&gt;, or &lt;span class=&quot;caps&quot;&gt;ZFE&lt;/span&gt; (Zend Framework). Although I use ZF, I don&amp;#8217;t know it well enough to begin to pass any exam, so as I&amp;#8217;ve still not had the chance to take it, I figured, why not take it on their dime?&lt;/p&gt;

	&lt;p&gt;&lt;a href=&quot;http://www.topbit.co.uk/serendipity/archives/9-ZCE-prep-practice-test-1.html&quot;&gt;About 14 months ago&lt;/a&gt;, I&amp;#8217;d bought 5 tries on the PHPArch-based &amp;#8216;Vulcan&amp;#8217; test prep exam.  Today, I&amp;#8217;ve come back to it, and gone through it again.  Like last time, the test (practice and real) is scheduled to take up to 90 minutes, but I had whipped through them all in 45 minutes, I have finished the 70 questions.&lt;/p&gt;

	&lt;p&gt;I&amp;#8217;m amused by the fact the only part of this I failed was &amp;#8216;Basic Language&amp;#8217;. The first time around it was design patterns. Either way, now I&amp;#8217;ve got some time, I&amp;#8217;m going to schedule the test for quite possibly later this week and see about getting the paperwork for it.&lt;/p&gt;

	&lt;p&gt;It&amp;#8217;s also still 7 &amp;#8216;EXCELLENT&amp;#8217;s, and a fail &amp;#8211; just in different places :-)&lt;/p&gt;

	&lt;table&gt;
		&lt;tr&gt;
			&lt;td&gt;Category&lt;/td&gt;
			&lt;td&gt;Grade&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;XML&lt;/span&gt; &amp;amp; Web Services&lt;/td&gt;
			&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;PASS&lt;/span&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Arrays&lt;/td&gt;
			&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;PASS&lt;/span&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Web Features&lt;/td&gt;
			&lt;td&gt;&lt;strong&gt;EXCELLENT&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Basic Language&lt;/td&gt;
			&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;FAIL&lt;/span&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Streams and Network Programming&lt;/td&gt;
			&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;PASS&lt;/span&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Database Access&lt;/td&gt;
			&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;PASS&lt;/span&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;String Manipulation and Regular Expressions&lt;/td&gt;
			&lt;td&gt;&lt;strong&gt;EXCELLENT&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; 4/5 differences&lt;/td&gt;
			&lt;td&gt;&lt;strong&gt;EXCELLENT&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Security&lt;/td&gt;
			&lt;td&gt;&lt;strong&gt;EXCELLENT&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;OOP&lt;/span&gt;&lt;/td&gt;
			&lt;td&gt;&lt;strong&gt;EXCELLENT&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Functions&lt;/td&gt;
			&lt;td&gt;&lt;strong&gt;EXCELLENT&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Design&lt;/td&gt;
			&lt;td&gt;&lt;strong&gt;EXCELLENT&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/table&gt;

	&lt;p&gt;Overall : &lt;strong&gt;EXCELLENT&lt;/strong&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sat, 30 May 2009 15:20:23 +0100</pubDate>
    <guid isPermaLink="false">http://www.topbit.co.uk/serendipity/archives/17-guid.html</guid>
    <category>exams</category>
<category>php</category>

</item>
<item>
    <title>Elephpants on parade</title>
    <link>http://www.topbit.co.uk/serendipity/archives/15-Elephpants-on-parade.html</link>
            <category>php</category>
    
    <comments>http://www.topbit.co.uk/serendipity/archives/15-Elephpants-on-parade.html#comments</comments>
    <wfw:comment>http://www.topbit.co.uk/serendipity/wfwcomment.php?cid=15</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.topbit.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=15</wfw:commentRss>
    

    <author>topbit+s9y@gmail.com (Topbit)</author>
    <content:encoded>
    	&lt;p&gt;After my little trip out yesterday to Google Dev Day 2008 (London) at Wembley &amp;#8211;  I thought I&amp;#8217;d post some pics I took of the day, or more precisely, of what my Elephpant got up to.  You can see them on the &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.flickr.com/photos/topbit/sets/72157607327499398/&#039;);&quot;  href=&quot;http://www.flickr.com/photos/topbit/sets/72157607327499398/&quot;&gt;Elephpant at GoogleDevDay08&lt;/a&gt; Flickr set page.&lt;br /&gt;

&lt;br /&gt;

Also, some link love to to http://www.elephpantworldtour.com/ for the idea of taking the cute little blue guy along.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 18 Sep 2008 17:49:48 +0100</pubDate>
    <guid isPermaLink="false">http://www.topbit.co.uk/serendipity/archives/15-guid.html</guid>
    <category>elephpant</category>
<category>ewt08</category>
<category>fun</category>
<category>googledevday08</category>

</item>
<item>
    <title>Riddled me that</title>
    <link>http://www.topbit.co.uk/serendipity/archives/13-Riddled-me-that.html</link>
            <category>php</category>
    
    <comments>http://www.topbit.co.uk/serendipity/archives/13-Riddled-me-that.html#comments</comments>
    <wfw:comment>http://www.topbit.co.uk/serendipity/wfwcomment.php?cid=13</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.topbit.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=13</wfw:commentRss>
    

    <author>topbit+s9y@gmail.com (Topbit)</author>
    <content:encoded>
    	&lt;p&gt;Well go figure.  I&amp;#8217;ve just won $50 (Canadian, that&amp;#8217;s about $3000 &lt;span class=&quot;caps&quot;&gt;USD&lt;/span&gt; by now) of books and &amp;#8216;stuff&amp;#8217; from &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/phparch.com/&#039;);&quot;  href=&quot;http://phparch.com/&quot;&gt;&lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; Arch&lt;/a&gt;, care of it&amp;#8217;s publisher, &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/mtabini.blogspot.com/2008/04/riddle-me-this-and-win-50-in.html&#039;);&quot;  href=&quot;http://mtabini.blogspot.com/2008/04/riddle-me-this-and-win-50-in.html&quot;&gt;Marco Tabini&amp;#8217;s, blog&lt;/a&gt; &lt;br /&gt;

&lt;br /&gt;

He&amp;#8217;d put a little puzzle up last night, some long numbers, and a few short.  I recognised them as almost ISBNs &amp;#8211; it wasn&amp;#8217;t hard to figure them as having dropped a zero from the front, making them &amp;#8220;php|architect&amp;#8217;s Guide to Programming with Zend Framework&amp;#8221; and &amp;#8220;php|architect&amp;#8217;s Zend &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; 5 Certification Study Guide, 2nd Edition&amp;#8221;. From there, guessing the other numbers were page, line and word counts was easy.&lt;br /&gt;

&lt;br /&gt;

So, what should I buy?  I&amp;#8217;ve already got a subscription to the magazine &amp;#8211; &lt;span class=&quot;caps&quot;&gt;PDF&lt;/span&gt; edition (it&amp;#8217;s so much easier to ship bits over the atlantic&amp;#8230;).&lt;br /&gt;
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 24 Apr 2008 20:56:18 +0100</pubDate>
    <guid isPermaLink="false">http://www.topbit.co.uk/serendipity/archives/13-guid.html</guid>
    
</item>
<item>
    <title>Always have up to date documentation, part #2</title>
    <link>http://www.topbit.co.uk/serendipity/archives/12-Always-have-up-to-date-documentation,-part-2.html</link>
            <category>php</category>
    
    <comments>http://www.topbit.co.uk/serendipity/archives/12-Always-have-up-to-date-documentation,-part-2.html#comments</comments>
    <wfw:comment>http://www.topbit.co.uk/serendipity/wfwcomment.php?cid=12</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.topbit.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=12</wfw:commentRss>
    

    <author>topbit+s9y@gmail.com (Topbit)</author>
    <content:encoded>
    	&lt;p&gt;see my &lt;a href=&quot;http://www.topbit.co.uk//serendipity/archives/10-Always-have-up-to-date-documentation,-part-1.html&quot;&gt;previous post&lt;/a&gt;  on the topic, #1.&lt;br /&gt;

&lt;br /&gt;

My last post ended up more as a how-to than what-to.  This time, I&amp;#8217;ll say why you should have local copies of the documentation for most of the tools you use.  I&amp;#8217;ll also tell you the sort of things I always have handy as well.&lt;br /&gt;

&lt;br /&gt;

Getting a local copy of php.net &amp;#8211; and getting installed as an apache vhost and updated (probably weekly) is some effort, but well worth it.  I&amp;#8217;ve said it before, but &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;.net is the &lt;strong&gt;best&lt;/strong&gt; language reference site that I&amp;#8217;ve seen. It&amp;#8217;s kept up to date (sometimes ahead of the code releases in fact) and while the notes that are added to it can sometimes confuse, as much as help, when they do help, they will really make the difference.&lt;br /&gt;

&lt;br /&gt;

I don&amp;#8217;t tend to buy many &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; books, because what can they do besides re-iterate what is is already there?&lt;br /&gt;

&lt;br /&gt;

The most important thing to bear in mind though is not to just have the documentation there to read &amp;#8211; you have to know what is available.  Projects like &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;, the Zend Framework and PHPUnit have a lot of parts &amp;#8211; and knowing that they have things &amp;#8211; even if you don&amp;#8217;t know how they work right now, can save you days or weeks of effort.  &lt;br /&gt;

&lt;br /&gt;

It&amp;#8217;s for that reason that you need to at least scan over all the the docs you have &amp;#8211; and indeed for all the libraries and tools that you use.  Even I don&amp;#8217;t read everything and expect to remember it all &amp;#8211; but I remember enough to recognise that a paticular tool might have something to help &amp;#8211; maybe &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; has something to search the values in an array (http://php.net/array-search), or can use Oracle, or Ldap, or Memcached, or that Zend Framework can let you easily loop over maildirs (or an mbox) to get each mail from within it.  If you don&amp;#8217;t read the manual &amp;#8211; at least skimming over it, you would never know that functionality exists, and you inevitably end up reimplementing other people&amp;#8217;s already debugged code.  That&amp;#8217;s a waste of your time.&lt;br /&gt;

&lt;br /&gt;

So, take an hour now, and assemble a directory to put these docs into, and read through them &amp;#8211; not everything, but at least look at headers of every section, just to get an idea of what is available and maybe go back and read up some more on things that may be useful to you.  If something isn&amp;#8217;t so interesting to you now, do bear in mind, your next project, or job, might change that.&lt;br /&gt;

&lt;br /&gt;

Above all, keep learning.  Never stop.&lt;br /&gt;

&lt;hr /&gt;&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.topbit.co.uk/serendipity/archives/12-Always-have-up-to-date-documentation,-part-2.html#extended&quot;&gt;Continue reading &quot;Always have up to date documentation, part #2&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 24 Mar 2008 15:38:28 +0000</pubDate>
    <guid isPermaLink="false">http://www.topbit.co.uk/serendipity/archives/12-guid.html</guid>
    <category>code</category>
<category>php</category>
<category>tools</category>
<category>zend framework</category>

</item>
<item>
    <title>Know thy tools first of all</title>
    <link>http://www.topbit.co.uk/serendipity/archives/11-Know-thy-tools-first-of-all.html</link>
            <category>php</category>
    
    <comments>http://www.topbit.co.uk/serendipity/archives/11-Know-thy-tools-first-of-all.html#comments</comments>
    <wfw:comment>http://www.topbit.co.uk/serendipity/wfwcomment.php?cid=11</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.topbit.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=11</wfw:commentRss>
    

    <author>topbit+s9y@gmail.com (Topbit)</author>
    <content:encoded>
    	&lt;p&gt;Just a quick tip here, and I&amp;#8217;ll expand on it below the cut.&lt;br /&gt;

&lt;br /&gt;

When you have a library, like &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/pear.php.net&#039;);&quot;  href=&quot;http://pear.php.net&quot;&gt;PEAR&lt;/a&gt; or &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/framework.zend.com&#039;);&quot;  href=&quot;http://framework.zend.com&quot;&gt;Zend Framework&lt;/a&gt; &amp;#8211; or ven just the whole &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net&#039;);&quot;  href=&quot;http://www.php.net&quot;&gt;PHP&lt;/a&gt; language library &amp;#8211; it&amp;#8217;s absolutely vital you know what it can do.&lt;br /&gt;

&lt;br /&gt;

What you don&amp;#8217;t know can cost you weeks of effort and pain.  I found this out (again) today, but it&amp;#8217;s not my pain &amp;#8211; it&amp;#8217;s an employee who was too busy deciding that the Zend Framework wasn&amp;#8217;t suitable for a simple cron-script task, he has spent most of the last few weeks duplicating something that is not as good as what I could write &amp;#8211; with ZF &amp;#8211; in about an hour.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.topbit.co.uk/serendipity/archives/11-Know-thy-tools-first-of-all.html#extended&quot;&gt;Continue reading &quot;Know thy tools first of all&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 17 Mar 2008 20:09:22 +0000</pubDate>
    <guid isPermaLink="false">http://www.topbit.co.uk/serendipity/archives/11-guid.html</guid>
    <category>code</category>
<category>php</category>
<category>zend framework</category>
<category>zf</category>

</item>
<item>
    <title>Always have up to date documentation, part #1</title>
    <link>http://www.topbit.co.uk/serendipity/archives/10-Always-have-up-to-date-documentation,-part-1.html</link>
            <category>best-practices</category>
            <category>php</category>
    
    <comments>http://www.topbit.co.uk/serendipity/archives/10-Always-have-up-to-date-documentation,-part-1.html#comments</comments>
    <wfw:comment>http://www.topbit.co.uk/serendipity/wfwcomment.php?cid=10</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.topbit.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=10</wfw:commentRss>
    

    <author>topbit+s9y@gmail.com (Topbit)</author>
    <content:encoded>
    	&lt;p&gt;As I mentioned in my second post, &lt;a href=&quot;http://topbit.co.uk/serendipity/archives/4-ZCE-prep-and-dumb-tests.html&quot;&gt;&lt;span class=&quot;caps&quot;&gt;ZCE&lt;/span&gt; prep &amp;#8211; and dumb tests&lt;/a&gt; &amp;#8211; about open book tests (like Brainbench), having a copy of all the relevant documentation can be incredibly useful, if only from a speed issue.  Knowing you can just open a new tab and type a few words to get the information on a function, or concept from the manual takes away so many problems.  &lt;br /&gt;

&lt;br /&gt;

I mentioned there that I have a local copy of the main &lt;a href=&quot;htttp://php.net/manual/en/&quot;&gt;&lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; manual&lt;/a&gt; &amp;#8211; and I wanted to tell you how I keep it, and a couple of other manuals up to date, as well as other documentation.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.topbit.co.uk/serendipity/archives/10-Always-have-up-to-date-documentation,-part-1.html#extended&quot;&gt;Continue reading &quot;Always have up to date documentation, part #1&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 16 Mar 2008 23:41:00 +0000</pubDate>
    <guid isPermaLink="false">http://www.topbit.co.uk/serendipity/archives/10-guid.html</guid>
    <category>linux</category>
<category>php</category>
<category>tools</category>

</item>
<item>
    <title>ZCE prep - practice test #1</title>
    <link>http://www.topbit.co.uk/serendipity/archives/9-ZCE-prep-practice-test-1.html</link>
            <category>php</category>
    
    <comments>http://www.topbit.co.uk/serendipity/archives/9-ZCE-prep-practice-test-1.html#comments</comments>
    <wfw:comment>http://www.topbit.co.uk/serendipity/wfwcomment.php?cid=9</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.topbit.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=9</wfw:commentRss>
    

    <author>topbit+s9y@gmail.com (Topbit)</author>
    <content:encoded>
    	&lt;p&gt;Well, I&amp;#8217;ve just completed the &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/vulcan.phparch.com/&#039;);&quot;  href=&quot;http://vulcan.phparch.com/&quot;&gt;&lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; Arch &amp;#8216;Vulcan&amp;#8217; practice test&lt;/a&gt; &amp;#8211; the first of up to five such practice tests I&amp;#8217;ve purchased.  I have quite deliberately not gone through what study materials I have on hand before I took this test (I wanted to get a baseline), but none the less got an &amp;#8216;EXCELLENT&amp;#8217; final score, and the same &amp;#8216;Excellent&amp;#8217; on seven of the twelve sections the pre-test is broken down into.  &amp;#8216;Pass&amp;#8217; on four others, and just one &amp;#8216;Fail&amp;#8217; on the design (patterns) section.  If the real test worked much the same &amp;#8211; and with a composite score, rather than having to pass all sections &amp;#8211; I doubt I would have a problem to have gotten a passing grade.&lt;/p&gt;

	&lt;p&gt;Although the test (practice and real) is scheduled to take up to 90 minutes, after 45, I have finished the 70 questions.  I&amp;#8217;d set about half-dozen to review, but I don&amp;#8217;t think I changed any of those answers, and so after a little more than 50 minutes &amp;#8211; I called for the results.&lt;/p&gt;

	&lt;p&gt;It was much as I expected, with just some occasional requirements to know some parameter orders and specific use (the kinda thing where you test it, and if you didn&amp;#8217;t get it right first time, I would trivially look it up to check, for functions like sub-string searching).  Also several questions on &lt;span class=&quot;caps&quot;&gt;XML&lt;/span&gt; handling, which I muddled along with.&lt;/p&gt;

	&lt;p&gt;Streams, strings and web-features are something I will have to look at more carefully for next time, but for me the big one is design patterns &amp;#8211; it was my only failing section.  &lt;/p&gt;

	&lt;p&gt;All in all, I&amp;#8217;ve very happy with this evening&amp;#8217;s events and the (practice) results.&lt;/p&gt;

	&lt;table&gt;
		&lt;tr&gt;
			&lt;td&gt;Category&lt;/td&gt;
			&lt;td&gt;Grade&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;XML&lt;/span&gt; &amp;amp; Web Services&lt;/td&gt;
			&lt;td&gt;&lt;strong&gt;EXCELLENT&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Arrays&lt;/td&gt;
			&lt;td&gt;&lt;strong&gt;EXCELLENT&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Web Features&lt;/td&gt;
			&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;PASS&lt;/span&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Basic Language&lt;/td&gt;
			&lt;td&gt;&lt;strong&gt;EXCELLENT&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Streams and Network Programming&lt;/td&gt;
			&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;PASS&lt;/span&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Database Access&lt;/td&gt;
			&lt;td&gt;&lt;strong&gt;EXCELLENT&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;String Manipulation and Regular Expressions&lt;/td&gt;
			&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;PASS&lt;/span&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; 4/5 differences&lt;/td&gt;
			&lt;td&gt;&lt;strong&gt;EXCELLENT&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Security&lt;/td&gt;
			&lt;td&gt;&lt;strong&gt;EXCELLENT&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;OOP&lt;/span&gt;&lt;/td&gt;
			&lt;td&gt;&lt;strong&gt;EXCELLENT&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Functions&lt;/td&gt;
			&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;PASS&lt;/span&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Design&lt;/td&gt;
			&lt;td&gt;&lt;strong&gt;FAIL&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/table&gt; 
    </content:encoded>

    <pubDate>Thu, 13 Mar 2008 21:33:00 +0000</pubDate>
    <guid isPermaLink="false">http://www.topbit.co.uk/serendipity/archives/9-guid.html</guid>
    <category>exams</category>
<category>php</category>

</item>
<item>
    <title>A useful idea for helping to enforce PHP code standards</title>
    <link>http://www.topbit.co.uk/serendipity/archives/8-A-useful-idea-for-helping-to-enforce-PHP-code-standards.html</link>
            <category>best-practices</category>
            <category>php</category>
    
    <comments>http://www.topbit.co.uk/serendipity/archives/8-A-useful-idea-for-helping-to-enforce-PHP-code-standards.html#comments</comments>
    <wfw:comment>http://www.topbit.co.uk/serendipity/wfwcomment.php?cid=8</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.topbit.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=8</wfw:commentRss>
    

    <author>topbit+s9y@gmail.com (Topbit)</author>
    <content:encoded>
    	&lt;p&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/raphaelstolt.blogspot.com/2008/03/sniffing-refactoring-needs.html&#039;);&quot;  href=&quot;http://raphaelstolt.blogspot.com/2008/03/sniffing-refactoring-needs.html&quot;&gt;extending PHP_CodeSniffer&lt;/a&gt; by Raphael Stolt shows how to quite easily add to a tool that will report what parts of your &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; source needs a clean-up, from the built in &amp;#8216;sniffs&amp;#8217; for coding standards, and now adding to that for some slightly more opinionated choices on the maximum number of lines per function, or functions per class.&lt;br /&gt;

&lt;br /&gt;

This could be a start of a whole collection of additional classes for additional checks.&lt;br /&gt;

&lt;br /&gt;

The only challenge I see at the moment (and I don&amp;#8217;t think it&amp;#8217;s a big one, though I&amp;#8217;ve not tried it, so it might not even exist, I&amp;#8217;ve just not had the opportunity to look yet) is having to put code into the &lt;span class=&quot;caps&quot;&gt;PEAR&lt;/span&gt; directory path, since that is where PHP_CodeSniffer is looking for the base library.  I do see that they use long &lt;span class=&quot;caps&quot;&gt;PEAR&lt;/span&gt; class-names, so it may just a matter of having the phpcs tool look elsewhere for the base coding style class.&lt;br /&gt;

&lt;br /&gt;

1234.20080102 dev&amp;#8217;). After a quick wander around the newly checked out version, maybe run a set of unit tests, just for security, it&amp;#8217;s just as easy to put a similar &amp;#8216;live&amp;#8217; symlink into place with a new link.&lt;br /&gt;

&lt;br /&gt;

If there is ever a problem, rolling back to a previous live version is just as easy. Other configuration changes are made within the code on the apache servername, or the machine&amp;#8217;s own hostname (more useful for &lt;span class=&quot;caps&quot;&gt;CLI&lt;/span&gt; scripts, generally run from cron).&lt;br /&gt;

&lt;br /&gt;

There are some downsides &amp;#8211; with a complete checkout of a 40-some megabyte website (it&amp;#8217;s mostly the Zend Framework and other libraries from which I use a number of files, though rarely all), it takes a little while (not too long, it&amp;#8217;s a gigabit link between the repository and the main webserver) and there are also some potential caching issues (Etags are usually based on the file inodes), but as we plan to move to a multi-machine cluster &amp;#8211; and the images aren&amp;#8217;t being served from Apache, but a dedicated image webserver, that&amp;#8217;s not a significant issue &amp;#8211; and even on Apache we don&amp;#8217;t have Etags enabled (Yslow from Yahoo also suggests that).&lt;br /&gt;

&lt;br /&gt;

&lt;strong&gt;[edit: 18:06]&lt;/strong&gt;&lt;br /&gt;

Ahah, some investigation &amp;#8211; and copious use of echos in the phpcs script, and /usr/share/php/PHP/CodeSniffer.php class:&lt;br /&gt;

&lt;br /&gt;

Creating your own standards, and using them from anywhere on the filesystem &amp;#8211; not having to link from inside the PEAR/PHP/CodeSniffer directory:&lt;br /&gt;

&lt;br /&gt;

&lt;h2&gt;The coding standard class with your extension:&lt;/h2&gt;&lt;br /&gt;

The class is called PHP_CodeSniffer_Standards_Example_ExampleCodingStandard &amp;#8211; the two &lt;em&gt;&amp;#8216;Example&amp;#8217;&lt;/em&gt;s being the name of the coding standard.  The file is called &amp;#8216;Example/ExampleCodingStandard.php&amp;#8217;&lt;br /&gt;

&lt;br /&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// in the &amp;#8230;./Example/ directory&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;require_once&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;#8216;PHP/CodeSniffer/Standards/CodingStandard.php&amp;#8217;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; PHP_CodeSniffer_Standards_Example_ExampleCodingStandard extends PHP_CodeSniffer_Standards_CodingStandard&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; getIncludedSniffs&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/array&#039;);&quot;  href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;br /&gt;
&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;#8216;PEAR&amp;#8217;&lt;/span&gt;,&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// the main &lt;span class=&quot;caps&quot;&gt;PEAR&lt;/span&gt; standards&lt;/span&gt;&lt;br /&gt;
&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Add our other standards, all from a subdir&lt;/span&gt;&lt;br /&gt;
&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/dirname&#039;);&quot;  href=&quot;http://www.php.net/dirname&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;dirname&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&lt;i&gt;FILE&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;#8216;/Standards&amp;#8217;&lt;/span&gt;,&amp;#160; &amp;#160;&lt;br /&gt;
&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; getExcludedSniffs&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/array&#039;);&quot;  href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;#160;&lt;/div&gt;&lt;br /&gt;

&lt;br /&gt;

And in the subdir: .../Example/Standards/&lt;br /&gt;

 &amp;#8211; Raphael&amp;#8217;s ToManyMethodsSniff.php and MethodLengthSniff.php files &amp;#8220;from his post&amp;#8221;:http://raphaelstolt.blogspot.com/2008/03/sniffing-refactoring-needs.html&lt;br /&gt;

&lt;br /&gt;

To call it:&lt;br /&gt;

&lt;div class=&quot;bash&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# we have to give the full path to the file called Example/ExampleCodingStandard.php&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# $(pwd)/ is just Bash-ish for outputting the current directory name&lt;/span&gt;&lt;br /&gt;
phpcs &amp;#8212;&lt;span style=&quot;color: #0000ff;&quot;&gt;standard=&lt;/span&gt;$&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;pwd&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;/Example /path/to/file/to/check/&amp;#160; | less&lt;br /&gt;
&amp;#160;&lt;/div&gt;&lt;br /&gt;
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 11 Mar 2008 17:16:00 +0000</pubDate>
    <guid isPermaLink="false">http://www.topbit.co.uk/serendipity/archives/8-guid.html</guid>
    <category>code</category>
<category>php</category>
<category>standards</category>
<category>tools</category>

</item>
<item>
    <title>ZCE prep - and dumb tests</title>
    <link>http://www.topbit.co.uk/serendipity/archives/4-ZCE-prep-and-dumb-tests.html</link>
            <category>php</category>
    
    <comments>http://www.topbit.co.uk/serendipity/archives/4-ZCE-prep-and-dumb-tests.html#comments</comments>
    <wfw:comment>http://www.topbit.co.uk/serendipity/wfwcomment.php?cid=4</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.topbit.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=4</wfw:commentRss>
    

    <author>topbit+s9y@gmail.com (Topbit)</author>
    <content:encoded>
    	&lt;p&gt;This week I&amp;#8217;m going to take the first of my PHPArch.com&amp;#8217;s &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.zend.com/en/services/certification/&#039;);&quot;  href=&quot;http://www.zend.com/en/services/certification/&quot;&gt;ZCE&lt;/a&gt; prep test &amp;#8211; then I&amp;#8217;ll read the book and see they they expect me to know.&lt;/p&gt;

	&lt;p&gt;Going for the Zend Certification is something I&amp;#8217;ve been thinking of doing for a couple of years, and especially now that it covers PHP5 &amp;#8211; and increasingly good practices and security topics.  It&amp;#8217;s not that I need to get the &lt;span class=&quot;caps&quot;&gt;ZCE&lt;/span&gt;, I&amp;#8217;d go for it , for the intellectual challenge if nothing else.  It&amp;#8217;s also the closest thing I would have to a professional qualification since I completed a &lt;span class=&quot;caps&quot;&gt;HNC&lt;/span&gt; computer studies in 1992 &amp;#8211; and that was just 1/day week day release over the course of a couple of years.&lt;/p&gt;

	&lt;p&gt;Of course, it&amp;#8217;s not the first &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; test I&amp;#8217;ve taken &amp;#8211; last year, just before the &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; London 2007 conference, &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.allegisgroup.co.uk/&#039;);&quot;  href=&quot;http://www.allegisgroup.co.uk/&quot;&gt;Allegis&lt;/a&gt; had come along to the &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; groups&amp;#8217;s early-February meeting, to plug their services (and they got business from it, one guy interview the following day, a Friday, and started work on the Monday) &amp;#8211; but they offered to have anyone that wanted to do the Brainbench test, paid for, by Allegis.&lt;/p&gt;

	&lt;p&gt;At the time, I had just started a couple of days before at a job near Covent Garden, but then left it after a week for a better gig (where I still am now, some 13 months on) &amp;#8211; but I took Allegis up on the offer, and finally got the results at the conference.  I never did get a copy of the exact numbers, but I was told the headlines, so these may not be exact, but they are certainly in the ballpark.
	&lt;ul&gt;
		&lt;li&gt;Time: 28 minutes (apparently this is very good)&lt;/li&gt;
		&lt;li&gt;Score 4.73 (out of 5.0)&lt;/li&gt;
		&lt;li&gt;Better than 98% of other test-takers.&lt;/li&gt;
	&lt;/ul&gt;&lt;br /&gt;
I&amp;#8217;m told that the harder the questions you answer, the harder the next questions get &amp;#8211; so getting from 4.0 to 5.0 is a lot harder than getting from 3.0 to 4.0 &amp;#8211; if I&amp;#8217;m wrong about that, then please let me know.&lt;/p&gt;

	&lt;p&gt;The thing is, the Brainbench tests are open-book &amp;#8211; they pretty much have to be, you take them at home, though they are against the clock.  I can certainly appreciate the logic of it &amp;#8211; after all, which serious developer doesn&amp;#8217;t have an internet connection and a quick bookmark to http://php.net (and I&amp;#8217;ve look at the other language sites &amp;#8211; php.net is by far the best), or at least a copy of the documentation around (.&lt;span class=&quot;caps&quot;&gt;CHM&lt;/span&gt; file or just a bunch of &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; pages &amp;#8211; or, like I do, a weekly rsynced copy of the php.net manual!).  Just as well I did, the tests I&amp;#8217;ve seen always throw in some pointless questions like how to use &lt;span class=&quot;caps&quot;&gt;LDAP&lt;/span&gt;, or how to connect to an Oracle database.  I&amp;#8217;ve never used either of them, so I don&amp;#8217;t bother to learn them &amp;#8211; but if I did need them, I&amp;#8217;d figure it out in a few minutes reading &amp;#8211; or, more likely, I&amp;#8217;d have some kind of library, like the Zend Framework which did the hard work for me &amp;#8211; plus, I&amp;#8217;d only end up writing that kind of code once anyway before I threw it into a function and forgot the minutiae.&lt;/p&gt;

	&lt;p&gt;It saddens me when people are too dumb to do well on such a test though &amp;#8211; how hard is it to read the manual, at least well enough to know where to refer to for more advice?&lt;/p&gt;

	&lt;p&gt;The &lt;span class=&quot;caps&quot;&gt;ZCE&lt;/span&gt; is a closed book exam &amp;#8211; or, as I call it (for all the reasons the brain-bench is open-book) &amp;#8211; unrealistic.  If I can&amp;#8217;t recall whether the $haystack or $needle come first in in array or string search &amp;#8211; it&amp;#8217;s but a moment to look it up.&lt;/p&gt;

	&lt;p&gt;Even though I&amp;#8217;ve listed my scores above, I don&amp;#8217;t bother to promote myself with them on my CV &amp;#8211; indeed Allegis is the only company (recruiter or not) that know them &amp;#8211; they did pay for it after all. Because I can get those kind of scores with what I consider so little effort (about half-an-hour&amp;#8217;s worth in fact), then either the test is bad, or 98% of the other people that gave taken that test are.  Frankly, I&amp;#8217;ve got to think it&amp;#8217;s mostly the latter.&lt;/p&gt;

	&lt;p&gt;Keep reading my posts, and I&amp;#8217;ll tell you want you need to do to ace your tests &amp;#8211; and not look a fool when it comes to developing something I might set you.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Mon, 10 Mar 2008 21:55:00 +0000</pubDate>
    <guid isPermaLink="false">http://www.topbit.co.uk/serendipity/archives/4-guid.html</guid>
    <category>exams</category>
<category>php</category>
<category>phplondon07</category>
<category>phplondon08</category>

</item>
<item>
    <title>svn checkouts vs exports for live versions</title>
    <link>http://www.topbit.co.uk/serendipity/archives/1-svn-checkouts-vs-exports-for-live-versions.html</link>
            <category>best-practices</category>
            <category>php</category>
    
    <comments>http://www.topbit.co.uk/serendipity/archives/1-svn-checkouts-vs-exports-for-live-versions.html#comments</comments>
    <wfw:comment>http://www.topbit.co.uk/serendipity/wfwcomment.php?cid=1</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.topbit.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=1</wfw:commentRss>
    

    <author>topbit+s9y@gmail.com (Topbit)</author>
    <content:encoded>
    I&#039;ve just read http://www.svn-checkout.co.uk/2008/01/19/how-to-release-new-versions-of-websites/ via http://www.lornajane.net/posts/2008/SVN-Deployment-and-a-New-Site and while I consider revision control an essential tool (my current job is the only one in the last five years where I didn&#039;t have to install my own RCS, but in the year I&#039;ve been here so far, I&#039;ve added nearly 1000 revisions), I somewhat disagree on the idea they suggest.&lt;br /&gt;
&lt;br /&gt;
That first link, &#039;how to release new versions of websites&#039;, suggests checking out a version of the site as a working copy, (it&#039;s certainly something I&#039;ve done before now), but then it goes on to use the &#039;svn switch&#039; capability to move between versions (of course, they are also doing in in TortoiseSvn, and there for the live web-server is likely to be running Windows, no way I&#039;d run a server on Windows - not even for testing). There is however some trouble with revision switching - especially on a busy site that has to keep running even while the new version is being put into place. While SVN does atomic commits - the new code goes into the repository all at once, or not, it&#039;s harder to do the all at once part on a non-transactional file-system - such as a webserver. The bigger problem is that rolling back will also take time - and in an emergency, the time taken to do something is crucial.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s what I do - Whenever I want a new version to go live, which might be from every couple of days to as often as a couple of times per day, I&#039;ll update run the script below with the specific revision number to export (and a date/time, but that&#039;s just for easy reference). When it runs, it also symlinks the given version as &#039;dev&#039; - which is part of the path to the site &#039;dev.example.com&#039;, wham, instant new version, and I can trivially delete the symlink and on the same command line symlink the older version (with &#039;rm dev &amp;&amp;amp; ln -s 1234.20080102 dev&#039;). After a quick wander around the newly checked out version, maybe run a set of unit tests, just for security, it&#039;s just as easy to put a similar &#039;live&#039; symlink into place with a new link.&lt;br /&gt;
&lt;br /&gt;
If there is ever a problem, rolling back to a previous live version is just as easy. Other configuration changes are made within the code on the apache servername, or the machine&#039;s own hostname (more useful for CLI scripts, generally run from cron).&lt;br /&gt;
&lt;br /&gt;
There are some downsides - with a complete checkout of a 40-some megabyte website (it&#039;s mostly the Zend Framework and other libraries from which I use a number of files, though rarely all), it takes a little while (not too long, it&#039;s a gigabit link between the repository and the main webserver) and there are also some potential caching issues (Etags are usually based on the file inodes), but as we plan to move to a multi-machine cluster - and the images aren&#039;t being served from Apache, but a dedicated image webserver, that&#039;s not a significant issue - and even on Apache we don&#039;t have Etags enabled (Yslow from Yahoo also suggests that).&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;bash&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#!/bin/sh&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;REV=&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1914&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;REVDIR=&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$REV&lt;/span&gt;.&lt;span style=&quot;color: #cc66cc;&quot;&gt;20080214&lt;/span&gt;.&lt;span style=&quot;color: #cc66cc;&quot;&gt;1914&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;REPOSITORY=&lt;/span&gt;svn+ssh://username@svn.example.com/var/svn/SITEURL/trunk&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;IMAGES=&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$REVDIR&lt;/span&gt;/htdocs/i&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;STATIC1=&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$REVDIR&lt;/span&gt;/example.co.uk&lt;br /&gt;&lt;br /&gt;svn &lt;span style=&quot;color: #000066;&quot;&gt;export&lt;/span&gt; --revision &lt;span style=&quot;color: #0000ff;&quot;&gt;$REV&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$REPOSITORY&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$REVDIR&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;mkdir -p &lt;span style=&quot;color: #0000ff;&quot;&gt;$REVDIR&lt;/span&gt;/tmp/templates_c&lt;br /&gt;chown -R www-data: &lt;span style=&quot;color: #0000ff;&quot;&gt;$REVDIR&lt;/span&gt;&lt;br /&gt;chmod -R &lt;span style=&quot;color: #cc66cc;&quot;&gt;777&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$REVDIR&lt;/span&gt;/tmp &lt;span style=&quot;color: #0000ff;&quot;&gt;$REVDIR&lt;/span&gt;/htdocs/cache/&lt;br /&gt;chown -R nobody: &lt;span style=&quot;color: #0000ff;&quot;&gt;$REVDIR&lt;/span&gt;/tmp &lt;span style=&quot;color: #0000ff;&quot;&gt;$REVDIR&lt;/span&gt;/htdocs/cache/ &lt;span style=&quot;color: #0000ff;&quot;&gt;$IMAGES&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$STATIC1&lt;/span&gt;&lt;br /&gt;dos2unix &lt;span style=&quot;color: #0000ff;&quot;&gt;$REVDIR&lt;/span&gt;/bin/*sh &lt;span style=&quot;color: #0000ff;&quot;&gt;$REVDIR&lt;/span&gt;/bin/*php&lt;br /&gt;chmod &lt;span style=&quot;color: #cc66cc;&quot;&gt;755&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$REVDIR&lt;/span&gt;/bin/*sh &lt;span style=&quot;color: #0000ff;&quot;&gt;$REVDIR&lt;/span&gt;/bin/*php&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# chmod -x all the non-directories in images&lt;/span&gt;&lt;br /&gt;find &lt;span style=&quot;color: #0000ff;&quot;&gt;$IMAGES&lt;/span&gt; -&lt;span style=&quot;color: #000066;&quot;&gt;type&lt;/span&gt; f -perm -a+x | xargs -r chmod --quiet -x&lt;br /&gt;find &lt;span style=&quot;color: #0000ff;&quot;&gt;$STATIC1&lt;/span&gt; -&lt;span style=&quot;color: #000066;&quot;&gt;type&lt;/span&gt; f -perm -a+x | xargs -r chmod --quiet -x&lt;br /&gt;&lt;br /&gt;ls -l &lt;span style=&quot;color: #0000ff;&quot;&gt;$IMAGES&lt;/span&gt;/* | grep -- &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;-x&quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# make the latest version available at http://dev.example.com&lt;/span&gt;&lt;br /&gt;rm dev &amp;amp;&amp;amp; ln -s &lt;span style=&quot;color: #0000ff;&quot;&gt;$REVDIR&lt;/span&gt; dev&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Sun, 09 Mar 2008 19:45:30 +0000</pubDate>
    <guid isPermaLink="false">http://www.topbit.co.uk/serendipity/archives/1-guid.html</guid>
    <category>geek</category>
<category>linux</category>
<category>php</category>
<category>subversion</category>

</item>

</channel>
</rss>