<?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>Wed, 23 May 2012 19:09:10 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Evan Coury's Blog: Module-specific layouts in Zend Framework 2]]></title>
      <guid>http://www.phpdeveloper.org/news/17944</guid>
      <link>http://www.phpdeveloper.org/news/17944</link>
      <description><![CDATA[<p>
<i>Evan Coury</i> has a new Zend Framework 2 related blog post looking at how to use <a href="http://blog.evan.pro/module-specific-layouts-in-zend-framework-2">module specific layouts</a> in your application (even though, technically, it's more related to the controller).
</p>
<blockquote>
There's really no such thing as "module-specific" anything in ZF2, so what we're really talking about is the topmost namespace of the controller being dispatched. So in the case of MyModuleControllerSomeController, the topmost namespace would be MyModle. In most cases, this will be the name of a given module.
</blockquote>
<p>
He gives a quick piece of sample code showing a "Module" class that attaches an event on the dispatch of its request. Inside this event, he grabs the controller (target) and updates the layout via a call to the "layout" method. This is all handled in the "init" method of the module, so it should "just work" when the module is used.
</p>]]></description>
      <pubDate>Fri, 11 May 2012 08:07:44 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP-Security.net: Suhosin 0.9.34-DEV Installation HowTo]]></title>
      <guid>http://www.phpdeveloper.org/news/17903</guid>
      <link>http://www.phpdeveloper.org/news/17903</link>
      <description><![CDATA[<p>
On the PHP-Security.net blog today there's <a href="http://www.php-security.net/archives/8-Suhosin-0.9.34-dev-installation-howto.html">a new post</a> showing how to get the latest version of the <a href="http://www.hardened-php.net/suhosin/">Suhosin</a> security patch for PHP installed. 
</p>
<blockquote>
With the recently released PHP 5.4, the Suhosin patch and extension were removed from many Linux distribution packages (i.e., Debian et al.) and until three weeks ago, there was no possibility to compile and run the Suhosin extension under PHP 5.4. This little howto shall serve as installation instruction for Debian Wheezy users - your mileage may vary. I blogged about this here.
</blockquote>
<p>
They start with the apt-get commands to install the latest PHP5 for your distribution (yum commands are similar, of course) and includes the <a href="https://github.com/stefanesser/suhosin/tarball/master">location to download</a> the latest Suhosin version from <i>Stefan Esser</i>'s github account. Unpack it, compile and "phpize" it and if all goes well, you should have a shared module built and ready for use.
</p>]]></description>
      <pubDate>Thu, 03 May 2012 11:54:57 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Evan Coury's Blog: Sharing a database connection across modules in Zend Framework 2]]></title>
      <guid>http://www.phpdeveloper.org/news/17876</guid>
      <link>http://www.phpdeveloper.org/news/17876</link>
      <description><![CDATA[<p>
<i>Evan Coury</i> has a new post to his site about a handy method for <a href="http://blog.evan.pro/sharing-a-database-connection-across-modules-in-zend-framework-2">sharing database connections across modules</a> in a Zend Framework application.
</p>
<blockquote>
With the new modular infrastructure in Zend Framework 2, one of the most common questions will indoubitably be how to share a database connection across modules. Here's a quick explanation of how to share your database connection across multiple modules in a way that can even allow you to use a single connection between ZendDb, Doctrine2, and possibly even other database libraries / ORMs.
</blockquote>
<p>
He includes the code in the post to configure this application-wide database resource, a "masterdb_pdo" that uses a MySQL backend. This configuration is used to set up the connection in a dependency injection container for later (globalish) use. He also mentions something similar about sharing Doctrine connections with the ZendDb components (using the same DI container approach).
</p>]]></description>
      <pubDate>Fri, 27 Apr 2012 09:54:56 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney's Blog: Developing A ZF2 Blog]]></title>
      <guid>http://www.phpdeveloper.org/news/17773</guid>
      <link>http://www.phpdeveloper.org/news/17773</link>
      <description><![CDATA[<p>
<i>Matthew Weier O'Phinney</i> has a new post to his blog walking you through the creation of <a href="http://mwop.net/blog/2012-05-developing-a-zf2-blog.html">his own Zend Framework 2 blogging platform</a> that works with git branching and page generation to get the job done.
</p>
<blockquote>
Why write something of my own? Well, of course, there's the fact that I'm a developer, and have control issues. Then there's also the fact that a blog is both a simple enough domain to allow easily experimenting with new technology and paradigms, while simultaneously providing a complex enough domain to expose non-trivial issues.
</blockquote>
<p>
He realized that he wanted a platform that was not only something he wanted to maintain but that also allowed him to write how he wanted to write - no more in-browser editing, just working with text files and generated page output. He shares some of the thoughts behind the different parts of the blog software - the domain model, his <a href="http://git.mwop.net/?a=summary&p=PhlyBlog">PhlyBlog</a> module and the updated code he used to override some of the functionality in this default module. He also describes his new blogging process which includes git branching, creating a PHP "post" file, regernerate the blog via a command-line tool and merge and deploy.
</p>]]></description>
      <pubDate>Wed, 04 Apr 2012 08:22:58 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Johannes Schl&uuml;ter's Blog: Testing persistent connection and thread-safety features in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17712</guid>
      <link>http://www.phpdeveloper.org/news/17712</link>
      <description><![CDATA[<p>
In <a href="http://schlueters.de/blog/archives/166-Testing-persistent-connection-and-thread-safety-features-in-PHP.html">this recent post</a> to his blog <i>Johannes Schl&uuml;ter</i> he talks about a way that he's come up with to test functionality that uses persistent connections (and an module he created to help).
</p>
<blockquote>
In a few rare cases this is not what people like, for that PHP introduced "persistent connections" of different kinds. Testing those is a bit annoying as you have to configure a webserver and ensure to hit the same instance over the course of a test and then use a load generator, probably one which can detect a failure. Additionally by having a webserver in the game there is more code being executed, which might mean an additional source for trouble while debugging. An alternative might be using FastCGI, while that adds it's own issues for such a test. To solve this for myself I, some time ago, wrote a PHP SAPI module called <a href="https://github.com/johannes/pconn-sapi">pconn</a> and pushed it to github. 
</blockquote>
<p>
The extension provides a way to emulate requests by executing a script multiple times automatically, making it easier to test things that require checking against multiple things simultaneously. While the <a href="http://us2.php.net/manual/en/features.commandline.webserver.php">built-in webserver</a> (PHP 5.4) can be used to test some of these things too, <i>Johannes'</i> extension can also be compiled to help with testing of threading in applications as well.
</p>]]></description>
      <pubDate>Thu, 22 Mar 2012 09:51:58 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[ServerGrove Blog: Error "Cannot find module 'less'" with Symfony2, Assetic and Twitter Bootstrap]]></title>
      <guid>http://www.phpdeveloper.org/news/17692</guid>
      <link>http://www.phpdeveloper.org/news/17692</link>
      <description><![CDATA[<p>
On the ServerGrove blog, there's <a href="http://blog.servergrove.com/2012/03/16/error-cannot-find-module-less-with-symfony2-assetic-and-twitter-bootstrap/">a quick post</a> with a handy tip for the Symfony2 + Assetic users out there - how to get it to recognize the "less" module.
</p>
<blockquote>
Unfortunately the <a href="http://symfony.com/doc/current/cookbook/assetic/asset_management.html">Symfony documentation</a> does not provide any details on how to configure Assetic to use LESS. There is <a href="http://www.dobervich.com/2011/05/10/less-css-assetic-configuration-in-a-symfony2-project/">a blog post by Dustin Dobervich</a> that gives some pointers, but after following the instructions, Assetic issued the following error: Cannot find module 'less'. We searched around without much success. After several tries, we nailed the configuration.
</blockquote>
<p>
It's an easy two-step process: first you be sure you have "npm" (the package manager) installed on your system, then you modify your Symfony app.yml file to point to the Node modules path.
</p>]]></description>
      <pubDate>Mon, 19 Mar 2012 12:36:25 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen's Blog: Module specific bootstrapping in ZF2]]></title>
      <guid>http://www.phpdeveloper.org/news/17646</guid>
      <link>http://www.phpdeveloper.org/news/17646</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> has a new post to his blog today looking at <a href="http://akrabat.com/zend-framework-2/module-specific-bootstrapping-in-zf2/">bootstrapping specific modules</a> in a Zend Framework 2-based application without having to do the entire set.
</p>
<blockquote>
Following on from the <a href="http://akrabat.com/zend-framework-2/modules-in-zf2/">discussion on modules</a>, we can hook into the event system to do module specific bootstrapping. By this, I mean, if you have some code that you want to run only if the action to be called is within this module, you can hook into the Application's dispatch event to achieve this.
</blockquote>
<p>
He starts with an example of a basic module (Simple/Module.php) and shows how to define an "onBootstrap" method that calls the "onDispatch" method (when hooked to the event manager) to do some module-specific bootstrap operations. The RouteMatch feature is used to ensure that you're in the right controller/namespace combo to use the module.
</p>]]></description>
      <pubDate>Thu, 08 Mar 2012 10:04:20 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen's Blog: Modules in ZF2]]></title>
      <guid>http://www.phpdeveloper.org/news/17626</guid>
      <link>http://www.phpdeveloper.org/news/17626</link>
      <description><![CDATA[<p>
In <a href="http://akrabat.com/zend-framework-2/modules-in-zf2/">this new post</a> to his blog <i>Rob Allen</i> introduces one of the key concepts in the upcoming version of the Zend Framework (v2) - modules.
</p>
<blockquote>
A Zend Framework 2 application is made up of a number of modules which each contain the controllers, models, views and other support code required to implement a specific part of the application. 
</blockquote>
<p>He covers a few different topics:</p>
<ul>
<li>where modules can be located
<li>the directory organization inside them
<li>setting up a module of your own (a "bare bones" example)
<li>how to use the init() method to set configure your module when it's loaded
</ul>
<p>
A site has also been started (official) to share other user-created modules with the rest of the Zend Framework community - <a href="http://modules.zendframework.com/">modules.zendframework.com</a>.
</p>]]></description>
      <pubDate>Mon, 05 Mar 2012 12:08:39 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen's Blog: Overriding module configuration in ZF2]]></title>
      <guid>http://www.phpdeveloper.org/news/17576</guid>
      <link>http://www.phpdeveloper.org/news/17576</link>
      <description><![CDATA[<p>
In a quick new post to his blog, <i>Rob Allen</i> shows how you can <a href="http://akrabat.com/zend-framework-2/overriding-module-configuration-in-zf2/">override a module's configuration</a> in a Zend Framework 2 application. In his example, he uses the "User" module and overrides two of the "magic paths" it creates.
</p>
<blockquote>
Let's say that you install the ZF-Common's User module. By default, it sets up its routes under the /user path segment. [...] This config section will create the routes /user and through the magic of child_routes, also create /user/login and other required routes. If you don't want /user and would prefer /member, then it's easy enough to change. Just add a new config file to the project's config/autoload folder.
</blockquote>
<p>
Code for the configuration files is included with the update to the "ZendMvcRouterRouteStack" to change the ZF-Common User module's setup to point to "/member" instead of "/user" when routed. You can find out more about the module system in ZF2 <a href="http://packages.zendframework.com/docs/latest/manual/en/zend.module.html">in the latest version of the manual</a>.
</p>]]></description>
      <pubDate>Thu, 23 Feb 2012 09:11:01 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney's Blog: Getting started writing ZF2 modules]]></title>
      <guid>http://www.phpdeveloper.org/news/17100</guid>
      <link>http://www.phpdeveloper.org/news/17100</link>
      <description><![CDATA[<p>
<i>Matthew Weier O'Phinney</i> has <a href="http://weierophinney.net/matthew/archives/267-Getting-started-writing-ZF2-modules.html">posted a guide to modules in ZF2</a> - some helpful hints to get you started writing modules for the Zend Framework 2 to fit into the new architecture.
</p>
<blockquote>
During <a href="http://zendcon.com/">ZendCon</a> this year, we <a href="http://framework.zend.com/zf2/blog/entry/Zend-Framework-2-0-0beta1-Released">released 2.0.0beta1</a> of <a href="http://framework.zend.com/">Zend Framework</a>. The key story in the release is the creation of a new MVC layer, and to sweeten the story, the addition of a modular application architecture. "Modular? What's that mean?" For ZF2, "modular" means that your application is built of one or more "modules". In a lexicon agreed upon during our IRC meetings, a module is a collection of code and other files that solves a specific atomic problem of the application or website. 
</blockquote>
<p>
He starts with a definition of a module as a reusable, self-contained object that can contain the code for one functional piece of the application (like a "forum" module or "blog" module). He gets more technical with a code-level module example structure and example code for setting up a "blog" module with autoloading and a little ACL. He includes the code you'll need to tell the module manager about the module and a few helpful tips/tricks he's found along the way.
</p>]]></description>
      <pubDate>Tue, 08 Nov 2011 10:41:09 -0600</pubDate>
    </item>
  </channel>
</rss>

