<?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, 19 May 2013 23:15:52 -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[Fabien Potencier: Debugging Silex applications just got fun]]></title>
      <guid>http://www.phpdeveloper.org/news/19156</guid>
      <link>http://www.phpdeveloper.org/news/19156</link>
      <description><![CDATA[<p>
On his site <i>Fabien Potencier</i> has <a href="http://fabien.potencier.org/article/66/debugging-silex-applications-just-got-funnier">posted about a feature added to Silex</a> to help make debugging the flow of your application "more fun" - the Symfony web profiler.
</p>
<blockquote>
One of the big advantages of both Symfony and Silex is that they are based on the Symfony HttpKernel component. [...] But handling HTTP requests with the Symfony HttpKernel also gives you a lot of free and optional features like a built-in reverse proxy written in PHP, easy handling of ESI and Hincludes (via the Fragment sub-framework), or the gorgeous Symfony web profiler.
</blockquote>
<p>
<a href="http://symfony.com/uploads/assets/profiler_timeline.jpg">The profiler</a> provides information on which components were accessed, their memory consumption and how long they took to execute. The integration happens via the <a href="https://github.com/sensiolabs/Silex-WebProfiler">WebProfiler</a> provider for Silex and is already integrated into the <a href="https://github.com/fabpot/Silex-Skeleton">Silex skeleton</a> base application.
</p>]]></description>
      <pubDate>Fri, 08 Feb 2013 11:54:38 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[James Morris: A WebSockets, Ratchet, Silex and Redis PubSub Implementation]]></title>
      <guid>http://www.phpdeveloper.org/news/19080</guid>
      <link>http://www.phpdeveloper.org/news/19080</link>
      <description><![CDATA[<p>
<i>James Morris</i> has an <a href="http://blog.jmoz.co.uk/websockets-ratchet-react-redis">interesting new post</a> to his site about the creation of a real-time web service that could be used for iOS applications via Websockets. He chose <a href="http://socketo.me/">Ratchet</a> for the handling (a PHP-based websocket tool) combined with Redis and Silex.
</p>
<blockquote>
I was approached by a betting/gambling development company who potentially needed a middleware building that would pull from an existing gambling web service and basically transmit to connected iPhone clients the changes from the web service. At first, the obvious answer might be to create another REST web service that the iPhone clients could just ping for changes. However, one of the devs explained that this wouldn't be fast enough, or scale - they'd need changes to be transmitted as soon as possible, as the app would be a real-time betting app and there'd be thousands of connections to the server.
</blockquote>
<p>
His solution involved hooking together Ratchet, Redis, Silex and Predis-async to create <a href="http://silex-test.jmoz.co.uk/pubsub">this sample tool</a> for handling the websocket requests. it uses the "pubsub" mechanism of Redis to push the updates out to listening clients.
</p>]]></description>
      <pubDate>Wed, 23 Jan 2013 12:09:33 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Stan Lemon: Aura.Micro - Experimental Replacement for Silex]]></title>
      <guid>http://www.phpdeveloper.org/news/18891</guid>
      <link>http://www.phpdeveloper.org/news/18891</link>
      <description><![CDATA[<p>
With all of the recent talk about the <a href="http://auraphp.github.com">Aura framework</a> that's been happening lately, <i>Stan Lemon</i> thought it would be interesting to see how a microframework based on the Aura packages would be to create. He's <a href="http://auraphp.github.com/2012/12/14/aura-micro-experimental-replacement-for-silex/">posted about his experiences</a> on his site today.
</p>
<blockquote>
I was recently working on a small project that used <a href="http://silex.sensiolabs.org/">Silex</a>. As I browsed my vendor folder, I realized how much extra "stuff" I had inherited with Silex. There were a bunch of other components required when all I wanted was some quick and easy routing, micro-framework style. When I think about going lean I always find myself coming back to Aura. <A href="http://auraphp.github.com/2012/06/20/aura-router-also-as-micro-framework/">Micro-frameworks are not a new to idea to Aura</a>, so I wondered if I could take the elegance and ease of Silex by wrapping up <a href="https://github.com/auraphp/Aura.Router">Aura.Router</a> and exposing it through a similar API.
</blockquote>
<p>
The result of his work is <a href="http://github.com/stanlemon/aura-micro">Aura.Micro</a>, a simple microframework that really just handles routing (unlike Silex with builds on the Pimple DI as well). He includes an example of it in use, defining several different kinds of actions on the routing like "before", "finish" and a few "get" routes.
</p>]]></description>
      <pubDate>Fri, 14 Dec 2012 09:29:12 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Volker Dusch: A silex love story - 'Embedded' PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/18848</guid>
      <link>http://www.phpdeveloper.org/news/18848</link>
      <description><![CDATA[<p>
In <a href="http://edorian.posterous.com/a-silex-love-story-embedded-php">this new post</a> to his site <i>Volker Dusch</i> talks about some of his first experiences with the <a href="http://silex.sensiolabs.org/">Silex</a> microframework (from the folks behind Symfony) and the evolution his code went through in its first few versions.
</p>
<blockquote>
A couple of weeks ago Igor wrote a fantastic blog post about "<a href="https://igor.io/2012/11/09/scaling-silex.html">Scaling a Silex code base</a>" which made me remember a story I wanted to share about how I fell in love with Silex. This blog post aims to tell that story. If you never heard of Silex is let me paste the blurp from the <a href="http://silex.sensiolabs.org/">silex home page</a> for you: "Silex is a PHP microframework for PHP 5.3. It is built on the shoulders of Symfony2 and Pimple and also inspired by Sinatra."
</blockquote>
<p>
He talks about some of his "first steps" with the framework and their need for a smaller system that could run embedded on a local machine. He talks about how Silex let him rapidly prototype and develop the application with only what was needed. He shows the evolution of his route handling from simple closures to method calls on objects out to using providers.
</p>]]></description>
      <pubDate>Wed, 05 Dec 2012 12:03:17 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Dave Marshall: Silex Route Helpers for a Cleaner Architecture]]></title>
      <guid>http://www.phpdeveloper.org/news/18808</guid>
      <link>http://www.phpdeveloper.org/news/18808</link>
      <description><![CDATA[<p>
In a <a href="http://phpdeveloper.org/news/18549">previous post</a> of his <i>Dave Marshall</i> talked about using controllers as "services" in a Silex-based application. In <a href="http://davedevelopment.co.uk/2012/11/27/silex-route-helpers-for-a-cleaner-architecture.html">this new post</a> he takes it a step further and shows you how to use route helpers to make working with those controllers even simpler.
</p>
<blockquote>
Supposing we want to render some HTML, do we want to inject the template engine in to the controller? Should the controller be responsible for knowing how to render the template? I'm not sure, but if I can have it not do it with minimal fuss, I think I'd rather it not. The full stack framework has the <a href="http://symfony.com/doc/2.0/bundles/SensioFrameworkExtraBundle/annotations/view.html">@Template</a> annotation, which allows developers to assign a template to a controller and then simply return an array. If they can do it in the full stack framework, we can do it in Silex.
</blockquote>
<p>
He includes the code for an example of a 404 handling page that uses the "convert" method to configure a route (path to a controller) for the currently matched route. He also shows the creation of a simple "CustomRoute" class and a "TemplateRenderingListener" to make it simpler to customize the handling and output of the request, all injected into the application's DI for later use.
</p>]]></description>
      <pubDate>Tue, 27 Nov 2012 10:57:16 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Igor Wiedler: Scaling a Silex code base]]></title>
      <guid>http://www.phpdeveloper.org/news/18721</guid>
      <link>http://www.phpdeveloper.org/news/18721</link>
      <description><![CDATA[<p>
<i>Igor Wiedler</i> has a new post to his site today talking about <a href="https://igor.io/2012/11/09/scaling-silex.html">scaling Silex-based applications</a> (a microframework based on Symfony components) and using it for more than just the basic applications.
</p>
<blockquote>
One common misconception about <a href="http://silex.sensiolabs.org/">silex</a> and microframeworks in general is that they are only suited for small, simple apps, APIs and prototyping. Of course, those use cases are the main selling point, but they are by no means the limit of what is possible.
</blockquote>
<p>
He shares some code that's the common "first steps" for someone using the framework, but points out a better way - moving your controller handling out into separate files instead. With a built-in feature of Silex, you can specify the "path" to another class file that will handle the request and return the response back to the main app. He also suggests extracting even more of the functionality out into "service" classes to handle the processing, cleaning up the controllers even more. He finishes off the post with a brief comparison between Silex and a full Symfony2 application, noting that Silex is a bit more "free form" when it comes to structure where Symfony2 apps are pretty well defined and have their conventions.
</p>]]></description>
      <pubDate>Fri, 09 Nov 2012 10:55:04 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso: Building a Silex application from one Behat/Gherkin feature file]]></title>
      <guid>http://www.phpdeveloper.org/news/18637</guid>
      <link>http://www.phpdeveloper.org/news/18637</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has <a href="http://gonzalo123.com/2012/10/22/building-a-silex-application-from-one-behatgherkin-feature-file/">an interesting post</a> showing how you can use a Gherkin file (used in tools like <a href="http://behat.org/">Behat</a>) to generate a Silex-based application.
</p>
<blockquote>
Last days I've playing with <a href="http://behat.org/">Behat</a>. Behat is a behavior driven development (BDD) framework based on Ruby's <a href="http://cukes.info/">Cucumber</a>. Basically with Behat we defenie features within one feature file. I'm not going to crate a Behat tutorial (you can read more about Behat <a href="http://docs.behat.org/quick_intro.html">here</a>). Behat use Gherkin to write the features files. When I was playing with Behat I had one idea. The idea is simple: Can we use Gherking to build a Silex application?. It was a good excuse to study Gherking, indeed.
</blockquote>
<p>
He includes the example feature file - one that builds an API that lets you list users, get the information for a specific user and update the user's information. Also included are two simple requests to be made to the API and the actual script that makes the Gherkinn-to-Silex translation possible. You can find the <a href="https://github.com/gonzalo123/gherking-sylex">full code on github</a>.
</p>]]></description>
      <pubDate>Mon, 22 Oct 2012 08:55:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Dave Marshall: Silex Controllers as Services]]></title>
      <guid>http://www.phpdeveloper.org/news/18549</guid>
      <link>http://www.phpdeveloper.org/news/18549</link>
      <description><![CDATA[<p>
<i>Dave Marshall</i> has written up a post about how he <a href="http://davedevelopment.co.uk/2012/10/03/Silex-Controllers-As-Services.html">uses Silex controllers as services</a> that allow him to define his controller methods in separate classes with a custom resolver.
</p>
<blockquote>
There's currently a pull request in the queue for <a href="http://silex.sensiolabs.org/">Silex</a> that adds a cookbook entry for using controller classes, but I wanted to take it a step further and have my controllers as services, much like <a href="http://symfony.com/doc/current/cookbook/controller/service.html">what's possible</a> with the full symfony framework (See <a href="http://richardmiller.co.uk/2011/04/15/symfony2-controller-as-service/">Richard Miller's post</a> for further reading).
</blockquote>
<p>
He includes some example code showing the creation of the Silex application with a service definition, the custom "ControllerResolver" to override the default and a simple controller class ("PostController") that just returns a JSON response. You can find the full example code for it <a href="https://github.com/davedevelopment/silex-service-controllers">on github</a>.
</p>]]></description>
      <pubDate>Wed, 03 Oct 2012 09:36:15 -0500</pubDate>
    </item>
  </channel>
</rss>
