<?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, 18 Jun 2013 19:30:25 -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[Chris Hartjes: Standards, Soapboxes, and Shamans]]></title>
      <guid>http://www.phpdeveloper.org/news/19070</guid>
      <link>http://www.phpdeveloper.org/news/19070</link>
      <description><![CDATA[<p>
In <a href="http://www.littlehart.net/atthekeyboard/2013/01/20/standards-soapboxes-and-shamans/">this latest post</a> to his site <i>Chris Hartjes</i> shares some of his thoughts about the recently approved <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md">PSR-3</a> standard (for logging) and some of the reception that the other PSRs (PSR-0, 1 & 2) have gotten from the PHP community.
</p>
<blockquote>
For those who pay attention to the workings of the PHP community you might have heard about the "PHP Standards Recommendations" that have been coming out of the PHP Framwork Interop Group. [...] More recently this group has been working on a standard for logging interfaces called <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md">PSR-3</a>. I spoke about this on Twitter, and I will repeat it here: I think PHP programmers should get behind PSR-0 and efforts like PSR-3. I feel that PSR-1 and PSR-2 are solutions looking for a problem and seem, to me anyway, to me out of place with the solutions offered by PSR-0 and PSR-3.
</blockquote>
<p>
He likens the PHP PSRs to the <a href="http://www.python.org/dev/peps/">Python enhancement proposals</a> (PEPs) and, more specifically, to the PEP-8 - their own version of "coding standards" that was highly championed by <i>Guido van Rossum</i> and put into wide practice. 
</p>
<blockquote>
Any programming language community that does not work as hard as possible to make it easier to integrate other's libraries of code together [by standardizing their formatting] is asking for irrelevancy.
</blockquote>]]></description>
      <pubDate>Mon, 21 Jan 2013 13:16:47 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Project: CodeSniffer for PSR's (PSR-0, PSR-1 & PSR-2)]]></title>
      <guid>http://www.phpdeveloper.org/news/18071</guid>
      <link>http://www.phpdeveloper.org/news/18071</link>
      <description><![CDATA[<p>
<i>Klaus Silveira</i> has created a set of PHP_CodeSniffer rules that can be used to <a href="https://github.com/klaussilveira/phpcs-psr">test your code for the recently approved PSR-1 & PSR-2 standards</a>.
</p>
<blockquote>
This is a PHP_CodeSniffer sniff to check against the PHP Standard Resolutions: <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md">PSR-0</a>, <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md">PSR-1</a> and <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md">PSR-2</a>. Those standards were approved by the <a href="https://github.com/php-fig/fig-standards">PHP Framework Interoperability Group</a>. You can read more about the PHP FIG and the PSR's on this <a href="http://paul-m-jones.com/archives/2420">excellent article</a> by Paul Jones.
</blockquote>
<p>
<a href="https://github.com/klaussilveira/phpcs-psr">The github repository</a> also provides an overview of the standards themselves and how to get these sniffs installed.
</p>]]></description>
      <pubDate>Sat, 09 Jun 2012 11:17:50 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: PSR-1 and PSR-2 to be Approved as Standards]]></title>
      <guid>http://www.phpdeveloper.org/news/17991</guid>
      <link>http://www.phpdeveloper.org/news/17991</link>
      <description><![CDATA[<p>
As is mentioned in <a href="http://phpmaster.com/psr-1-and-psr-2-to-be-approved-as-standards/">this new post</a> to PHPMaster.com, the PHP standards group is officially in the voting process on two new standards (<a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md">PSR-0</a> being the first) setting up some standard development practices for PHP applications - <a href="https://github.com/pmjones/fig-standards/blob/psr-1-style-guide/proposed/PSR-1-basic.md">PSR-1</a> and <a href="https://github.com/pmjones/fig-standards/blob/psr-1-style-guide/proposed/PSR-2-advanced.md">PSR-2</a>.
</p>
<blockquote>
They initially started out as one proposal but the initial round of voting didn't yield a majority in favor. Participants did however see merit in various requirements the decision was made to split it into 2 proposals - one for mandatory interoperability and one for suggested style.
</blockquote>
<p>
The <a href="https://github.com/pmjones/fig-standards/blob/psr-1-style-guide/proposed/PSR-1-basic.md">PSR-1</a> standard proposes some basic coding standards (like namespacing structure and class/method naming definitions) and the <a href="https://github.com/pmjones/fig-standards/blob/psr-1-style-guide/proposed/PSR-2-advanced.md">PSR-2</a> standard covers similar things, but more in-depth with more recommendations. 
</p>
<p>
If you want to find out how your application stacks up against this new standard, you can try out <a href="https://github.com/fabpot/PHP-CS-Fixer">PHP-CS-Fixer</a> (from <i>Fabien Potencier</i>) to see how many things need an update.
</p>]]></description>
      <pubDate>Tue, 22 May 2012 13:18:40 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Community News: Drafts of PSR-1 (and prelim PSR-2)]]></title>
      <guid>http://www.phpdeveloper.org/news/17949</guid>
      <link>http://www.phpdeveloper.org/news/17949</link>
      <description><![CDATA[<p>
In the wake of the success of the <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md">PSR-0 standard</a> (used in autoloading structures across frameworks and various applications), the PHP-FIG (Framework Interoperability Group) has start on drafts of other standards to help provide some guidelines to standardize PHP development across projects.
</p>
<p>
Among the group, <i>Paul Jones</i> has been <a href="https://github.com/pmjones/fig-standards/tree/psr-1-style-guide/proposed">writing serveral proposals</a> under the PSR-1 standard banner that include:
</p>
<ul>
<li>The <a href="https://github.com/pmjones/fig-standards/blob/psr-1-style-guide/proposed/PSR-1-basic.md">basic draft of the standard</a>
<li>An <a href="https://github.com/pmjones/fig-standards/blob/psr-1-style-guide/proposed/PSR-1.md">extended draft</a> of the same
<li>A <a href="https://github.com/pmjones/fig-standards/blob/psr-1-style-guide/proposed/PSR-2-advanced.md">more advanced version, PSR-2</a> that also includes some survey results on various syntax elements.
</ul>
<p>
If you want to know more about the PHP-FIG group, you should <a href="http://voicesoftheelephpant.com/2012/05/01/fig-fud-fomo/">listen to this excellent panel interview</a> of the group from the Voices of the ElePHPant podcast. <i>Paul</i> and others get into the point of the group and how the standards are progressing.
</p>]]></description>
      <pubDate>Fri, 11 May 2012 13:17:08 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Stefan Koopmanschap's Blog: Using custom namespaces with (C/S)ilex and Composer]]></title>
      <guid>http://www.phpdeveloper.org/news/17810</guid>
      <link>http://www.phpdeveloper.org/news/17810</link>
      <description><![CDATA[<p>
<i>Stefan Koopmanschap</i> has a quick new post to his blog with <a href="http://www.leftontheweb.com/message/Using_custom_namespaces_with_CSilex_and_Composer">a handy tip for Composer and Cilex/Silex users</a> when dealing with custom namespaces.
</p>
<blockquote>
For a new proof of concept application I'm building, I need both a simple web interface as well as some commandline tools. I decided to use Silex for the web interface and Cilex for the CLI tools, and opted for using Composer for installing these dependencies into my project. I ran into some issues with the custom project libraries I was building for this application however. Registering my custom namespace into Silex and Cilex didn't result in the classes being loaded for some reason. Composer helped me out though.
</blockquote>
<p>
His solution involves letting Composer be the default autoloader for the application via an "autoloader" configuration option in the "composer.json"  (that can also take a classmap option if you're not PSR-0 compliant, <a href="http://getcomposer.org/doc/04-schema.md#autoload">see here</a>).
</p>]]></description>
      <pubDate>Thu, 12 Apr 2012 12:22:47 -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>
    <item>
      <title><![CDATA[Anthony Ferrara's Blog: On PSR-0 Being Included In PHP's Core]]></title>
      <guid>http://www.phpdeveloper.org/news/17084</guid>
      <link>http://www.phpdeveloper.org/news/17084</link>
      <description><![CDATA[<p>
In a new post to his blog today <i>Anthony Ferrara</i> looks at the (heated) discussion that's popped up around having the PSR-0 autoloader standard included as a part of the PHP core. He <a href="http://blog.ircmaxell.com/2011/11/on-psr-0-being-included-in-phps-core.html">gives his reasons</a> (three of them) why he's not for the decision.
</p>
<blockquote>
Recently there has been a rather heated and intense discussion on whether the <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md">PSR-0 autoloader "standard"</a> should be included as part of the <a href="https://wiki.php.net/rfc/splclassloader">PHP core (in ext/spl to be exact)</a>. I've tried to stay out of the discussion and have successfully done so. Until today. I feel that there's something that's been missing to the discussion. So rather then posting this to the internals list, I feel it's better served by a blog post on the subject. So here's my take on it.
</blockquote>
<p>
As mentioned, he's not in favor of the inclusion for three different reasons:
</p>
<ul>
<li>It's inconsistent with current PHP functionality and would bias development one way or another
<li>It's not an actual standard, just a loosely defined practice based on functionality already in place
<li>There's noting for core to gain by adopting it and could cause problems trying to make things fit a one-size-fits-all solution.
</ul>]]></description>
      <pubDate>Fri, 04 Nov 2011 08:34:50 -0500</pubDate>
    </item>
  </channel>
</rss>
