<?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>phly, boy, phly (Entries tagged as pear)</title>
    <link>http://weierophinney.net/matthew/</link>
    <description>Ramblings on PHP, Linux, and other Geeky Topics</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.0.4 - http://www.s9y.org/</generator>
    <pubDate>Sat, 21 Aug 2010 22:37:14 GMT</pubDate>

    <image>
        <url>http://weierophinney.net/matthew/templates/matthew/img/s9y_banner_small.png</url>
        <title>RSS: phly, boy, phly - Ramblings on PHP, Linux, and other Geeky Topics</title>
        <link>http://weierophinney.net/matthew/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Autoloading Benchmarks</title>
    <link>http://weierophinney.net/matthew/archives/245-Autoloading-Benchmarks.html</link>
            <category>PHP</category>
    
    <comments>http://weierophinney.net/matthew/archives/245-Autoloading-Benchmarks.html#comments</comments>
    <wfw:comment>http://weierophinney.net/matthew/wfwcomment.php?cid=245</wfw:comment>

    <slash:comments>39</slash:comments>
    <wfw:commentRss>http://weierophinney.net/matthew/rss.php?version=2.0&amp;type=comments&amp;cid=245</wfw:commentRss>
    

    <author>nospam@example.com (Matthew Weier O'Phinney)</author>
    <content:encoded>
    &lt;p&gt;
During the past week, I&#039;ve been looking at different strategies for &lt;a href=&quot;http://php.net/autoload&quot;&gt;autoloading&lt;/a&gt; in &lt;a href=&quot;http://framework.zend.com/&quot;&gt;Zend Framework&lt;/a&gt;. I&#039;ve suspected for some time that our class loading strategy might be one source of performance degradation, and wanted to research some different approaches, and compare performance.
&lt;/p&gt;

&lt;p&gt;
In this post, I&#039;ll outline the approaches I&#039;ve tried, the benchmarking stategy I applied, and the results of benchmarking each approach.
&lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://weierophinney.net/matthew/archives/245-Autoloading-Benchmarks.html#extended&quot;&gt;Continue reading &quot;Autoloading Benchmarks&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Tue, 17 Aug 2010 09:30:00 -0400</pubDate>
    <guid isPermaLink="false">http://weierophinney.net/matthew/archives/245-guid.html</guid>
    <category>best practices</category>
<category>pear</category>
<category>php</category>
<category>zend framework</category>

</item>
<item>
    <title>Server Upgrades... lost entries...</title>
    <link>http://weierophinney.net/matthew/archives/171-Server-Upgrades...-lost-entries....html</link>
            <category>Linux</category>
            <category>PHP</category>
            <category>Programming</category>
    
    <comments>http://weierophinney.net/matthew/archives/171-Server-Upgrades...-lost-entries....html#comments</comments>
    <wfw:comment>http://weierophinney.net/matthew/wfwcomment.php?cid=171</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://weierophinney.net/matthew/rss.php?version=2.0&amp;type=comments&amp;cid=171</wfw:commentRss>
    

    <author>nospam@example.com (Matthew Weier O'Phinney)</author>
    <content:encoded>
    &lt;p&gt;
    My good friend, Rob, hosts my site for me, in return for helping with server
    maintenance. After being on Gentoo for the past three years, though, we
    decided it was time to switch to something a little easier to maintain, so
    last night we wiped the system partitions and installed Ubuntu server.
&lt;/p&gt;

&lt;p&gt;
    I&#039;ll say this: the setup is much faster! However, we had a few gotchas that
    surprised us -- it didn&#039;t setup our RAID array out-of-the-box, which led to
    a good hour of frustration as we tried to verify that the install wouldn&#039;t
    wipe it, and then to verify that we could re-assemble it.  (We succeeded.)
    Additionally, we second-guessed a few things we shouldn&#039;t have, which led to
    needing to back out and reconfigure. But what was over a 12 hour install
    with Gentoo we accomplished in a matter of a few hours with Ubuntu server --
    so it was a huge success that way.
&lt;/p&gt;

&lt;p&gt;
    Unfortunately, our mysqldump of all databases... wasn&#039;t, a fact we
    discovered only after importing it into the new system. I ended up losing my
    blog database and PEAR channel database. Fortunately, the PEAR channel
    has not changed at all in the past year, so we had an old backup that
    worked, and I had a snapshot of my blog database from three weeks ago I was
    able to use. As a result, there are a few missing entries, but for the most
    part, all works. If you commented on one of those missing entries, my
    apologies.
&lt;/p&gt;

&lt;p&gt;
    Now that the install is done, I&#039;m also finalizing some design changes to my
    blog -- it&#039;s time to leave the black and white for more colorful grounds.
    Look for a revamp in the coming weeks!
&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Fri, 16 May 2008 09:05:13 -0400</pubDate>
    <guid isPermaLink="false">http://weierophinney.net/matthew/archives/171-guid.html</guid>
    <category>linux</category>
<category>pear</category>
<category>personal</category>
<category>php</category>
<category>programming</category>
<category>ubuntu</category>

</item>
<item>
    <title>2007 Retrospective</title>
    <link>http://weierophinney.net/matthew/archives/154-2007-Retrospective.html</link>
            <category>Personal</category>
            <category>PHP</category>
            <category>Programming</category>
    
    <comments>http://weierophinney.net/matthew/archives/154-2007-Retrospective.html#comments</comments>
    <wfw:comment>http://weierophinney.net/matthew/wfwcomment.php?cid=154</wfw:comment>

    <slash:comments>5</slash:comments>
    <wfw:commentRss>http://weierophinney.net/matthew/rss.php?version=2.0&amp;type=comments&amp;cid=154</wfw:commentRss>
    

    <author>nospam@example.com (Matthew Weier O'Phinney)</author>
    <content:encoded>
    &lt;p&gt;
    2007 was a busy year, both personally and professionally. I won&#039;t go into
    the personal too much, because, well, it&#039;s personal, and some of the details
    are simply inappropriate for blogging material.
&lt;/p&gt;

&lt;p&gt;
    Here&#039;s the short version:
&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;One trip to Belgium and The Netherlands.&lt;/li&gt;
    &lt;li&gt;Two trips to Israel.&lt;/li&gt;
    &lt;li&gt;Two trips to Atlanta, GA (not counting the return trip from Europe, when
    I was stranded for a day due to storms in the Northeast).&lt;/li&gt;
    &lt;li&gt;Three different user groups attended, with three presentations.&lt;/li&gt;
    &lt;li&gt;One major Zend Framework release&lt;/li&gt;
    &lt;li&gt;One PEAR release.&lt;/li&gt;
    &lt;li&gt;One podcast.&lt;/li&gt;
    &lt;li&gt;One webinar.&lt;/li&gt;
    &lt;li&gt;One book published.&lt;/li&gt;
    &lt;li&gt;One conference attended.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
    What follows is my month-by-month breakdown:
&lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://weierophinney.net/matthew/archives/154-2007-Retrospective.html#extended&quot;&gt;Continue reading &quot;2007 Retrospective&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Tue, 01 Jan 2008 16:49:26 -0500</pubDate>
    <guid isPermaLink="false">http://weierophinney.net/matthew/archives/154-guid.html</guid>
    <category>best practices</category>
<category>books</category>
<category>conferences</category>
<category>file_fortune</category>
<category>mvc</category>
<category>pear</category>
<category>personal</category>
<category>php</category>
<category>programming</category>
<category>zend framework</category>
<category>zendcon</category>

</item>
<item>
    <title>File_Fortune refactored</title>
    <link>http://weierophinney.net/matthew/archives/142-File_Fortune-refactored.html</link>
            <category>PHP</category>
    
    <comments>http://weierophinney.net/matthew/archives/142-File_Fortune-refactored.html#comments</comments>
    <wfw:comment>http://weierophinney.net/matthew/wfwcomment.php?cid=142</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://weierophinney.net/matthew/rss.php?version=2.0&amp;type=comments&amp;cid=142</wfw:commentRss>
    

    <author>nospam@example.com (Matthew Weier O'Phinney)</author>
    <content:encoded>
    &lt;p&gt;
    Over the past few evenings, I&#039;ve refactored &lt;a href=&quot;http://pear.php.net/trackback/trackback.php?id=File_Fortune&quot;&gt;File_Fortune&lt;/a&gt;
    to have it implement Iterator, Countable, and ArrayAccess -- basically
    allowing it to act like an array for most intents and purposes. As a result,
    I&#039;ve eliminated the need for the &lt;kbd&gt;File_Fortune_Writer&lt;/kbd&gt; package, and
    greatly simplified the usage.
&lt;/p&gt;

&lt;p&gt;
    (Note: sure, File_Fortune may not be that big of a deal, but over 1000
    downloads in the past two years indicates &lt;em&gt;somebody&lt;/em&gt; is using it.
    Plus, it powers the random quotes on the family website. &lt;img src=&quot;http://weierophinney.net/matthew/templates/matthew/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; )
&lt;/p&gt;

&lt;p&gt;
    As some examples:
&lt;/p&gt;
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&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;&#039;File/Fortune.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Initialize and point it to a directory of fortunes&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$fortunes&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; File_Fortune&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;/path/to/fortunedir&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Retrieve a random fortune &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// (works with either a directory or a single fortune file)&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$fortunes&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getRandom&lt;/span&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;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Set to a specific fortune file:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$fortunes&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setFile&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;myfortunes&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Loop through and print all fortunes&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$fortunes&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$fortune&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;a href=&quot;http://www.php.net/str_repeat&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;str_repeat&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;-&#039;&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc;&quot;&gt;72&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$fortune&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Hmmm.. let&#039;s change one:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$fortunes&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;7&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;I never really liked that fortune anyways.&quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// No need to explicitly save, as it&#039;s done during __destruct(), &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// but if you really want to:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$fortunes&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;save&lt;/span&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;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Let&#039;s add a new fortune:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$fortunes&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;This is a shiny new fortune!&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// and now we&#039;ll verify it exists:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$index&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/count&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;count&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$fortunes&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; - &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$fortunes&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$index&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;br /&gt;&amp;#160;&lt;/div&gt;

&lt;p&gt;
    All-in-all, it&#039;s a much better interface. Lesson learned: when porting code
    from other languages, it pays to take some time and determine if there might
    be a better API in your own.
&lt;/p&gt;
&lt;p&gt;
    In upcoming releases, I hope to modify the backend to use PHP&#039;s Streams API
    instead of direct file access, and also to allow providing a list of fortune
    files explicitly. After that, I should be ready for the initial stable
    release.
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Update (2007-07-10): fixed parse error in examples&lt;/b&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 05 Jul 2007 17:26:00 -0400</pubDate>
    <guid isPermaLink="false">http://weierophinney.net/matthew/archives/142-guid.html</guid>
    <category>file_fortune</category>
<category>pear</category>
<category>php</category>

</item>

</channel>
</rss>