<?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>Sun, 12 Feb 2012 19:52:31 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 7)]]></title>
      <guid>http://www.phpdeveloper.org/news/17396</guid>
      <link>http://www.phpdeveloper.org/news/17396</link>
      <description><![CDATA[<p>
<i>Fabien Potencier</i> has posted the <a href="http://fabien.potencier.org/article/56/create-your-own-framework-on-top-of-the-symfony2-components-part-7">seventh part</a> of his series looking at how to make a custom framework on top of the components from the <a href="http://symfony.com">Symfony2</a> framework. In this part of the series he improves his basic framework by adding some namespacing to organize the application a bit more.
</p>
<blockquote>
If you have a closer look at the code, front.php has one input, the Request, and one output, the Response. Our framework class will follow this simple principle: the logic is about creating the Response associated with a Request. As the Symfony2 components requires PHP 5.3, let's create our very own namespace for our framework: Simplex.
</blockquote>
<p>
He puts the main front controller in just the "Simplex" namespace but adds in others for the controllers and models. He also updates his Composer configuration to create some PSR-0 autoloading.
</p>]]></description>
      <pubDate>Mon, 16 Jan 2012 08:46:22 -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>
    <item>
      <title><![CDATA[ZendCasts.com: PHAR Out Autoloading]]></title>
      <guid>http://www.phpdeveloper.org/news/16982</guid>
      <link>http://www.phpdeveloper.org/news/16982</link>
      <description><![CDATA[<p>
On the ZendCasts.com site there's a new screencast posted looking at <a href="http://www.zendcasts.com/phar-out-autoloading-hd/2011/10/">autoloading in phar</a>, the <a href="http://php.net/phar">packaging tool</a> built into PHP.  This is a continuation of the series started <a href="http://www.zendcasts.com/fun-with-phar/2011/10/">here</a>.
</p>
<p>
Building on the foundation from the <a href="http://www.zendcasts.com/fun-with-phar/2011/10/">previous screencast</a>, he shows how to enhance it and allow it to autoload based on an autoloader defined in a "stub.php" file.
</p>
<p>
You can grab the complete source for this screencast <a href="https://gist.github.com/1276774">over on github</a>.
</p>]]></description>
      <pubDate>Wed, 12 Oct 2011 09:13:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[rooJSolutions Blog: Watch-out PHP 5.3.7+ is about.. and the is_a() / __autoload() mess.]]></title>
      <guid>http://www.phpdeveloper.org/news/16810</guid>
      <link>http://www.phpdeveloper.org/news/16810</link>
      <description><![CDATA[<p>
New from the rooJSolutions blog there's a post pointing out an issue that PHP 5.3.7 has broken the <a href="http://php.net/is_a">is_a</a> functionality in a lot of cases. <a href="http://roojs.com/index.php/View/242/.html">The post</a> talks some about what's broken and how you can work around it if you're effected.
</p>
<blockquote>
The key issue was that 5.3.7 accidentally broke is_a() for a reasonably large number of users. Unfortunately the fixup release 5.3.8 did not address this 'mistake', and after a rather fruitless exchange I gave up trying to persuade the group (most people on mailing list), that reverting the change was rather critical (at least pierre supported reverting it in the 5.3.* series).
</blockquote>
<p>
This new issue was causing some strange errors to pop up in his code because of a parameter type change in the <a href="http://php.net/is_a">is_a</a> call, updating the first parameter to be an object instead of a class name. The is_a() call sends its requests to __autoload in some cases and the string->object mismatch of those parameters causes errors to be thrown. His workaround is, in your checking, just be sure to call an <a href="http://php.net/is_object">is_object</a> first before passing things off to be is_a() checked and autoloaded.
</p>]]></description>
      <pubDate>Fri, 02 Sep 2011 10:43:24 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Elated.com: Object-Oriented PHP: Autoloading, Serializing, and Querying Objects]]></title>
      <guid>http://www.phpdeveloper.org/news/16542</guid>
      <link>http://www.phpdeveloper.org/news/16542</link>
      <description><![CDATA[<p>
On Elated.com today there's the <a href="http://www.elated.com/articles/object-oriented-php-autoloading-serializing-and-querying-objects/">fourth part of their series</a> looking at object oriented programming in PHP. This time the focus is specifically on autoloading classes, making objects into strings (serialized) and introspection.
</p>
<blockquote>
If you've read all the articles up to this point then you're already familiar with the most important concepts of object-oriented programming in PHP: classes, objects, properties, methods, and inheritance. In this final (for now, at least!) tutorial in the series, I'm going to tie up some loose ends and look at some other useful OOP-related features of PHP.
</blockquote>
<p>
He looks at each of the three topics above and includes code for things like a simple autoloader, object serialization, using sleep/wakeup and an example of using functions like <a href="http://php.net/get_class">get_class</a>, <a href="http://php.net/get_class_methods">get_class_methods</a> and <a href="http://php.net/get_object_vars">get_object_vars</a> to do introspection on your classes and objects.
</p>]]></description>
      <pubDate>Fri, 01 Jul 2011 08:29:45 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[php|architect: Image Processing with Imagine]]></title>
      <guid>http://www.phpdeveloper.org/news/16005</guid>
      <link>http://www.phpdeveloper.org/news/16005</link>
      <description><![CDATA[<p>
New from the php|architect blog, there's a tutorial from <i>Mike Willbanks</i> about <a href="http://www.phparch.com/2011/03/image-processing-with-imagine/">using Imagine</a> to transform images dynamically in a more object-oriented way.
</p>
<blockquote>
Image processing in PHP is a necessary evil but is needed more often than not in just about every web application.   With the various preferences in image processing libraries (think ImageMagick, GraphicsMagick and GD) it is difficult to find a library that provides a unified object oriented interface as well as implementing the general tasks in a simplistic fashion. <a href="https://github.com/avalanche123/Imagine/">Imagine</a> is an open source image manipulation library built with PHP 5.3 that implements an object oriented interface to ImageMagick, GraphicsMagick and GD
</blockquote>
<p>
<i>Mike</i> gives a quick sample script that uses SPL autoloading to pull in the classes as they're needed (with the "imagineLoader" method) and make a basic thumbnail from a PNG file.
</p>]]></description>
      <pubDate>Mon, 07 Mar 2011 10:53:42 -0600</pubDate>
    </item>
    <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>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney's Blog: Autoloading Benchmarks]]></title>
      <guid>http://www.phpdeveloper.org/news/14980</guid>
      <link>http://www.phpdeveloper.org/news/14980</link>
      <description><![CDATA[<p>
<i>Matthew Weier O'Phinney</i> has <a href="http://weierophinney.net/matthew/archives/245-Autoloading-Benchmarks.html">a new post</a> to his blog (following <a href="http://weierophinney.net/matthew/archives/244-Applying-FilterIterator-to-Directory-Iteration.html">this post</a> on directory iteration for autoloading) with some of the benchmarks of different methods he tried for automatically loading the libraries his scripts needed on demand.
</p>
<blockquote>
During the past week, I've been looking at different strategies for <a href="http://php.net/autoload">autoloading</a> in <a href="http://framework.zend.com/">Zend Framework</a>. I'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. In this post, I'll outline the approaches I've tried, the benchmarking strategy I applied, and the results of benchmarking each approach.
</blockquote>
<p>
His testing included a baseline of the Zend Framework 1.x series loading, a naming/class standard following the PEAR standards and class mapping with file/class name pairs. He includes his benchmarking strategy and the scripts he used to run the tests (on <a href="http://github.com/weierophinney/zf2/blob/autoloading/bin/createAutoloadTestClasses.php">github here</a>). He ran them both with and without opcode caching to give a better overall performance view.
</p>]]></description>
      <pubDate>Wed, 18 Aug 2010 10:14:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Robert Basic's Blog: Loading custom module plugins]]></title>
      <guid>http://www.phpdeveloper.org/news/14822</guid>
      <link>http://www.phpdeveloper.org/news/14822</link>
      <description><![CDATA[<p>
<i>Robert Basic</i> has a <a href="http://robertbasic.com/blog/loading-custom-module-plugins/">quick new post</a> to his blog today showing how to load custom module plugins in your Zend Framework application.
</p>
<blockquote>
I was trying to load a Front Controller plugin which resides in app/modules/my_module/controllers/plugins/  and not in the 'usual' lib/My_App/Plugin/. I want this plugin to be called in every request and I want the plugin file to be under it's 'parent' module.
</blockquote>
<p>
To solve the problem he added a path to the Zend_Application_Module_Autoloader as a resource and registered it in the front controller. He includes some code to show how it works - a simple bootstrap with two _init functions, one for the news autoloading and another for plugins.
</p>]]></description>
      <pubDate>Tue, 20 Jul 2010 14:04:43 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Court Ewing's Blog: Zend Framework Modules: Autoloading & Namespaces]]></title>
      <guid>http://www.phpdeveloper.org/news/14754</guid>
      <link>http://www.phpdeveloper.org/news/14754</link>
      <description><![CDATA[<p>
<i>Court Ewing</i> has written up a new post about <a href="http://epixa.com/2010/07/zend-framework-modules-autoloading-namespaces">using Zend Framework modules</a> and things you need to worry about with considering autoloading and namespacing them correctly.
</p>
<blockquote>
Modules are natively supported in Zend Framework, but their implementation is not conducive to flexible autoloading nor the use of namespaces in PHP 5.3. There may be a few contributors out there that will defend the current implementation of module autoloading, but throughout the development lifecycle of the current Model-View-Controller implementation in the framework, poor design decisions have made working with modules less flexible and more frustrating.
</blockquote>
<p>
Because of these poor decisions there are a few problems that you'll need to overcome when using modules, specifically in dealing with naming conventions currently in place in the framework and how that can make autoloading more difficult. He has <a href="http://github.com/epixa/Epixa">a concept</a> he's worked up to try to help the situation - Epixa, a system for fully namespacing out modules so a simple directory structure correctly reflects the namespacing.
</p>]]></description>
      <pubDate>Wed, 07 Jul 2010 08:39:53 -0500</pubDate>
    </item>
  </channel>
</rss>

