<?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, 22 May 2013 12:21:51 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Lukas Smith: What is needed to REST in Symfony2]]></title>
      <guid>http://www.phpdeveloper.org/news/19550</guid>
      <link>http://www.phpdeveloper.org/news/19550</link>
      <description><![CDATA[<p>
<i>Lukas Smith</i> has a new post to his site that asks the question "<a href="http://pooteeweet.org/blog/2221">what's needed to REST in Symfony 2?</a>" In it he talks about some of the current issues surrounding REST support in Symfony (bundles) and a "call to arms" to create something better.
</p>
<blockquote>
I think we already have quite a nice toolchain for REST in Symfony2 with Bundles like <a href="https://github.com/friendsOfSymfony/FOSRestBundle">FOSRestBundle</a>, <a href="http://github.com/schmittjoh/JMSSerializerBundle">JMSSerializerBundle</a>, <a href="https://github.com/nelmio/NelmioApiDocBundle">NelmioApiDocBundle</a>, <a href="https://github.com/TheFootballSocialClub/FSCHateoasBundle">FSCHateoasBundle</a> and <a href="https://github.com/hautelook/TemplatedUriBundle">HautelookTemplatedUriBundle</a>. What is great about these Bundles is that they are all nicely integrated with each other. But there are still some limitations which should be addressed.
</blockquote>
<p>
Some of the still outstanding issues he points out include issues with content-type and routing, dynamic content in the NelmioApi bundle, Behat context testing, JSONP support and more. He suggests gathering together a product backlog of these items and possibly making a kickstarter to fund its development.
</p>
Link: http://pooteeweet.org/blog/2221]]></description>
      <pubDate>Mon, 06 May 2013 10:24:05 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Reddit.com: Zend2 vs Symfony2]]></title>
      <guid>http://www.phpdeveloper.org/news/19544</guid>
      <link>http://www.phpdeveloper.org/news/19544</link>
      <description><![CDATA[<p>
On Reddit.com there's <a href="http://www.reddit.com/r/PHP/comments/1dcqst/zend2_vs_symfony2/">a discussion happening</a> comparing two popular and prominent PHP frameworks - Zend Framework 2 and Symfony 2.
</p>
<blockquote>
For those that have used both frameworks, what one do you feel is a better overall framework? I tried ZF2 in beta and it seemed overly complicated to symfony but I don't know if its gotten better since then.
</blockquote>
<p>Opinions shared in the comments of the post include things like:</p>
<ul>
<li>"So if you are learning for job prospects, go Zend. I love Symfony 2 though, its a joy to work with."
<li>"It doesn't matter. Each has a strength and a weakness, and neither will go away. Pick one and use it, you'll be fine."
<li>"I don't think there is such thing as a best framework as you should use the best tool for the job. I don't think MVC is the solution to all problems."
<li>"Both are quite bloated but they have to be considering their target markets."
</ul>
<p>
On the whole, the views are of the "best tool for the job" mentality - a good sign for the community and these two frameworks.
</p>
Link: http://www.reddit.com/r/PHP/comments/1dcqst/zend2_vs_symfony2]]></description>
      <pubDate>Fri, 03 May 2013 12:57:56 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Reddit.com: Dependency injection in ZF2 and Symfony 2 are service locators]]></title>
      <guid>http://www.phpdeveloper.org/news/19468</guid>
      <link>http://www.phpdeveloper.org/news/19468</link>
      <description><![CDATA[<p>
On Reddit's PHP section there's a discussion happening about <a href="http://www.reddit.com/r/PHP/comments/1caidn/dependency_injection_in_zf2_and_symfony_2_are/"> dependency injection versus service locators</a> in two popular PHP frameworks - Zend Framework 2 and Symfony 2 (and how they're not really DI at all).
</p>
<blockquote>
Both ZF2 and Symfony 2 offer the same behavior: if I'm in a controller, and I want to use a service, I have to get it from the container with $this->get('my_service').
As such, the controller is not using DI, this is the service locator pattern. Controllers become more difficult to tests because of that, and they depend on the container now. I wonder why both frameworks didn't go further: why not treat controllers like services and use dependency injection on them. In other words: if a controller needs a service "A", then it should get it in the constructor, or through setter/property injection.
</blockquote>
<p>
The <a href="http://www.reddit.com/r/PHP/comments/1caidn/dependency_injection_in_zf2_and_symfony_2_are/">comments</a> talk some about the "controller from the DI container" idea, some other ways around the problem and some clarification as to what the frameworks are actually doing related to the container injection.
</p>
Link: http://www.reddit.com/r/PHP/comments/1caidn/dependency_injection_in_zf2_and_symfony_2_are]]></description>
      <pubDate>Tue, 16 Apr 2013 12:40:07 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Lukas Smith: Good design is no excuse for wasting time]]></title>
      <guid>http://www.phpdeveloper.org/news/19377</guid>
      <link>http://www.phpdeveloper.org/news/19377</link>
      <description><![CDATA[<p>
In his most recent post <i>Lukas Smith</i> suggests that <a href="http://pooteeweet.org/blog/0/2205#m2205">good design isn't an excuse for wasting time</a>. He's basically saying that Symfony2, because of how it's designed and implemented, isn't a RAD (rapid application development) framework and that it's about time for some layers to be added to help get it there.
</p>
<blockquote>
Symfony 1.x I would put into a category of frameworks focused on RAD, aka rapid application development. [...] So for those people who were happy focusing on the 80% use case Symfony2 is a step back. Suddenly the same features take longer to implement, take longer to modify later on and on top of that the learning curve is steeper.
</blockquote>
<p>
He suggests that work be put into "RAD layers" that can sit on top of Symfony2 and provide some of the more familiar features people are used to from things like CakePHP, Yii and CodeIgniter. There's been <a href="https://github.com/FriendsOfSymfony/FOSRestBundle/blob/master/Resources/doc/5-automatic-route-generation_single-restful-controller.md">a few</a> <a href="http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/index.html">tries</a> to <a href="http://sonata-project.org/bundles/admin/master/doc/index.html">accomplish</a> this with only one getting the closest in his opinion - the <a href="http://rad.knplabs.com/">KnpBundle</a>.
</p>]]></description>
      <pubDate>Thu, 28 Mar 2013 11:51:51 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Symfony Blog: New in Symfony 2.2: The new fragment sub-framework]]></title>
      <guid>http://www.phpdeveloper.org/news/19239</guid>
      <link>http://www.phpdeveloper.org/news/19239</link>
      <description><![CDATA[<p>
<i>Fabien Potencier</i> has new post post to the Symfony Blog today talking about a <a href="http://symfony.com/blog/new-in-symfony-2-2-the-new-fragment-sub-framework">big update to the Symfony framework</a>, the introduction of a new "fragment sub-framework". This framework (now a part of the HttpKernel) allows the handling of requests based on a few different strategies.
</p>
<blockquote>
About a month ago, I merged a complete refactoring of the sub-requests management of Symfony. In fact, I created a whole new sub-framework to handle the rendering of resource fragments via different strategies. [...] Besides classical master requests, the HttpKernel component is now able to handle sub-requests. Let's me sum up the different strategies that are available: internal sub-requests, ESIs, HIncludes, and SSIs (in 2.3). 
</blockquote>
<p>
He talks some about each strategy and what situations they're best suited for and some sample code that shows the use of the "standalone" and "strategy" parameters. There's also new methods you can call (like "render_esi" or "render_hinclude") to work with the new features as well. 
</p>]]></description>
      <pubDate>Tue, 26 Feb 2013 10:13:50 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso: How to configure Symfony's Service Container to use Twitter API]]></title>
      <guid>http://www.phpdeveloper.org/news/19136</guid>
      <link>http://www.phpdeveloper.org/news/19136</link>
      <description><![CDATA[<p>
In <a href="http://gonzalo123.com/2013/02/04/how-to-configure-symfonys-service-container-to-use-twitter-api/">this recent post</a> to his site <i>Gonzalo Ayuso</i> shows how to use the Symfony2 service container to interact directly with the Twitter API via an OAuth plugin.
</p>
<blockquote>
If we are working within a Symfony2 application or a PHP application that uses the Symfony's Dependency injection container component you can easily integrate this simple script in the service container. I will show you the way that I use to do it. 
</blockquote>
<p>
His sample code uses the <a href="http://guzzlephp.org/">Guzzle</a> HTTP library and some configuration options from a YAML file to create a new service hooked into the Twitter API with his credentials. He then imports it via his services configuration and shows an example of it in action - getting the latest contents of his timeline.
</p>]]></description>
      <pubDate>Tue, 05 Feb 2013 10:53:19 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Joshua Thijssen: Custom symfony2 config loader]]></title>
      <guid>http://www.phpdeveloper.org/news/19111</guid>
      <link>http://www.phpdeveloper.org/news/19111</link>
      <description><![CDATA[<p>
In <a href="http://www.adayinthelifeof.nl/2013/01/30/custom-symfony2-config-loader/">his latest post</a> <i>Joshua Thjissen</i> looks at the creation of a custom configuration loader for a Symfony2 application. This kind of thing is mostly useful for parsing configurations that Symfony2 doesn't already know how to parse.
</p>
<blockquote>
It happens more and more: large projects where your symfony2 site is just a small part in the big picture. Lots of additional components might even play a bigger part, especially when you are dealing with asynchronous components  which are connected through message queues for instance. [...] Our first idea is obvious: symfony2 uses by default a parameters.yml file, which gets imported by your configuration (config.yml) [...] So nothing new here and this setup works perfectly, provided that your symfony2 project is the ONLY thing that needs to be configured. As soon as you add multiple other components (like gearman or activemq workers that need to connect to solr too), they need to share this configuration. 
</blockquote>
<p>
His solution involves falling back to the INI-file format that's known as useful for several different languages and tools. Because of how Symfony2 reads these files though (only looking for "parameters") he's had to create a "ConfFileLoader" instance of the "FileLoader" that uses the <a href="http://php.net/parse_ini_file"> parse_ini_file</a> method to parse the data and return it back to the main container as parameters. He also includes the code/config you'll need to implement this custom loader into your application.
</p>]]></description>
      <pubDate>Wed, 30 Jan 2013 11:51:47 -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[Gonzalo Ayuso: Handling several DBALs in Symfony2 through the Dependency Injection with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/19044</guid>
      <link>http://www.phpdeveloper.org/news/19044</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has a second post in his series looking at using the Symfony2 dependency injection container with Doctrine functionality. In his <a href="http://phpdeveloper.org/news/19007">previous post</a> he talked about sharing PDO connections via the DIC. In <a href="http://gonzalo123.com/2013/01/14/handling-several-dbal-database-connections-in-symfony2-through-the-dependency-injection-container-with-php/">this latest one</a> it's focused on the sharing of DBALs from Doctrine.
</p>
<blockquote>
OK. We can handle PDOs connections inside a Symfony2 application, but what happens if we prefer DBAL. As we know DBAL is built over PDO and adds a set of "extra" features to our database connection. It's something like PDO with steroids.
</blockquote>
<p>
He includes the (PHP) configuration to set up the DBAL and the YAML definition to set it up in the DIC's configuration. As an update to the post, he also points out a bundle for Symfony2 that lets Doctrine do this natively - check out <a href="https://github.com/doctrine/DoctrineBundle/blob/master/Resources/doc/configuration.rst#doctrine-dbal-configuration">this documentation</a> on github.
</p>]]></description>
      <pubDate>Wed, 16 Jan 2013 10:47:32 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso: Handling several PDO Database connections in Symfony2 through the DIC in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/19007</guid>
      <link>http://www.phpdeveloper.org/news/19007</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has <a href="http://gonzalo123.com/2013/01/07/handling-several-pdo-database-connections-in-symfony2-through-the-dependency-injection-container-with-php/">written up a new post</a> about a handling method he's worked up for working with multiple PDO instances (database connections) through the Symfony2 dependency injection container using custom YML definitions and a simple "Db" class.
</p>
<blockquote>
I'm not a big fan of ORMs, especially in PHP world when all dies at the end of each request. Plain SQL is easy to understand and very powerful. Anyway in PHP we have Doctrine. Doctrine is a amazing project, probably (with permission of Symfony2) the most advanced PHP project, but I normally prefer to work with SQL instead of Doctrine. [...] Due to my daily work I need to connect to different databases (not only one) in my applications.
</blockquote>
<p>
He shows the normal setup using the "parameters.yml" file to define the multiple database connections but notes that this isn't the most ideal solution. Instead, he walks you through the steps to create the "databases.yml" configuration file and a simple "Db" class that acts as an interface to pull the PDO objects from the container. You can then just call the "get" method on the container to extract the fully configured PDO object, ready for use.
</p>]]></description>
      <pubDate>Tue, 08 Jan 2013 11:52:40 -0600</pubDate>
    </item>
  </channel>
</rss>
