<?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, 19 Jun 2013 21:56:24 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Gonzalo Ayuso: Scaling Silex applications (part II). Using RouteCollection]]></title>
      <guid>http://www.phpdeveloper.org/news/19277</guid>
      <link>http://www.phpdeveloper.org/news/19277</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has <a href="http://gonzalo123.com/2013/03/04/scaling-silex-applications-part-ii-using-routecollection/">posted a second part</a> of his look at scaling Silex (here's <a href="http://gonzalo123.com/2013/02/11/scaling-silex-applications/">part one</a>). In this new article he shows how to use the RouteCollection functionality instead of defining the routes in the DI configuration.
</p>
<blockquote>
In the post <a href="http://gonzalo123.com/2013/02/11/scaling-silex-applications/">Scaling Silex applications</a> I wanted to organize a one Silex application. In one <a href="http://gonzalo123.com/2013/02/11/scaling-silex-applications/#comment-3834">comment</a> Igor Wiedler recommended us to use RouteCollections instead of define the routes with a Symfony's Dependency Injection Container. Because of that I started to hack a little bit about it and here I show you my outcomes:
</blockquote>
<p>
He includes example code for creating the application, setting up the main "routes.yml" file with some defaults and two other files for routes in other parts of the site - "api" and "blog". Then he makes the controllers related to these three sections with basic actions catching each of the routes. The source for the entire thing is <a href="https://github.com/gonzalo123/silexRouteCollection">over on github</a>.
</p>]]></description>
      <pubDate>Wed, 06 Mar 2013 09:21:31 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso: Scaling Silex applications]]></title>
      <guid>http://www.phpdeveloper.org/news/19168</guid>
      <link>http://www.phpdeveloper.org/news/19168</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has posted yet another <a href="http://gonzalo123.com/2013/02/11/scaling-silex-applications/">helpful Silex hint</a> for those using this microframework and wanting to scale up their applications past the prototype stage - an extension to allow route definition in a YAML configuration.
</p>
<blockquote>
My idea is to store this information within a Service Container (we will use Symfony's DIC). For example here we can [define] our routes.yml. [...] We need to implement one Extension for the alias "routes". We only will implement the needed functions for YAML files in this example.
</blockquote>
<p>
He includes the code for the extension ("SilexRouteExtension") that can be used to parse the "routes.yml" file to inject the custom routing into your application. This includes the pattern to match, the controller to route it to and the target method. You can also set some requirements like the request method (in this case "GET").
</p>]]></description>
      <pubDate>Tue, 12 Feb 2013 09:54:54 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[P&aacute;draic Brady: Getting Ahead In Security By Watching The Neighbours]]></title>
      <guid>http://www.phpdeveloper.org/news/19061</guid>
      <link>http://www.phpdeveloper.org/news/19061</link>
      <description><![CDATA[<p>
In <a href="http://blog.astrumfutura.com/2013/01/getting-ahead-in-security-by-watching-the-neighbours/">his latest post</a> <i>Padraic Brady</i> talks some about the recent security issues that <a href="https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion">happened with Ruby on Rails</a> that allowed for remote code execution and how, if you use code blindly, you could be in for a similar fate.
</p>
<blockquote>
<p>
Code execution vulnerabilities are, by definition, hideous monsters. The ability for external inputs to enter an execution context (i.e. injecting or manipulating code that is executed on the server) can be difficult to spot through the haze of convenience that such machinations are often designed to deliver. In Rail's case, that convenience was to automatically cast data entries in XML or YAML inputs into Ruby types including, unfortunately, Symbols and Objects. 
</p>
<p>
These types of "buried" code execution vulnerabilities are still easy to locate in PHP, at least, because you are still restricted to normal code execution pathways in the absence of Ruby's dark magic, e.g. eval(), include(), require_once(), system() and, let's not forget, unserialize(). 
</p>
</blockquote>
<p>
He talks about how, if you're not careful with the code (third party libraries) that you use in your applications - or don't adhere to good security practices in your own - you could be vulnerable to a similar style of attack. After some investigation on his part, he discovered an issue related to this in the Symfony2 YAML parser (<a href="http://symfony.com/blog/security-release-symfony-2-0-22-and-2-1-7-released">now fixed</a> with a new release). 
</p>
<blockquote>
To summarise…

Pay attention to competing applications or frameworks - their problems may also be your problems. If you're worried about arbitrary code execution vulnerabilities then audit your code. You can even, as a sanity check, use grep to find uses of functions like eval(), unserialize(), etc and analyse where their parameters' might originate from. 
</blockquote>]]></description>
      <pubDate>Fri, 18 Jan 2013 11:53:52 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Using YAML in Your PHP Projects]]></title>
      <guid>http://www.phpdeveloper.org/news/18264</guid>
      <link>http://www.phpdeveloper.org/news/18264</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial showing you how you can <a href="http://phpmaster.com/using-yaml-in-php-projects/">use YAML documents</a> on your applications ("YAML Ain't Markup Language") for configuration files.
</p>
<blockquote>
Test fixtures, configuration files, and log files all need to be both human and machine readable. YAML (YAML Ain't Markup Language) is a less-verbose data serialization format than XML and has become a popular format among software developers mainly because it is human-readable. YAML files are simply text files that contain data written according to YAML syntax rules and usually have a .yml file extension. In this article, you will learn the basics of YAML and how you can integrate a PHP YAML parser into your projects.
</blockquote>
<p>
They start with a brief introduction to the YAML syntax by comparing them to the structure of a typical PHP array. They include the YAML output from these examples and how, despite the ease of its use, it shouldn't be considered a replacement for something like XML (they both have their strengths). He points out some of the current YAML parsing libraries and how to integrate them into your app (he uses the Symfony option).
</p>]]></description>
      <pubDate>Tue, 24 Jul 2012 09:06:46 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Konr Ness' Blog: Zend_Config Benchmark - JSON, Array, INI, XML, YAML]]></title>
      <guid>http://www.phpdeveloper.org/news/17647</guid>
      <link>http://www.phpdeveloper.org/news/17647</link>
      <description><![CDATA[<p>
In <a href="http://konrness.com/php5/zend_config-benchmark-json-array-ini-xml-yaml/">this recent post</a> to his blog, <i>Konr Ness</i> has benchmarked the components that the Zend Framework uses to read in different types of configuration files - JSON, native PHP arrays, INI, XML and YAML files.
</p>
<blockquote>
If you application relies on parsing one or several config files each time it is bootstrapped it is important that you select a file format that is fast to parse. But you also want to select a config file format that is easy for a human to read and edit. In a recent application I am building I also had the need to write modifications to config files, so I also benchmarked the Zend_Config_Writer components.
</blockquote>
<p>
He includes both the sample configuration INI file and the benchmarking script he used to measure the results (all configurations were read from external files, even the native PHP option). His results were pretty predictable (with the exception of YAML reading) with the standard INI file coming in second to the native PHP arrays, but having the advantage of being more readable.
</p>]]></description>
      <pubDate>Thu, 08 Mar 2012 11:51:32 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Marcelo Gornstein's Blog: Dependency injection with Xml and Yaml in the Ding container]]></title>
      <guid>http://www.phpdeveloper.org/news/17584</guid>
      <link>http://www.phpdeveloper.org/news/17584</link>
      <description><![CDATA[<p>
In <a href="http://marcelog.github.com/articles/ding_xml_yaml_di_dependency_injection.html">this new post</a> to his blog today <i>Marcelo Gornstein</i> looks at doing some dependency injection in a simple application via XML and YAML configurations and the <a href="http://marcelog.github.com/Ding">Ding</a> dependency injection container.
</p>
<blockquote>
In this <a href="http://marcelog.github.com/articles/ding_component_bean_annotations_di_dependency_injection.html">past article</a> I've discussed the dependency injection features when using annotations. This time, we'll see how to use the xml and yaml drivers to do the same (setter and constructor injection). If you don't know how to configure the xml and yaml drivers, please start by reading <a href="http://marcelog.github.com/articles/ding_example_xml_yaml_annotations_bean_drivers_tutorial_how_to.html">this</a>.
</blockquote>
<p>
He describes the different injection methods available with the container - setter injection, constructor injection and method injection. Example configuration content is included - both the XML and YAML versions.
</p>]]></description>
      <pubDate>Fri, 24 Feb 2012 11:37:04 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Using PHP classes to store configuration data]]></title>
      <guid>http://www.phpdeveloper.org/news/15711</guid>
      <link>http://www.phpdeveloper.org/news/15711</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has <a href="http://gonzalo123.wordpress.com/2011/01/10/using-php-classes-to-store-configuration-data/">a new post</a> to his blog today looking at how he uses PHP classes to store configuration information for easier retrieval.
</p>
<blockquote>
In my last projects I'm using something I think is useful and it's not a common practice in our PHP projects. That's is the usage of a plain PHP's class for the application's configuration. Let me explain it. Normally we use ini file for configuration. [...] There are many standard options. Why I prefer a different one then? I like plain PHP classes because the IDE helps me with autocompletion. The usage is quite simple. 
</blockquote>
<p>
His example uses a standard class to store the configuration values, one that can be loaded into a project and lets you call the configuration values statically. He gives <a href="http://gonzalo123.files.wordpress.com/2011/01/netbeans.png">two</a> <a href="http://gonzalo123.files.wordpress.com/2011/01/vim.png">examples</a> of how this is helpful in a standard IDE with autocompletion.
</p>]]></description>
      <pubDate>Mon, 10 Jan 2011 11:57:39 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: Working with the Symfony Components PHP Libraries]]></title>
      <guid>http://www.phpdeveloper.org/news/14500</guid>
      <link>http://www.phpdeveloper.org/news/14500</link>
      <description><![CDATA[<p>
On PHPBuilder.com today there's a new article looking at <a href="http://phpbuilder.com/columns/Octavia_Anghel051110.php3">working with the three Symfony component libraries</a> as standalone tools that can be used outside of the framework - YAML handling, templating and an event dispatcher.
</p>
<blockquote>
These libraries were once an integrated part of the Symfony project, but now they represent a separate Symfony project. Because the Symfony Components are standalone PHP classes, you can both use them without the Symfony MVC framework and integrate them very easily in any PHP project. You can install each of the Symfony Components in the same, very simple manner. All you need to do is download the source code (a TAR or a ZIP archive) from the <a href="http://components.symfony-project.org/">project page</a>.
</blockquote>
<p>
The tutorial goes through each tool, briefly explaining what the technology is that's involved and provides some code examples to show you its use.
</p>]]></description>
      <pubDate>Wed, 12 May 2010 08:48:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Fabien Potencier's Blog: The state of YAML in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/13704</guid>
      <link>http://www.phpdeveloper.org/news/13704</link>
      <description><![CDATA[<p>
In <a href="http://fabien.potencier.org/article/40/the-state-of-yaml-in-php">this new article</a> on his blog <i>Fabien Potencier</i> looks at the current state of the YAML markup language and how well it's supported in the world of PHP.
</p>
<blockquote>
YAML can be used to describe both simple and complex data structures. It's an easy to learn language that describes data. As PHP, it has a syntax for simple types like strings, booleans, floats, integers, arrays, and even more complex ones like objects. Nowadays, YAML is a heavily used format for configuration files, mainly because even non programmers are able to understand and modify YAML files easily.
</blockquote>
<p>
He spends a little time describing the YAML markup format and shows how to parse it using the <a href="http://symfony-project.org">Symfony</a> component, how to get it and install it (via svn checkout).
</p>]]></description>
      <pubDate>Mon, 21 Dec 2009 09:25:17 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Daniel Cousineau's Blog: Doctrine Migrations Proper]]></title>
      <guid>http://www.phpdeveloper.org/news/13416</guid>
      <link>http://www.phpdeveloper.org/news/13416</link>
      <description><![CDATA[<p>
<i>Daniel Cousineau</i> has <a href="http://www.toosweettobesour.com/2009/10/20/doctrine-migrations-proper/">posted a quick guide</a> to migrating database information with Doctrine:
</p>
<blockquote>
I was talking with someone [...] here at ZendCon and discovered that they were having trouble with migrations in Doctrine. Having gone through the same issues of Doctrine seemingly not being able to figure out your changes and generate migration classes, I thought I'd post the solution here for future reference.
</blockquote>
<p>
It's four quick steps that'll get Doctrine to automatically generate the differences (deltas) and upgrade your models to reflect these changes.
</p>]]></description>
      <pubDate>Wed, 21 Oct 2009 09:57:11 -0500</pubDate>
    </item>
  </channel>
</rss>
