<?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>Thu, 23 May 2013 21:35:07 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: Autoloading in PHP and the PSR-0 Standard]]></title>
      <guid>http://www.phpdeveloper.org/news/17534</guid>
      <link>http://www.phpdeveloper.org/news/17534</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial <a href="http://phpmaster.com/autoloading-and-the-psr-0-standard/">introducing you to the PSR-0 standard</a> and how it effects the autoloading in many PHP applications and frameworks. Specifically, they show how it's implemented in a <a href="http://symfony.com">Symfony2</a> component
</p>
<blockquote>
In this article I'll walk you through the "history of autoloading," from the older to the current PSR-0 standard autoloader approach found in many PHP frameworks such as Lithium, Symfony, Zend, etc. Then I will introduce you to the ClassLoader component from the Symfony2 project for PHP 5.3 which follows the PSR-0 standard.
</blockquote>
<p>
He starts with a look at a basic "__autoload" function call that looks in a directory for libraries. Improving on that, he makes two methods for loading - one for controllers, the other for models - and a loader that splits on the "_" character and determines the path from there.
</p>
<p>
Even this isn't PSR-0, though, so he shows how using namespace information, you can load classes in a unified way. He shows how to implement this with a loader that's already well-developed and ready for use - the Symfony ClassLoader component. They show how to register namespaces, prefixes as well as use the APC functionality to manually store/fetch the APC version of the loaded file's opcodes.
</p>]]></description>
      <pubDate>Mon, 13 Feb 2012 12:29:24 -0600</pubDate>
    </item>
  </channel>
</rss>
