<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sat, 18 May 2013 07:00:40 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Test.ical.ly Blog: PHP 5.3 and the Symfony2 UniversalClassLoader - Where to load?]]></title>
      <guid>http://www.phpdeveloper.org/news/15743</guid>
      <link>http://www.phpdeveloper.org/news/15743</link>
      <description><![CDATA[<p>
In doing some work on <a href="https://github.com/caefer/ImageTransform">a project of his</a>, <i>Christian</i> came across the need for some autoloading in his libraries. His search <a href="http://test.ical.ly/2011/01/13/php-5-3-and-the-symfony2-universalclassloader-where-to-load/">lead him to the Symfony autoloading tool</a> the <a href="http://docs.symfony-reloaded.org/guides/tools/autoloader.html">UniversalClassLoader</a>.
</p>
<blockquote>
I'm not yet sure what is the best approach to use this loader. When I started looking for examples I sent a small tweet which was replied to by Stefan Koopmanschap as he used this class loader in one of his own libraries. What he did is to include the class/namespace registering code in one of the central classes of his library. If you take a look at my code you will see the same approach.
</blockquote>
<p>
He decides that the library itself shouldn't try to do the autoloading itself. It should always assume that there's something in place to load the files/classes it needs to get the job done. The <a href="http://docs.symfony-reloaded.org/guides/tools/autoloader.html">UniversalClassLoader</a> is prefect for this but, in his option, shouldn't be a part of an application's functionality (see his <a href="https://github.com/caefer/ImageTransform/commit/0ddb9f87aa739aa2a94860cf74194d4c56827d73">commit here</a> removing the autoloader).
</p>]]></description>
      <pubDate>Fri, 14 Jan 2011 11:21:00 -0600</pubDate>
    </item>
  </channel>
</rss>
