<?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>Tue, 21 May 2013 08:24:08 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Phil Sturgeon: Composer and PSR-0: Friends, Not Relatives]]></title>
      <guid>http://www.phpdeveloper.org/news/19562</guid>
      <link>http://www.phpdeveloper.org/news/19562</link>
      <description><![CDATA[<p>
<i>Phil Sturgeon</i> has a new post today that looks at the relationship between the PSR-0 standard (autoloading structure) and Composer - noting that they're <a href="http://philsturgeon.co.uk/blog/2013/05/composer-and-psr0-friends-not-relatives">friends, not relatives</a>.
</p>
<blockquote>
As a huge proponent of Composer, a happy user of PSR-0 and a voting member on the PHP-FIG I get into plenty of conversations about all of them and it worries me how much confusion there is in the community about these things not actually being related. [...] It seems that a lot of folks discover Composer and PSR-0 at the same time and seem to assume they are the same thing - especially since both Composer and PSR-0 have the idea of a "vendor" and a "package", but those two things are not related to each other either. These are a few points that I have wanted to clarify during some strange conversations over the last few weeks.
</blockquote>
<p>
He goes on, trying to clear up some of the confusion around the idea of "vendors" and vendor names. He talks about naming schemes and how they may or may not be related to the vendor name on the package. He looks at the PSR-0 loading methods and how the structure of the library/repository effects that (noting that Composer can be made to accommodate something not PSR-0 by default). He suggests that PSR-0 needs to remain "implementation agnostic" and that Composer, at the same time, should remain "specification agnostic" .
</p>
Link: http://philsturgeon.co.uk/blog/2013/05/composer-and-psr0-friends-not-relatives]]></description>
      <pubDate>Wed, 08 May 2013 11:15:42 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Phil Sturgeon: Is PSR-0 Shortsighted, or are you?]]></title>
      <guid>http://www.phpdeveloper.org/news/19472</guid>
      <link>http://www.phpdeveloper.org/news/19472</link>
      <description><![CDATA[<p>
In a response to <a href="http://phpdeveloper.org/news/19469">this previous post</a> about the PSR-0 standard and why it might be "shortsighted", <i>Phil Sturgeon</i> has <a href="http://philsturgeon.co.uk/blog/2013/04/is-psr0-shortsighted-or-are-you">posted some of his own thoughts</a> on the matter as a participant (and supporter) in the PHP-FIG group.
</p>
<blockquote>
One of the fun things about trying to support the PHP-FIG and all the good its doing, is seeing blog posts written complaining about it by people that just don't know what they're talking about. I get involved in conversations on Reddit (dangerous I know) on a mission to understand the problems with its perception throughout the community, and try to make more knowledge readily available to avoid confusion. I put together the <a href="http://www.php-fig.org/faq/">PHP-FIG FAQ</a> and the rest of the group voted it in, which I believe helped a lot. Sadly <a href="http://r.je/php-psr-0-pretty-shortsighted-really.html">some blog posts</a> are sent out by people with a whole bunch of odd opinions that you just can't do anything about, so instead I'm going to respond with a play-by-play approach.
</blockquote>
<p>
He goes through several of the points <i>Tom</i> made in his original post, pointing out places where the information was either misconceptions or just completely incorrect. He relates some of the autoloading suggestions <i>Tom</i> made back to things Composer can do and how this is different from "magic" on the part of the library user. 
</p>
<blockquote>
PSR-0 has its problems, but they are the two that I have pointed out and they are rather trivial. [...] If you'd like to add custom autoloaders to your Composer packages then go ahead. If you'd like to build your own custom autoloaders for all of your packages then you can do that too, but it ruins the entire purpose of what PSR-0 is meant to do. That's fine, because you don't need to use it, but I am happy as hell that PSR-0 exists and I wouldn't make drastic changes to it for anything. 
</blockquote>
Link: http://philsturgeon.co.uk/blog/2013/04/is-psr0-shortsighted-or-are-you]]></description>
      <pubDate>Wed, 17 Apr 2013 09:14:42 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Tom Butler: PHP: PSR-0: Pretty Shortsighted, Really]]></title>
      <guid>http://www.phpdeveloper.org/news/19469</guid>
      <link>http://www.phpdeveloper.org/news/19469</link>
      <description><![CDATA[<p>
In a new post to his site <i>Tom Butler</i> gives some reasoning as to why he <a href="http://r.je/php-psr-0-pretty-shortsighted-really.html">thinks PSR-0 is shortsighted</a> and some examples of a possible better alternative.
</p>
<blockquote>
A little background for those unaware of what PSR-0 is: There's a self-declared PHP "standards" group called PHP-FIG attempting to push several "standards" throughout the PHP community. [...] I have little interest in debating the politics behind pushing standards or whether small groups of developers trying to make decisions that affect the entire community is good or not, but I do object to the PSR-0 standard itself. My issues are purely practical, PSR-0 reduces flexibility and makes life more difficult for developers
</blockquote>
<p>
While he likes the idea of a standard way to be able to include third-party libraries that can be reused in multiple systems, he suggests that it answers the wrong question. In his view, it should be up to the library/tool developers to ensure the structure of their code to work with a standard, not the other way around. He points out that a "standard" is something that should apply to all situations and some of the workarounds that are needed for PSR-0 negate this idea.
</p>
<p>
In his alternative method, he suggests an "Autloadable" interface that can be implemented by the library/tool that includes a "load" method to handle the actual class loading. Then this autoloader would be registered via a json configuration file for the package. This allows the developer to control the loading and place any exceptions they might need into their own logic instead of trying to work around possible issues with the PSR-0 loading scheme.
</p>
<blockquote>
PSR-0 is a bad solution to a good problem. If you take anything from reading this post, remember this: If the standard defined how autoloaders could be extended, rather than how autoloaders worked, then each library or vendor could provide its own extension to the autoloader and everyone would be happy.
</blockquote>
Link: http://r.je/php-psr-0-pretty-shortsighted-really.html]]></description>
      <pubDate>Tue, 16 Apr 2013 13:12:14 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[NetTuts.com: PSR-Duh!]]></title>
      <guid>http://www.phpdeveloper.org/news/19452</guid>
      <link>http://www.phpdeveloper.org/news/19452</link>
      <description><![CDATA[<p>
On NetTuts.com today there's a post that <a href="http://net.tutsplus.com/tutorials/tools-and-tips/psr-duh/">talks about applying the PSR formatting</a> to your application's code. If you haven't already read their <a href="http://net.tutsplus.com/tutorials/php/psr-huh">introduction to the PSRs</a>, it's highly suggested.
</p>
<blockquote>
In a previous lesson here on Nettuts+, you learn about <a href="http://net.tutsplus.com/tutorials/php/psr-huh">PSR</a>; however, that article didn't detail the process of integrating that coding style into your projects. Let's fix that!
</blockquote>
<p>
They briefly recap the main two PSRs (PSR-1 and PSR-2, but no mention of PSR-3 the logging interface) and show code examples of them being applied. They also point to the <a href="http://pear.php.net/package/PHP_CodeSniffer">PHP_CodeSniffer</a> tool that you can use to keep your code in the correct structure. Instructions are included to install it specifically for the Sublime Text 2 editor via <a href="http://wbond.net/sublime_packages/package_control">package control</a>. It's just a command-line tool, though, so it could be integrated with just about any other editor/IDE out there too.
</p>
Link: http://net.tutsplus.com/tutorials/tools-and-tips/psr-duh]]></description>
      <pubDate>Fri, 12 Apr 2013 10:46:26 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Patrick Allaert: Composer: speeding up class autoloading]]></title>
      <guid>http://www.phpdeveloper.org/news/19099</guid>
      <link>http://www.phpdeveloper.org/news/19099</link>
      <description><![CDATA[<p>
In <a href="http://patrickallaert.blogspot.com/2013/01/speeding-up-class-autoloading-with.html">this new post</a> <i>Patrick Allaert</i> offers a solution that can help speed up the inclusion of files via the <a href="http://getcomposer.org">Composer</a> autoloader (in addition to the already present "optimize-autoloader" option).
</p>
<blockquote>
The problem with the classmap strategy and the nature of PHP is that there is no (easy) way to have a persistent variable across requests containing the classmap. [...] This [large returned array of mappings] can even take a big portion of your request's response time when you have hundreds or thousands of classes like it is the case with <a href="http://share.ez.no/">eZ Publish 5</a> being based on <a href="http://symfony.com/">Symfony</a>, where about 2 600 classes are involved.
</blockquote>
<p>
He suggests something that could be included into the Composer functionality itself - creating symbolic links in the PSR-0 standard to the location of the files to make it easier for Composer to resolve their location (based on namespace, not having to find them). Some sample code is included showing an additional autoloader that then uses the vendor names to match the path directly.
</p>]]></description>
      <pubDate>Mon, 28 Jan 2013 12:22:43 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Jeune Asuncion: ZF1.11 + Doctrine 2 + Symfony DI Integration]]></title>
      <guid>http://www.phpdeveloper.org/news/18391</guid>
      <link>http://www.phpdeveloper.org/news/18391</link>
      <description><![CDATA[<p>
In <a href="http://jeunito.me/zf1-11-doctrine-2-symfony-di-integration/">this new post</a> to his site <i>Jeune Asuncion</i> shows how he integrated several technologies to make for a robust system - Zend Framework (1.11), Doctrine 2 and the Symfony dependency injection system.
</p>
<blockquote>
Last week, <a href="http://jeunito.me/choosing-a-new-framework/">I blogged about looking for a new application framework</a> to use and more importantly the key things that I would want in one. After reading about the <a href="http://framework.zend.com/">Zend framework</a>, <a href="http://jeunito.me/zf1-11-doctrine-2-symfony-di-integration/www.symfony-project.org/">Symfony</a> and <a href="http://jeunito.me/zf1-11-doctrine-2-symfony-di-integration/laravel.com/">Laravel</a> and finding myself hesitant to use any one, I thought to myself why not get the best of each framework? So that's what I did.
</blockquote>
<p>
He shows a bit of the code to get them to all play nicely together using the Zend autoloader to register the other namespaces and creating a Symfony DI container inside of the ZF Bootstrap and providing it as a resource. You can find more of the source involved in the integration <a href="https://github.com/jeunito/zf-doctrine2-symfonydi">on his github account</a>.
</p>]]></description>
      <pubDate>Wed, 22 Aug 2012 11:09:21 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Anthony Ferrara: Is Autoloading A Good Solution?]]></title>
      <guid>http://www.phpdeveloper.org/news/18255</guid>
      <link>http://www.phpdeveloper.org/news/18255</link>
      <description><![CDATA[<p>
In his <a href="http://blog.ircmaxell.com/2012/07/is-autoloading-good-solution.html">most recent post</a> <i>Anthony Ferrara</i> takes a look at autoloading - mostly asking the question of whether the problems it has really outweigh the benefits.
</p>
<blockquote>
The real problem that autoloaders solve is to load dependencies. [...] The normal logic that's used to justify autoloading over manual dependency loading in production is that it only loads the classes you need. Therefore you save the parsing costs of classes that you don't need. But surely that additional run-time loading has costs. So I decided to setup a test to see how expensive that additional run-time loading costs us, and to prove whether or not autoloading is worth it in production.
</blockquote>
<p>
He gives an example of the two methods - using the <a href="http://php.net/spl_autoload_register"> spl_autoload_register</a> method to define a loader and loading them with a defined file path instead. He found the autoloading version slower than the hard-coded (by quite a bit) but how, when the number of files is reduced, the performance gets much closer. He also briefly looks at two other pieces of file-related functionality: <a href="http://php.net/file_exists">file_exists</a> and <a href="http://php.net/require_once">require_once</a>.
</p>]]></description>
      <pubDate>Fri, 20 Jul 2012 15:56:30 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: 5 Inspiring (and Useful) PHP Snippets]]></title>
      <guid>http://www.phpdeveloper.org/news/18162</guid>
      <link>http://www.phpdeveloper.org/news/18162</link>
      <description><![CDATA[<p>
On PHPMaster.com there's a new tutorial that <a href="http://phpmaster.com/5-inspiring-and-useful-php-snippets/">shares some useful PHP snippets</a> that you could use in your development.
</p>
<blockquote>
"X PHP Snippets" type articles abound on the Internet, so why write another one? Well, let's face it… the PHP snippets in them are generally lame. Snippets that generating a random string or return $_SERVER["REMOTE_ADDR"] for the IP Address of a client really aren't that interesting and are of modest usefulness. Instead, here's five snippets that you'll no doubt find interesting and useful, presented along with the problems that inspired them. I hope the creativity in many of them inspire you to write better and more creative code in your own day-to-day endeavors.
</blockquote>
<p>Their "five tips" are about:</p>
<ul>
<li>Generating CSV files from an array of data
<li>Autoloading classes (in a PSR-0 way)
<li>Parsing data with the <a href="http://php.net/unpack">unpack</a> function
<li>Templating in HTML (creating a "View" object)
<li>Using file_get_contents as a cURL Alternative
</ul>]]></description>
      <pubDate>Mon, 02 Jul 2012 10:58:45 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Charles Spraggs' Blog: How does configuration work in ZF2?]]></title>
      <guid>http://www.phpdeveloper.org/news/18108</guid>
      <link>http://www.phpdeveloper.org/news/18108</link>
      <description><![CDATA[<p>
In <a href="http://www.spiffyjr.me/2012/06/17/how-does-configuration-work-in-zf2/">this new post</a> to his blog <i>Charles Spraggs</i> takes a look at the Zend Framework 2 and talks about how to handle the configuration of the application and of your modules.
</p>
<blockquote>
As ZF2 increases the beta count and draws nearer to RC I've noticed more questions popping up in IRC regarding configuration. Questions like: "How do I setup XXX?", "Where do I add module options?" So, I decided to write up a quick blog explaining how configuration works in ZF2. By default, there are three types of configurations.
</blockquote>
<p>
He points out each of the three places and mentions what goes in each (main config, module config and autoload config) and gives a high-level overview of the load order for the modules in your application - merging the configurations then using a "glob" to figure out the correct config settings to use.
</p>]]></description>
      <pubDate>Mon, 18 Jun 2012 12:01:57 -0500</pubDate>
    </item>
    <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>
