<?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 20:06:45 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Chris Hartjes' Blog: How Not to Suck at PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17511</guid>
      <link>http://www.phpdeveloper.org/news/17511</link>
      <description><![CDATA[<p>
In <a href="http://www.littlehart.net/atthekeyboard/2012/02/03/how-not-to-suck-at-php/">this recent post</a> to his blog, <i>Chris Hartjes</i> answers his request for a "rant topic" by responding to a question about "how to not suck at PHP" (from <i>Travis Northcutt</i>).
</p>
<blockquote>
I thought about this question for a while and have some thoughts on what it really means to know how to not suck at building things using PHP. In my never even remotely humble opinion I think the key is to understand what PHP is really good at.
</blockquote>
<p>
He talks about how PHP had the early-adoption advantage at first with Apache, but how things have changed so much since then. Now, he proposes, PHP's popularity and usefulness is based on what it can do as a language without messing with frameworks at all. He's worried that, once someone picks up a framework, it'll become so ingrained that they won't know what "plain old PHP" can do (or how to work with it).
</p>
<blockquote>
So my advice to Travis is that he should worry about learning to use PHP like glue and correctly identify the problems he is trying to solve NOW instead of worrying about the problems he might have to solve later. There will be time to fix your problems. Some of those will be solved by using tools that are not written in PHP, but PHP can still glue them together.
</blockquote>]]></description>
      <pubDate>Tue, 07 Feb 2012 12:48:47 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Under the Hood of Yii's Component Architecture, Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/17510</guid>
      <link>http://www.phpdeveloper.org/news/17510</link>
      <description><![CDATA[<p>
Following up on their <a href="http://phpdeveloper.org/news/17472">previous look</a> at the component architecture of the Yii framework, PHPMaster has posted <a href="http://phpmaster.com/yii-under-the-hood-2">this new tutorial</a> showing how the framework allows you to do some event-based programming.
</p>
<blockquote>
An application event is something that occurs which might be of interest to other bits of code. A standard event in most GUI applications would be a "click" event, but the sky's the limit and what events you define is really up to you. [...] The details can be provided by application-specific modules allowing you to keep individual requirements separate from your reusable code. Events allow you to attach a potentially unlimited amount of functionality without changing your core modules and components.
</blockquote>
<p>
In his example, he shows how to create an event handler that is triggered when the user registers on the site. This event (CEvent) is then registered with the system and is attached via a call in the controller's "init" method.
</p>]]></description>
      <pubDate>Tue, 07 Feb 2012 11:53:57 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Leaseweb Labs Blog: POC: Flexible PHP Output Caching]]></title>
      <guid>http://www.phpdeveloper.org/news/17489</guid>
      <link>http://www.phpdeveloper.org/news/17489</link>
      <description><![CDATA[<p>
On the Leaseweb Labs blog there's <a href="http://www.leaseweblabs.com/2012/01/poc-flexible-php-output-caching/">a recent post</a> looking at using the <a href="http://github.com/tothimre/POC">POC framework</a> to work with flexible output caching. The tool makes it easy to create a new object and push cache content into it, automatically caching the data to sources like the file system, a Redis instance or a MongoDB database.
</p>
<blockquote>
Last year at the Symfony conference in Paris I have heard a really good quote: "There are only two hard things in Computer Science: cache invalidation and naming things" - Phil Karlton. I agree with it and it gave me a boost to keep evolving the concept.
</blockquote>
<p>
He includes an introduction to the caching features of <a href="http://github.com/tothimre/POC">the framework</a> complete with sample code showing first how to cache to the default file system and a more complex example that uses unique caches and page blacklists. Other features planned for the caching tool include edge-side includes, using Twig for templating and statistics recorded to a database.
</p>]]></description>
      <pubDate>Thu, 02 Feb 2012 12:10:21 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Under the Hood of Yii's Component Architecture, Part 1]]></title>
      <guid>http://www.phpdeveloper.org/news/17472</guid>
      <link>http://www.phpdeveloper.org/news/17472</link>
      <description><![CDATA[<p>
On PHPMaster.com today <i>Steven O'Brien</i> takes a look at a popular PHP-based framework, <a href="http://www.yiiframework.com/">Yii</a> - specifically one of the components that makes it up, the <a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a> that provides a base for all other components in the framework.
</p>
<blockquote>
There's been a lot of buzz surrounding the use of frameworks for quite a while now and there are many great PHP frameworks to choose from. I was blown away by the simplicity and power of the base <a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a> class in the Yii framework. [...] Every class in the framework extends from the CComponent class, which means that all subclasses work as components and can raise and handle events as well as be reusable and configurable. This packs a lot of punch for such a little class!
</blockquote>
<p>
In this first post of the series, he looks at how this base class lets you work with class properties using the magic getters and setters. He includes some code showing how to set them up and how to use it to configure your object by passing in other component and their configuration.
</p>]]></description>
      <pubDate>Tue, 31 Jan 2012 11:19:47 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Pagination with CodeIgniter]]></title>
      <guid>http://www.phpdeveloper.org/news/17465</guid>
      <link>http://www.phpdeveloper.org/news/17465</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial showing you how to <a href="http://phpmaster.com/pagination-with-codeigniter/">handle simple pagination</a> in a popular PHP framework, <a href="http://codeigniter.com">CodeIgniter</a>.
</p>
<blockquote>
Pagination is particularly useful when you are coding an application that interfaces with a database. A large dataset might have hundreds of possible results for one query, and pagination creates a much nicer user experience. In this tutorial, I'll use CodeIgniter's pagination library to show you how you can create a paginated list of results from a MySQL database. Along the way, you'll also see how to fix a problem with the pagination links that the library might produce.
</blockquote>
<p>
He starts on the backend,  creating a model to work with Country information and includes a "fetch_countries" method to grab the limited/paged list. Next up is the controller with an "example1" method that looks to the URL to see what page it should be on. The view is simple enough - just outputting the results back without worrying about how many to show.
</p>]]></description>
      <pubDate>Mon, 30 Jan 2012 12:15:22 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Project: Patchwork-UTF8 - UTF8 Support for PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17458</guid>
      <link>http://www.phpdeveloper.org/news/17458</link>
      <description><![CDATA[<p>
<i>Nicolas Grekas</i> has shared another tool that he's pulled out of his "Patchwork" framework to make it a stand-alone tool: the <a href="https://github.com/nicolas-grekas/Patchwork-UTF8">Patchwork-UTF8 helper</a> that provides matching functions to those PHP already has for regular strings, but a little smarter to work with UTF8 correctly.
</p>
<blockquote>
The PatchworkUtf8 class implements the quasi complete set of string functions that need UTF-8 grapheme clusters awareness. These functions are all static methods of the PatchworkUtf8 class. The best way to use them is to add a use PatchworkUtf8 as u; at the beginning of your files, then when UTF-8 awareness is required, prefix by u:: when calling them.
</blockquote>
<p>
In <a href="https://github.com/nicolas-grekas/Patchwork-UTF8/blob/master/README.md">the README</a> for the tool he talks about the functions included in the current release that match PHP's string functions as well as some additional methods like "isUtf8", "bestFit" and "strtocasefold". It relies on the mbstring, iconv and intl extensions being installed, and if they aren't, it falls back to other functionality (list of those methods included).
</p>]]></description>
      <pubDate>Fri, 27 Jan 2012 11:38:40 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Wojciech Sznapka's Blog: Always use most latest versions for benchmarks]]></title>
      <guid>http://www.phpdeveloper.org/news/17452</guid>
      <link>http://www.phpdeveloper.org/news/17452</link>
      <description><![CDATA[<p>
In response to some criticism about his <a href="http://phpdeveloper.org/news/17420">previous post</a> with some framework benchmarks, <i>Wojciech Sznapka</i> has <a href="http://blog.sznapka.pl/always-use-most-latest-versions-for-benchmarks/">posted updated results</a> using the latest versions of each framework.
</p>
<blockquote>
In my previous post Modern framework comparison I presented performance tests, which compared Ruby On Rails, Django and Symfony2. After recieving a feedback in comments I decided to run this benchmark one more time on my own laptop (instead of on my hosting). The reason was simple: enviroment was outdated.
</blockquote>
<p>
There were some overall performance increases were seen, but some statistics were higher - the "time per request" for all of them grew, some by quite a bit. He presents these benchmarks with a caveat, though:
</p>
<blockquote>
You should never choose framework based on benchmarks. Those shows them from one point of view, but there are plenty of other aspects, such as support, community, maturity, number of ready to use components.
</blockquote>]]></description>
      <pubDate>Thu, 26 Jan 2012 10:13:35 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 12)]]></title>
      <guid>http://www.phpdeveloper.org/news/17445</guid>
      <link>http://www.phpdeveloper.org/news/17445</link>
      <description><![CDATA[<p>
In <a href="http://fabien.potencier.org/article/62/create-your-own-framework-on-top-of-the-symfony2-components-part-12">this final post</a> of his series about building a framework on Symfony2 components, <i>Fabien Potencier</i> focuses again on flexibility - allowing you to have more than one front controller with different configurations thanks to dependency injections.
</p>
<blockquote>
Does it means that we have to make a choice between flexibility, customization, ease of testing and not having to copy and paste the same code into each application front controller? As you might expect, there is a solution. We can solve all these issues and some more by using the Symfony2 dependency injection container.
</blockquote>
<p>
The Symfony2 DIC (DependencyInjection) allows you to create a container with the objects and settings that you want and inject that into the main "Framework" class for its use. He registers most of the components he's added over the series like the UrlMatcher, RouterListener, ExceptionListener, EventDispatcher and the Framework class itself. This is all stored in a separate file(s) and can be conditionally included based on your environment. He shows how to register a custom listener, add parameters to the DIC configuration.
</p>]]></description>
      <pubDate>Wed, 25 Jan 2012 08:36:48 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 11)]]></title>
      <guid>http://www.phpdeveloper.org/news/17440</guid>
      <link>http://www.phpdeveloper.org/news/17440</link>
      <description><![CDATA[<p>
In <a href="http://fabien.potencier.org/article/60/create-your-own-framework-on-top-of-the-symfony2-components-part-11">part eleven</a> of his "Build a Framework on top of Symfony2", <i>Fabien Potencier</i> improves on his earlier versions of the code by adding in the HttpKernel support for handling events and errors that might come up in the application.
</p>
<blockquote>
If you were to use our framework right now, you would probably have to add support for custom error messages. Right now, we have 404 and 500 error support but the responses are hardcoded in the framework itself. Making them customizable is easy enough though: dispatch a new event and listen to it. Doing it right means that the listener has to call a regular controller. But what if the error controller throws an exception? You will end up in an infinite loop. There should be an easier way, right?
</blockquote>
<p>
Using the "RouterListener" functionality, he sets up an "ExceptionListener" and points that to an error handling controller with its own "exceptionAction". This action takes the exception information and displays a "Something went wrong!" message along with the details. He also includes an update to the Response handling to allow for returning a string back from the controller instead of a Response object.
</p>]]></description>
      <pubDate>Tue, 24 Jan 2012 11:04:44 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Michael Nitschinger's Blog: Playing with Composer and Lithium]]></title>
      <guid>http://www.phpdeveloper.org/news/17439</guid>
      <link>http://www.phpdeveloper.org/news/17439</link>
      <description><![CDATA[<p>
<i>Michael Nitschinger</i> has a new post to his blog looking at using the popular <a href="http://packagist.org/about-composer">Composer</a> tool for package management <a href="http://nitschinger.at/Playing-with-Composer-and-Lithium">together with Lithium</a> to make dependency management simpler.
</p>
<blockquote>
<a href="http://packagist.org/about-composer">Composer</a> is a command-line tool that helps you manage your application dependencies. It automatically fetches packages, resolves dependencies and is easy to configure. [...] Currently, Lithium doesn't provide Composer packages out of the box, but it's easy to write one.
</blockquote>
<p>
He starts the post with an introduction to using Composer for those new to the tool, then moves quickly into setting up your "composer.json" file to pull in the Lithium updates from their github account. Additionally, he shows how to add a dependency for <a href="http://twig.sensiolabs.org/">twig</a> in the "require" section and pull it down at the same time (with dependencies).
</p>]]></description>
      <pubDate>Tue, 24 Jan 2012 10:20:51 -0600</pubDate>
    </item>
  </channel>
</rss>

