<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>Aura for PHP</title>
 <link href="http://auraphp.com/blog/atom.xml" rel="self"/>
 <link href="http://auraphp.com"/>
 <updated>2019-05-21T15:49:38UTC</updated>
 <id>http://auraphp.com</id>
 <author>
   <name>Aura</name>
   <email></email>
 </author>

 
 <entry>
   <title>First Aura 3.x Stable Releases</title>
   <link href="http://auraphp.com/blog/2015/12/01/aura-3-stable-releases/"/>
   <updated>2015-12-01T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2015/12/01/aura-3-stable-releases</id>
   <content type="html">&lt;p&gt;Today we released the first round of stable Aura 3.x packages:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Payload_Interface/&quot;&gt;Aura.Payload_Interface&lt;/a&gt;, an interface for &lt;a href=&quot;https://vaughnvernon.co/?page_id=40&quot;&gt;domain payload&lt;/a&gt; implementations.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Payload/&quot;&gt;Aura.Payload&lt;/a&gt;, a &lt;a href=&quot;https://vaughnvernon.co/?page_id=40&quot;&gt;domain payload&lt;/a&gt; implementation.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Router/&quot;&gt;Aura.Router&lt;/a&gt;, a powerful, flexible web routing implemention for &lt;a href=&quot;https://github.com/php-fig/fig-standards/blob/master/proposed/http-message.md&quot;&gt;PSR-7&lt;/a&gt; requests.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since the announcement of the plans for Aura 3.x, we have made one small concession: the minimum PHP version is 5.5, instead of 5.6 &lt;a href=&quot;http://auraphp.com/blog/2015/03/27/aura-3-plans/&quot;&gt;as originally announced&lt;/a&gt;. Even so, all the 3.x packages are tested and operational on PHP 5.6, PHP 7, and HHVM.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>A Web Router for PSR-7, with Bookdown Documentation</title>
   <link href="http://auraphp.com/blog/2015/04/21/psr-7-web-router/"/>
   <updated>2015-04-21T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2015/04/21/psr-7-web-router</id>
   <content type="html">&lt;p&gt;Last month I wrote about &lt;a href=&quot;http://auraphp.com/blog/2015/03/27/aura-3-plans/&quot;&gt;our plans for Aura 3.x&lt;/a&gt;. Those plans are coming to fruition a bit earlier than I anticipated. Our first 3.x package is now available for review, a &lt;a href=&quot;https://github.com/php-fig/fig-standards/blob/master/proposed/http-message.md&quot;&gt;PSR-7&lt;/a&gt; implementation of &lt;a href=&quot;https://github.com/auraphp/Aura.Router/tree/3.x#aurarouter&quot;&gt;Aura.Router&lt;/a&gt;. It includes some feature upgrades such as &lt;a href=&quot;http://auraphp.com/packages/Aura.Router/advanced-topics.html#1.5.3&quot;&gt;custom rules&lt;/a&gt; and &lt;a href=&quot;http://auraphp.com/packages/Aura.Router/defining-routes.html&quot;&gt;more powerful route definitions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This is the first Aura library to use an external dependency. In fact, is uses two: one on the &lt;a href=&quot;https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md&quot;&gt;PSR-3&lt;/a&gt; logger interface, and one on the proposed &lt;a href=&quot;https://github.com/php-fig/fig-standards/blob/master/proposed/http-message.md&quot;&gt;PSR-7&lt;/a&gt; HTTP message interface.  Please note that these are &lt;em&gt;interface&lt;/em&gt; dependencies, and not implementation dependencies. Any package that implements those interfaces will fulfill the dependency requirement.&lt;/p&gt;

&lt;p&gt;Unfortunately, because of the PSR-7 interface dependency, the Aura.Router package cannot go “stable” until PSR-7 itself does. I expect this will be in the next 30 days or so. In the mean time we may tag preliminary “Google Beta” releases.&lt;/p&gt;

&lt;p&gt;On a side note, the package documentation uses &lt;a href=&quot;http://bookdown.io&quot;&gt;Bookdown&lt;/a&gt; for its documentation. You can see the generated documentation &lt;a href=&quot;http://auraphp.com/packages/Aura.Router&quot;&gt;here&lt;/a&gt;.  Bookdown allows us to keep documentation sources in each library repository. We can then collect them all into a single “book” on the Aura site using a &lt;a href=&quot;https://github.com/auraphp/auraphp.github.com/blob/master/_bookdown/_packages.bookdown.json&quot;&gt;bookdown.json&lt;/a&gt; file with remote “content” elements.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Aura 3 Plans</title>
   <link href="http://auraphp.com/blog/2015/03/27/aura-3-plans/"/>
   <updated>2015-03-27T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2015/03/27/aura-3-plans</id>
   <content type="html">&lt;p&gt;This is a really long post. Here’s a tl;dr:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;The Past&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;
        &lt;p&gt;Aura 1.x framework packages will see no new releases, and may be archived.&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;Aura 1.x library packages are near the end of active development; to prevent orphaning and end-of-life, ownership and authority over them they may be transferred to interested parties.&lt;/p&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;The Present&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;
        &lt;p&gt;Aura 2.x packages that are currently stable will remain the center of development attention, with some modifications to Composer and PHPUnit support files, and with added testing on PHP 7.&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;Aura 2.x packages that are not currently stable will not see stable 2.x releases; they will become 3.x candidate packages.&lt;/p&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;The Future&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;
        &lt;p&gt;Aura 3.x packages will target PHP 5.6, and additionally test on PHP 7.&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;Aura 3.x library packages will be allowed to depend on interface packages, though not other implementation packages.&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;Aura 3.x will not provide a framework under the Aura name, although the 2.x framework should be able to use 3.x components. Frameworks of Aura packages may be provided as separate projects.&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;Aura 3.x and later packages will have independent major version release cycles.&lt;/p&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Read on for details!&lt;/p&gt;

&lt;h2 id=&quot;the-past-aura-1x&quot;&gt;The Past: Aura 1.x&lt;/h2&gt;

&lt;p&gt;Aura 1.x is 4 years old at this point. Exploratory development began in late 2010, with the first commits under the Aura namespace in Jan 2011. The initial extraction of independent packages from &lt;a href=&quot;http://solarphp.com&quot;&gt;Solar&lt;/a&gt; was a great success.&lt;/p&gt;

&lt;h3 id=&quot;aura-1x-framework&quot;&gt;Aura 1.x Framework&lt;/h3&gt;

&lt;p&gt;The creation of a framework from those packages also worked well, for its time, but was imperfect. Among other things, Composer had not arrived on the scene when Aura 1.x started, so the 1.x framework only used Composer as an afterthought, and needed a special installer for the Aura 1.x library packages.&lt;/p&gt;

&lt;p&gt;I recently released verson 1.0.1 of the 1.x framework, to incorporate some outstanding fixes, which gave me an excuse to do a review of the system.  It is my assessment that the 1.x framework represents a necessary, but now obsolete, architectural step in Aura’s evolution. As such, &lt;strong&gt;the 1.x framework will not see new releases&lt;/strong&gt; after 1.0.1.&lt;/p&gt;

&lt;p&gt;New projects should use the 2.x systems: &lt;a href=&quot;https://github.com/auraphp/Aura.Web_Project&quot;&gt;Aura.Web_Project&lt;/a&gt;, &lt;a href=&quot;https://github.com/auraphp/Aura.Cli_Project&quot;&gt;Aura.Cli_Project&lt;/a&gt;, or &lt;a href=&quot;https://github.com/auraphp/Aura.Framework_Project&quot;&gt;Aura.Framework_Project&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I have not yet decided what to do with the 1.x framework Github repositories; these include the &lt;code class=&quot;highlighter-rouge&quot;&gt;Aura.Framework&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;Aura.Framework_Demo&lt;/code&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;system&lt;/code&gt; packages. I may go so far as to archive (zip/tgz) those repositories and provide them as downloads. That will retain their Git histories, leave them publicly available, and simultaneously obscure them from casual discovery.  (I am open to other suggestions here.)&lt;/p&gt;

&lt;h3 id=&quot;aura-1x-libraries&quot;&gt;Aura 1.x Libraries&lt;/h3&gt;

&lt;p&gt;Active development on Aura 1.x library packages has dwindled as the 2.x packages have become stable.  Thus, new feature development on 1.x is no longer a priority for me personally, and I do not expect to give them significant attention in the future.&lt;/p&gt;

&lt;p&gt;I am aware that there are still users of 1.x packages that have not transitioned to 2.x. To keep those packages from being orphaned and effectively “end-of-lifed”, I hereby invite anyone interested in maintaining them to contact me. The recipient will get full ownership and authority over the adopted package, with little to no further oversight from me.&lt;/p&gt;

&lt;p&gt;I am also aware that there are outstanding issues for Aura.Input and Aura.Marshal. I may be able to resolve some of them in the near future, and release new 1.x versions, but I make no promises there. However, unresolved issues will become the responsibility of the new owners, should anyone choose to receive them.&lt;/p&gt;

&lt;p&gt;Finally, an administrative note.  Aura 1.x libraries had a &lt;code class=&quot;highlighter-rouge&quot;&gt;develop&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;master&lt;/code&gt; branch. The &lt;code class=&quot;highlighter-rouge&quot;&gt;master&lt;/code&gt; branch always represented the latest 1.x release tag for that library. To reduce confusion and standardize naming across all packages and version, I would like to remove the &lt;code class=&quot;highlighter-rouge&quot;&gt;master&lt;/code&gt; branch, and rename the &lt;code class=&quot;highlighter-rouge&quot;&gt;develop&lt;/code&gt; branch to &lt;code class=&quot;highlighter-rouge&quot;&gt;develop-1&lt;/code&gt;, on all Aura packages. I am not sure yet what effect that will have on Composer, so that decision will need a little experimentation first.&lt;/p&gt;

&lt;h2 id=&quot;the-present-aura-2x&quot;&gt;The Present: Aura 2.x&lt;/h2&gt;

&lt;p&gt;Aura 2.x packages will continue to be the center of development attention. They will see some changes to their internal support file structures, but otherwise their guiding principles will remain the same.&lt;/p&gt;

&lt;h3 id=&quot;aura-2x-testing-structure&quot;&gt;Aura 2.x Testing Structure&lt;/h3&gt;

&lt;p&gt;Currently, library packages have a &lt;code class=&quot;highlighter-rouge&quot;&gt;tests/unit/&lt;/code&gt; directory and related PHPUnit files. Libraries that have a &lt;code class=&quot;highlighter-rouge&quot;&gt;config/Common.php&lt;/code&gt; dependency injection config file &lt;em&gt;also&lt;/em&gt; have a &lt;code class=&quot;highlighter-rouge&quot;&gt;tests/container/&lt;/code&gt; directory and a second second set of PHPUnit files; these are to test the DI wiring. In the near future, this will change so that:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;PHPUnit files reside in the package root directory; and,&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;The unit and container tests will be combined within the &lt;code class=&quot;highlighter-rouge&quot;&gt;tests/&lt;/code&gt; diretory itself, not segregated into their own subdirectories.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That will address an issue noted by @Beanow in &lt;a href=&quot;https://github.com/auraphp/Aura.Router/issues/66&quot;&gt;https://github.com/auraphp/Aura.Router/issues/66&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To support this, I need to modify the Composer files so that a new &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;require-dev&quot;: {&quot;aura/di&quot; : &quot;~2.0&quot;}&lt;/code&gt; element is present in those libraries that have &lt;code class=&quot;highlighter-rouge&quot;&gt;config/Common.php&lt;/code&gt; DI config files. Additionally, they will need a new &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;autoload-dev&quot;&lt;/code&gt; element pointing to the &lt;code class=&quot;highlighter-rouge&quot;&gt;tests/&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;Those new additions, in turn, mean that for library packages with DI config files, you will need to have Composer installed to run the full test suite.  2-3 years ago that may have been too great an imposition, but I think Composer is so well-established now that it is not an unreasonable expectation.  The tradeoff is that the DI configuration tests will automatically run for you, and incidentally on Travis-CI.&lt;/p&gt;

&lt;p&gt;I expect to make similar changes in Bundle, Kernel, and Project packages, but since these already assume the presence of Composer, the difference will not be as dramatic.&lt;/p&gt;

&lt;h3 id=&quot;aura-2x-php-versions&quot;&gt;Aura 2.x PHP Versions&lt;/h3&gt;

&lt;p&gt;The 2.x packages will continue to target the earliest possible PHP version for their operation. In most cases this remains PHP 5.3, and in some cases is PHP 5.4.  We also test against all later versions of PHP, including 5.5 and 5.6, and against HHVM when we can.&lt;/p&gt;

&lt;p&gt;In addition to these, I will add PHP 7 to the testing mix on all 2.x packages. Early reports from Ian Littman indicate that all 2.x packages are already PHP 7 compatible, so this is a adoption of his work.&lt;/p&gt;

&lt;h3 id=&quot;aura-2x-release-commitments&quot;&gt;Aura 2.x Release Commitments&lt;/h3&gt;

&lt;p&gt;2.x packages with existing stable releases will continue to be the center of development activity for the foreseeable future, including fixes and features.&lt;/p&gt;

&lt;p&gt;However, 2.x packages with only beta releases will not see stable releases as 2.x packages. Instead, they will get a new &lt;code class=&quot;highlighter-rouge&quot;&gt;develop-3&lt;/code&gt; branch, and further development will continue on them as 3.x candidates.  Their existing &lt;code class=&quot;highlighter-rouge&quot;&gt;2.x&lt;/code&gt; branches will remain in place but deprecated. (This affects only &lt;a href=&quot;https://github.com/auraphp/Aura.Auth&quot;&gt;Aura.Auth&lt;/a&gt;.)&lt;/p&gt;

&lt;p&gt;Further, packages with &lt;code class=&quot;highlighter-rouge&quot;&gt;2.x&lt;/code&gt; branches, but no releases, will also not see 2.x releases. They will likewise get &lt;code class=&quot;highlighter-rouge&quot;&gt;develop-3&lt;/code&gt; branches, and have their &lt;code class=&quot;highlighter-rouge&quot;&gt;2.x&lt;/code&gt; branches deprecated. Development will continue on them as 3.x candidates. (This affects &lt;a href=&quot;https://github.com/auraphp/Aura.Filter&quot;&gt;Aura.Filter&lt;/a&gt;, &lt;a href=&quot;https://github.com/auraphp/Aura.Http&quot;&gt;Aura.Http&lt;/a&gt;, and &lt;a href=&quot;https://github.com/auraphp/Aura.SqlMapper_Bundle&quot;&gt;Aura.SqlMapper_Bundle&lt;/a&gt;.)&lt;/p&gt;

&lt;h2 id=&quot;the-future-aura-3x-and-beyond&quot;&gt;The Future: Aura 3.x and Beyond&lt;/h2&gt;

&lt;p&gt;At last, the part you’re really interested in: future plans for Aura 3.x. This is where the next big set of changes will happen in Aura development.&lt;/p&gt;

&lt;h3 id=&quot;minimum-php-version-bumped-up&quot;&gt;Minimum PHP Version Bumped Up&lt;/h3&gt;

&lt;p&gt;PHP 5.6 will be the minimum version requirement for Aura 3.x packages. The packages will also be required to run on PHP 7 and HHVM to future-proof them as much as possible. I got this idea from Matthew Weier O’Phinney in his &lt;a href=&quot;https://www.youtube.com/watch?v=B7aSNUa1rJo&quot;&gt;ZF3 presentation&lt;/a&gt; (or is it ZF 2.5? ;-).&lt;/p&gt;

&lt;p&gt;Thus, Aura 3.x will not use PHP 7 features. Consider this a lesson-learned from Aura 1.x about getting on the latest-release bandwagon when we made 5.4 the minimum version too early. PHP 7 adoption will happen in 4.x and later releases.&lt;/p&gt;

&lt;p&gt;The PHP 5.5 and 5.6 feature list, though, is not too shabby: &lt;code class=&quot;highlighter-rouge&quot;&gt;yield&lt;/code&gt; generators, &lt;code class=&quot;highlighter-rouge&quot;&gt;finally&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;foreach ($items as list(...))&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;::class&lt;/code&gt;, constant expressions, variadic &lt;code class=&quot;highlighter-rouge&quot;&gt;...$args&lt;/code&gt; as function arguments, unpacking of &lt;code class=&quot;highlighter-rouge&quot;&gt;...$args&lt;/code&gt; arrays as arguments to functions, &lt;code class=&quot;highlighter-rouge&quot;&gt;use function&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;use const&lt;/code&gt;, phpdbg, and the &lt;code class=&quot;highlighter-rouge&quot;&gt;__debugInfo()&lt;/code&gt; magic method.&lt;/p&gt;

&lt;h3 id=&quot;dependency-restrictions-very-slightly-relaxed&quot;&gt;Dependency Restrictions Very Slightly Relaxed&lt;/h3&gt;

&lt;p&gt;In Aura 1.x, one design goal was complete independence and full decoupling of library packages, not only from a framework but also from each other. This meant that no library package had any dependencies at all. We continued that approach with library packages in Aura 2.x, while introducing Bundle, Kernel, and Project packages that did allow for dependencies.&lt;/p&gt;

&lt;p&gt;In Aura 3.x, we are going relax the library dependency restriction in exactly one aspect. Library packages in Aura 3.x will be allowed to depend on &lt;strong&gt;interface packages only&lt;/strong&gt;. This decision is motivated almost exclusively by the new PSR-7 “HTTP Messages” recommendation. PSR-7 presents a significant change in the PHP ecosystem, and Aura needs to be in a position to typehint against it; we can’t do that without a dependency on the PSR-7 interface.&lt;/p&gt;

&lt;p&gt;This decision is not without drawbacks. For example, any change in an interface package means a break for the package that depends on it. It also means the package that depends on an interface package can never have a stability greater than that interface package. However, with care and attention, I think this will be a positive change.&lt;/p&gt;

&lt;h3 id=&quot;provision-of-interface-packages&quot;&gt;Provision Of Interface Packages&lt;/h3&gt;

&lt;p&gt;With the allowance of interface package dependencies, Aura can then start splitting up its own offerings into interface and implementation packages. Not all packages will necessarily have an interface component, but where it makes sense, it can be now be afforded under the relaxed dependency restrictions.&lt;/p&gt;

&lt;p&gt;I first saw the idea of separate implementation and interface packages in the Laravel world, although the Aura variation will be on a package-by-package basis (as vs collecting all interfaces into a single package). The interface packages will be named with a &lt;code class=&quot;highlighter-rouge&quot;&gt;*_Interfaces&lt;/code&gt; suffix, similar to the way 2.x Bundles are named &lt;code class=&quot;highlighter-rouge&quot;&gt;*_Bundle&lt;/code&gt;.&lt;/p&gt;

&lt;h3 id=&quot;ecosystem-dependency-on-composer&quot;&gt;Ecosystem Dependency on Composer&lt;/h3&gt;

&lt;p&gt;In Aura 1.x and 2.x, each package provided some means of including the library source and test files independent of external autoloaders. Now that Composer is near ubiquitous, I think it’s no longer necessary to provide independent autoloading. Thus, 3.x packages will have an ecosystem dependency on Composer for autoloading of source and test classes. (This is similar to their ecosystem dependency on PHPUnit for testing.)&lt;/p&gt;

&lt;h3 id=&quot;change-license-from-bsd-to-mit&quot;&gt;Change License From BSD to MIT&lt;/h3&gt;

&lt;p&gt;Aura 2.x and 1.x (and Solar before that) have used the various BSD licenses (New, 2-Clause, etc).  Whereas it seems that the MIT license has become far more popular in the PHP world, Aura 3.x will move to the MIT license as well, to maximize license compatibility and minimize license-mixing confusion.&lt;/p&gt;

&lt;h3 id=&quot;no-more-framework-under-the-aura-name&quot;&gt;No More Framework Under The Aura Name&lt;/h3&gt;

&lt;p&gt;Aura 3.x will not provide a user-interface framework, whether for the web or for the command line, under the Aura name. I expect that 3.x packages will be able to work inside 2.x projects, provided that the PHP versions are recent enough.&lt;/p&gt;

&lt;p&gt;This was a hard decision for me. It is motivated by my impression that user-interface frameworks are becoming less important, mostly because they are becoming easier to implement with mix-and-match component packages. It takes very little to string together a DI container or Service Locator, a Router, a Dispatcher, and an HTTP sender these days. Indeed, with the advent of a single-action controllers (a la Action-Domain-Responder and microframeworks), UI-independent Domain frameworks, and middleware-style approaches, a “framework” does not seem to be that big a deal any more.&lt;/p&gt;

&lt;p&gt;While a user-interface framework is still &lt;em&gt;necessary&lt;/em&gt;, it’s not going to be a focus of Aura 3.x development per se. I fully expect to build web and command-line frameworks using Aura 3.x packages, just not under the Aura banner. It is additionally my hope that by not claiming an “official” Aura framework, others will feel more inclined to build their own frameworks using Aura packages, in their own way and concentrating on their own preferences.&lt;/p&gt;

&lt;h3 id=&quot;removal-of-library-config-files&quot;&gt;Removal of Library Config Files&lt;/h3&gt;

&lt;p&gt;As a result of not providing a framework with Aura 3.x, the &lt;code class=&quot;highlighter-rouge&quot;&gt;config/&lt;/code&gt; files in library packages intended to ease DI configuration at the Aura framework level will disappear.  These were present only with libraries that had particularly involved object-creation steps.&lt;/p&gt;

&lt;p&gt;In Aura 3.x, complex object creation and configuration will be handled by Factories, Builders, or perhaps even library-specific Containers.  These objects will themselves be configurable, so that they can be manipulated by any DI container or Service Locator. (I expect that “provider” packages will spring up to ease integration into different framework ecosystems.)&lt;/p&gt;

&lt;h3 id=&quot;beyond-3x-or-a-version-is-just-a-number&quot;&gt;Beyond 3.x; or, A Version Is Just A Number&lt;/h3&gt;

&lt;p&gt;With Aura 1.x and 2.x, I tried to keep the packages all under the same major version number. The version number did additional duty by indicating an expected package structure. With Aura 3.x, we are going to try to adhere more closely to the spirit of &lt;a href=&quot;http://semver.org&quot;&gt;Semantic Versioning&lt;/a&gt;, where a major version number indicates only a backward compatibility break, and nothing else.&lt;/p&gt;

&lt;p&gt;This means that there may be 4.x or 5.x releases in one package, while others stays at 3.x. The implication for PHP 7 adoption is that 4.x in one package may use PHP 7 features, while another package may not get them until 5.x.&lt;/p&gt;

&lt;p&gt;This continues the Aura history of decoupling as much as possible from other packages. With this approach, the packages will not even be coupled in their major release cycles.&lt;/p&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;That is all for now. I am of course interested to hear comments, concerns, criticism, and feedback – leave them below!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>PHP World Releases!</title>
   <link href="http://auraphp.com/blog/2014/11/11/phpworld-releases/"/>
   <updated>2014-11-11T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2014/11/11/phpworld-releases</id>
   <content type="html">&lt;p&gt;This release is to remind about the &lt;a href=&quot;http://world.phparch.com/&quot;&gt;phpworld&lt;/a&gt; conference happening at Washington DC. If you are there &lt;a href=&quot;http://paul-m-jones.com&quot;&gt;Paul M Jones&lt;/a&gt;, the creator and lead on Aura, is giving talks on &lt;a href=&quot;http://mlaphp.com/&quot;&gt;It Was Like That When I Got Here: Steps Toward Modernizing a Legacy Codebase&lt;/a&gt; and &lt;a href=&quot;https://pmjones.github.io/adr&quot;&gt;Action-Domain-Responder: A Web-Specific Refinement of MVC&lt;/a&gt;. Check out the &lt;a href=&quot;http://world.phparch.com/speakers/#49998&quot;&gt;schedule&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;releases&quot;&gt;Releases&lt;/h2&gt;

&lt;p&gt;Many of the Aura libraries got quick releases. It was busy days that we couldn’t blog each one seprately. So here is a quick update on what is happening.&lt;/p&gt;

&lt;h3 id=&quot;auraaccept&quot;&gt;Aura.Accept&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Accept/releases/tag/2.0.0&quot;&gt;Aura.Accept&lt;/a&gt; as extracted from &lt;a href=&quot;https://github.com/auraphp/Aura.Accept&quot;&gt;Aura.Web&lt;/a&gt; got stable release.&lt;/p&gt;

&lt;p&gt;An example how you could make use of content-negotiation is shown below.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// assume the request indicates these Accept values (XML is best, then CSV,
// then anything else)
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$_SERVER&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'HTTP_ACCEPT'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'application/xml;q=1.0,text/csv;q=0.5,*;q=0.1'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// create the accept factory
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$accept_factory&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;AcceptFactory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$_SERVER&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// create the accept object
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$accept&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$accept_factory&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;newInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// assume our application has `application/json` and `text/csv` available
// as media types, in order of highest-to-lowest preference for delivery
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$available&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;s1&quot;&gt;'application/json'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s1&quot;&gt;'text/csv'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// get the best match between what the request finds acceptable and what we
// have available; the result in this case is 'text/csv'
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$media&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$accept&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;negotiateMedia&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$available&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$media&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getValue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;//&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;csv&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Consider looking into the docs &lt;a href=&quot;https://github.com/auraphp/Aura.Accept/blob/2.0.0/README.md#instantiation&quot;&gt;for more information&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;auradi&quot;&gt;Aura.Di&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Di/releases/tag/2.1.0&quot;&gt;Aura.Di&lt;/a&gt; released 2.1.0 which incorporates functionality to optionally disable auto-resolution. By default it remains enabled, but this default may change in a future version. This is regarding the &lt;a href=&quot;https://github.com/auraphp/Aura.Di/issues/68&quot;&gt;issue 68&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Add Container::setAutoResolve(), Factory::setAutoResolve(), etc. to allow disabling of auto-resolution&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;When auto-resolution is disabled, Factory::newInstance() now throws Exception\MissingParam when a constructor param has not been defined&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;ContainerBuilder::newInstance() now takes a third param to enable/disable auto-resolution&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;AbstractContainerTest now allows you to enable/disable auto-resolve for the tests via a new getAutoResolve() method&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Consider looking into the docs &lt;a href=&quot;https://github.com/auraphp/Aura.Di/blob/2.1.0/README.md#a-note-about-auto-resolution&quot;&gt;for more information&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;auraauth&quot;&gt;Aura.Auth&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Auth/releases/tag/2.0.0-beta2&quot;&gt;Aura.Auth&lt;/a&gt; released beta-2.&lt;/p&gt;

&lt;p&gt;The &lt;code class=&quot;highlighter-rouge&quot;&gt;PdoAdapter::buildSelectWhere()&lt;/code&gt; now honors the custom column name provided by the user.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$auth_factory&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;\Aura\Auth\AuthFactory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$_COOKIE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$pdo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;\PDO&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$hash&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;PasswordVerifier&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;PASSWORD_BCRYPT&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$cols&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'username'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'md5password'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$from&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'accounts'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$pdo_adapter&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$auth_factory&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;newPdoAdapter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$pdo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$hash&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$cols&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$from&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;How to make use of &lt;a href=&quot;https://github.com/auraphp/Aura.Auth/tree/2.0.0-beta2#oauth-adapters&quot;&gt;OAuth Adapters&lt;/a&gt; is documented. Thanks to &lt;a href=&quot;https://github.com/mfrost503&quot;&gt;Frost&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before it is too late please give your feedback on &lt;a href=&quot;https://github.com/auraphp/Aura.Auth/issues/4&quot;&gt;remember me functionality&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;aurarouter&quot;&gt;Aura.Router&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Router/releases&quot;&gt;Aura.Router&lt;/a&gt; getting more awesome!&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;2.1.0 : Added Router::generateRaw() to generate routes with raw data.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;2.1.1 : Fixed allow simplest possible match of a single Accept header type without a Q value.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Router/releases/tag/2.2.0&quot;&gt;2.2.0&lt;/a&gt; : Allow easier specification of $values[‘action’] directly from RouteCollection::add*() by passing a third param as the action value.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$router&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;s1&quot;&gt;'say_hello'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s1&quot;&gt;'/hello/{name}'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// Do the needful escaping
&lt;/span&gt;        &lt;span class=&quot;k&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Hello &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'name'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;auraproject_kernel&quot;&gt;Aura.Project_Kernel&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Project_Kernel/releases/tag/2.1.0&quot;&gt;Aura.Project_Kernel&lt;/a&gt; now have &lt;code class=&quot;highlighter-rouge&quot;&gt;Factory::newKernel()&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;Factory::newContainer()&lt;/code&gt; have an added param, &lt;code class=&quot;highlighter-rouge&quot;&gt;$auto_resolve&lt;/code&gt;, to allow you enable/disable auto-resolution in the container.&lt;/p&gt;

&lt;h3 id=&quot;other-releases&quot;&gt;Other Releases&lt;/h3&gt;

&lt;p&gt;Other libraries that got doc update, turn off auto-resolution in tests and other minor issues fixed are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Cli_Kernel/releases/tag/2.0.1&quot;&gt;Aura.Cli_Kernel&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Web_Kernel/releases/tag/2.0.1&quot;&gt;Aura.Web_Kernel&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Cli/releases/tag/2.0.1&quot;&gt;Aura.Cli&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Html/releases/tag/2.1.1&quot;&gt;Aura.Html&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Session/releases/tag/2.0.0-beta2&quot;&gt;Aura.Session&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.View/releases/tag/2.0.1&quot;&gt;Aura.View&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Web/releases/tag/2.0.1&quot;&gt;Aura.Web&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;framework-documentation&quot;&gt;Framework documentation&lt;/h2&gt;

&lt;p&gt;Added &lt;a href=&quot;http://auraphp.com/framework/2.x/en/quick-start/&quot;&gt;Quick start tutorial&lt;/a&gt; without database connectivity for Version 2. The  &lt;a href=&quot;http://auraphp.com/framework/2.x/en/&quot;&gt;framework documentation&lt;/a&gt; has been updated. If you find something missing open an issue or &lt;a href=&quot;https://github.com/auraphp/auraphp.github.com/tree/master/framework/2.x/en&quot;&gt;send pull requests&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;other-tutorials&quot;&gt;Other tutorials&lt;/h2&gt;

&lt;p&gt;Some were confused on the usage of Aura.View and Aura.Html so we have  &lt;a href=&quot;https://github.com/harikt/AuraViewExample&quot;&gt;https://github.com/harikt/AuraViewExample&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How to make use of Aura.Router and Aura.Dispatcher &lt;a href=&quot;https://github.com/harikt/router-dispatcher&quot;&gt;https://github.com/harikt/router-dispatcher&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;Thanks to &lt;a href=&quot;http://auraphp.com/community&quot;&gt;the many contributors in the Aura community&lt;/a&gt; who made these releases possible!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>First 2.0 Stable Project Releases!</title>
   <link href="http://auraphp.com/blog/2014/10/05/stable-project-releases/"/>
   <updated>2014-10-05T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2014/10/05/stable-project-releases</id>
   <content type="html">&lt;p&gt;Exciting news! After a little over a year in the making, the Aura web and CLI project packages saw their first stable 2.0 releases this weekend.  This is a major milestone for Aura, as it means not just the core libraries but also the frameworks built from them are now complete.&lt;/p&gt;

&lt;p&gt;Because Aura takes a “libraries first, framework second” approach, the project packages had to wait for the following 2.0 stable releases of these core libraries yesterday:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Di&quot;&gt;Aura.Di&lt;/a&gt; (a dependency injection container)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Web&quot;&gt;Aura.Web&lt;/a&gt; (web request/response objects, and a response sender)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once those were stable, it was not much trouble to promote the various kernels and project skeletons to stable as well:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Project_Kernel&quot;&gt;Aura.Project_Kernel&lt;/a&gt; (the kernel files for every Aura project type)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Cli_Kernel&quot;&gt;Aura.Cli_Kernel&lt;/a&gt; (the kernel files for CLI projects)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Web_Kernel&quot;&gt;Aura.Web_Kernel&lt;/a&gt; (the kernel files for web projects)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Cli_Project&quot;&gt;Aura.Cli_Project&lt;/a&gt; (a skeleton CLI project)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Web_Project&quot;&gt;Aura.Web_Project&lt;/a&gt; (a skeleton web project)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Framework_Project&quot;&gt;Aura.Framework_Project&lt;/a&gt; (a skeleton cli+web project)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;(Unlike Aura library packages, which have no dependencies because they are completely decoupled from each other, the &lt;code class=&quot;highlighter-rouge&quot;&gt;*_Kernel&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;*_Project&lt;/code&gt; packages &lt;em&gt;do&lt;/em&gt; have dependencies, as they are compositions of library and other packages.)&lt;/p&gt;

&lt;p&gt;These project releases means that you can now start a new, stable Aura project using Composer. For example, the following will create a &lt;code class=&quot;highlighter-rouge&quot;&gt;myproject/&lt;/code&gt; folder with an Aura installation ready-to-go for you:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;composer create-project aura/web-project myproject
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;other-releases&quot;&gt;Other Releases&lt;/h3&gt;

&lt;p&gt;In related news, we released stable 2.0 versions of &lt;a href=&quot;https://github.com/auraphp/Aura.Autoload&quot;&gt;Aura.Autoload&lt;/a&gt; and &lt;a href=&quot;https://github.com/auraphp/Aura.Includer&quot;&gt;Aura.Includer&lt;/a&gt;, since they have had no changes in several months. (These were initially thought to be core components for the project packages, but it turns out they were not needed.)&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/auraphp/Aura.Accept&quot;&gt;Aura.Accept&lt;/a&gt; package saw its first beta release today as well. Aura.Accept was extracted from Aura.Web so that content-negotiation behavior could be used separately from the Aura.Web Request and Response objects, such as in a Responder or other presentation mechanism. As the behaviors have not changed much in the extraction, we expect this package to see a stable release relatively soon.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/auraphp/Aura.Auth&quot;&gt;Aura.Auth&lt;/a&gt; package also got its first beta release. There’s still some work to be done here, notably regarding a “remember me” feature, and perhaps some additional LDAP behaviors.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/auraphp/Aura.Router&quot;&gt;Aura.Router&lt;/a&gt; package got bumped to 2.1.0 as it has a new method, &lt;code class=&quot;highlighter-rouge&quot;&gt;generateRaw()&lt;/code&gt;, to generate routes with raw data.&lt;/p&gt;

&lt;p&gt;Finally, we updated &lt;a href=&quot;https://github.com/auraphp/Aura.Html&quot;&gt;Aura.Html&lt;/a&gt; to 2.1.0 to reflect a change in the service names it presents through an Aura project DI container. If you’re using Aura.Html independent of an Aura.Di container builder, these changes should not affect you at all.&lt;/p&gt;

&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;Thanks to &lt;a href=&quot;http://auraphp.com/community&quot;&gt;the many contributors in the Aura community&lt;/a&gt; who made these releases possible!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>A Round Of New Releases</title>
   <link href="http://auraphp.com/blog/2014/09/03/new-releases/"/>
   <updated>2014-09-03T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2014/09/03/new-releases</id>
   <content type="html">&lt;p&gt;Over the past 10 days or so, we’ve been working on getting out new releases of the v2 and v1 packages. Here’s the story.&lt;/p&gt;

&lt;p&gt;First, we have brand new 2.0.0 stable releases of these v2 packages!&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Dispatcher/releases&quot;&gt;Aura.Dispatcher&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Router/releases&quot;&gt;Aura.Router&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Cli/releases&quot;&gt;Aura.Cli&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.View/releases&quot;&gt;Aura.View&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Html/releases&quot;&gt;Aura.Html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next, the Aura.Di package just got bumped to 2.0.0-beta2. This package in particular has seen some great new improvements, most notably auto-resolution of typehinted constructor parameters, and a brand-new README. Check it out at &lt;a href=&quot;https://github.com/auraphp/Aura.Di&quot;&gt;https://github.com/auraphp/Aura.Di&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We have our first release of Aura.Session v2 as 2.0.0-beta1. You can see it at &lt;a href=&quot;https://github.com/auraphp/Aura.Session&quot;&gt;https://github.com/auraphp/Aura.Session&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Also, we have updated stable releases of these packages with some feature additions:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Sql/releases&quot;&gt;Aura.Sql 2.1.0&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.SqlQuery/releases&quot;&gt;Aura.SqlQuery 2.1.0&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, some of the v1 packages needed to have v2 config classes either added or fixed. As a result, we now have these new v1 package releases:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Aura.Filter 1.0.2&lt;/li&gt;
  &lt;li&gt;Aura.Input 1.1.2&lt;/li&gt;
  &lt;li&gt;Aura.Intl 1.1.1&lt;/li&gt;
  &lt;li&gt;Aura.Marshal 1.2.2&lt;/li&gt;
  &lt;li&gt;Aura.Signal 1.0.4&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s all for now!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>An Updated Preview Of Aura.Auth</title>
   <link href="http://auraphp.com/blog/2014/06/26/auth-preview/"/>
   <updated>2014-06-26T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2014/06/26/auth-preview</id>
   <content type="html">&lt;p&gt;A couple of weeks ago I started porting &lt;a href=&quot;https://github.com/solarphp/core/tree/master/Solar/Auth&quot;&gt;Solar_Auth&lt;/a&gt; to an Aura v2 package, &lt;a href=&quot;https://github.com/auraphp/Aura.Auth&quot;&gt;Aura.Auth&lt;/a&gt;. It can be difficult to find a truly standalone, authentication-only library, and Aura.Auth fits that bill.&lt;/p&gt;

&lt;p&gt;The library is still under development, but the major pieces are all now in place:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;a &lt;a href=&quot;https://github.com/auraphp/Aura.Auth#instantiation&quot;&gt;state-tracking object&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Auth#services&quot;&gt;services&lt;/a&gt; for login, logout, and resuming sessions&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;adapters for &lt;a href=&quot;https://github.com/auraphp/Aura.Auth#htpasswd-adapter&quot;&gt;htpasswd&lt;/a&gt; and &lt;a href=&quot;https://github.com/auraphp/Aura.Auth#pdo-adapter&quot;&gt;PDO&lt;/a&gt; backends&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Auth#service-idioms&quot;&gt;service integration idioms&lt;/a&gt; (including HTTP &lt;code class=&quot;highlighter-rouge&quot;&gt;Authorization: Basic&lt;/code&gt; login integration)&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Auth#session-management&quot;&gt;native session management&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each layer can handle custom implementations. There are instructions for &lt;a href=&quot;https://github.com/auraphp/Aura.Auth#custom-adapters&quot;&gt;custom adapters&lt;/a&gt;, &lt;a href=&quot;https://github.com/auraphp/Aura.Auth#custom-sessions&quot;&gt;custom session managers&lt;/a&gt; (including &lt;a href=&quot;https://github.com/auraphp/Aura.Auth#working-without-sessions&quot;&gt;session-less authentication&lt;/a&gt;), and &lt;a href=&quot;https://github.com/auraphp/Aura.Auth#custom-services&quot;&gt;custom services&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Note that the library is purposely limited in scope. It does not do roles, groups, access control, or account management. You give it some credentials, it tells you if the credentials are valid or not, and starts/stops sessions.&lt;/p&gt;

&lt;p&gt;As with all Aura libraries, &lt;a href=&quot;https://github.com/auraphp/Aura.Auth#quality&quot;&gt;the measurable code quality is very high&lt;/a&gt;. It has 100% test coverage, is fully decoupled from all other libraries, and scores very well on Scrutinizer-CI. It is PHP 5.3 compatible, although if you want to use the new and more-secure &lt;a href=&quot;http://php.net/password_hash&quot;&gt;password_hash()&lt;/a&gt; functionality, you will need PHP 5.5 (or a userland implementation such as &lt;a href=&quot;https://github.com/ircmaxell/password_compat&quot;&gt;ircmaxell/password-compat&lt;/a&gt;.)&lt;/p&gt;

&lt;p&gt;If you are interested in the project, try it out and get in your suggestions on what’s needed.  We already have a &lt;a href=&quot;https://github.com/auraphp/Aura.Auth/blob/2.x/TODO.md&quot;&gt;TODO&lt;/a&gt; list, but there may be things we haven’t thought of. Now is the time to make your voice heard – and, of course, pull requests are always welcome for review.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Aura.SqlQuery v2 Stable Release</title>
   <link href="http://auraphp.com/blog/2014/06/09/sqlquery-v2-stable/"/>
   <updated>2014-06-09T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2014/06/09/sqlquery-v2-stable</id>
   <content type="html">&lt;p&gt;We released a stable version of &lt;a href=&quot;https://github.com/auraphp/Aura.Sql&quot;&gt;Aura.Sql v2&lt;/a&gt; a couple of months ago, and as of today its sister package &lt;a href=&quot;https://github.com/auraphp/Aura.SqlQuery&quot;&gt;Aura.SqlQuery&lt;/a&gt; is at &lt;a href=&quot;https://github.com/auraphp/Aura.SqlQuery/releases&quot;&gt;2.0.0 stable&lt;/a&gt; as well!&lt;/p&gt;

&lt;p&gt;Aura.SqlQuery provides provides a truly independent, fully decoupled package of query-building tools for PHP 5.3 and up.  With it, you can use object-oriented techniques to create SELECT, INSERT, UPDATE, and DELETE queries. The package comes with a set of common base query objects, and provides specialized objects for &lt;a href=&quot;https://github.com/auraphp/Aura.SqlQuery#mysql-query-objects-mysql&quot;&gt;MySQL&lt;/a&gt;, &lt;a href=&quot;https://github.com/auraphp/Aura.SqlQuery#postgresql-query-objects-pgsql&quot;&gt;PostgreSQL&lt;/a&gt;, &lt;a href=&quot;https://github.com/auraphp/Aura.SqlQuery#sqlite-query-objects-sqlite&quot;&gt;SQLite&lt;/a&gt;, and &lt;a href=&quot;https://github.com/auraphp/Aura.SqlQuery#microsoft-sql-query-objects-sqlsrv&quot;&gt;Microsoft SQL Server&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;When we say “truly independent and fully decoupled” we really mean it. The SqlQuery package has no dependencies on any particular database connection system or abstraction layer.  For example, you can build a SELECT query, then pass the finished query string to a PDO connection, a mysql connection, or through the database abstraction layer of your choice. This means the package is suitable for any framework or application that needs a query-building mechanism.&lt;/p&gt;

&lt;p&gt;For more information and examples, be sure to take a look at the &lt;a href=&quot;https://github.com/auraphp/Aura.SqlQuery&quot;&gt;Aura.SqlQuery&lt;/a&gt; README. Download the package and try it today!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>A Round Of 1.x Releases</title>
   <link href="http://auraphp.com/blog/2014/06/02/new-1x-releases/"/>
   <updated>2014-06-02T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2014/06/02/new-1x-releases</id>
   <content type="html">&lt;p&gt;Even though we have begun a series of &lt;a href=&quot;http://auraphp.com/packages/v2&quot;&gt;Aura v2 packages&lt;/a&gt;, the 1.x versions do not languish. Over the weekend we released updated versions of &lt;a href=&quot;http://auraphp.com/packages&quot;&gt;every 1.x library&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Most of these were “hygiene” releases, with docblock updates, extra tests, and minor bug fixes. However, the &lt;a href=&quot;http://auraphp.com/packages/Aura.Router/&quot;&gt;Router&lt;/a&gt; has two new methods to append and prepend route collections, and the &lt;a href=&quot;http://auraphp.com/packages/Aura.Uri/&quot;&gt;Uri&lt;/a&gt; package adds support for schemeless URLs, ftp/ftps schemes, single label hosts, and an updated Public Suffix List.&lt;/p&gt;

&lt;p&gt;Many thanks to everyone who made these releases possible, especially to Hari KT for insisting on the need for hygiene releases, and to Jeremy Kendall for his work on the Uri package.&lt;/p&gt;

&lt;p&gt;We at Aura adhere to &lt;a href=&quot;http://semver.org&quot;&gt;Semantic Versioning&lt;/a&gt;; none of these releases have any backwards-compatibility breaks, so you should be able to update-in-place without any problems. Note also that each of these packages is completely independent and fully decoupled, so you can download and use one library without adding any further dependencies.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Aura.View 2.0.0-beta2 Released!</title>
   <link href="http://auraphp.com/blog/2014/05/29/view-2beta2/"/>
   <updated>2014-05-29T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2014/05/29/view-2beta2</id>
   <content type="html">&lt;p&gt;We have added a new feature &lt;a href=&quot;https://github.com/auraphp/Aura.View#using-sections&quot;&gt;“sections”&lt;/a&gt; to &lt;a href=&quot;https://github.com/auraphp/Aura.View&quot;&gt;Aura.View v2&lt;/a&gt; and released it as &lt;a href=&quot;https://github.com/auraphp/Aura.View/releases&quot;&gt;2.0.0-beta2&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This feature is due to the patient lobbying of Hari KT. He saw variations of it in &lt;a href=&quot;http://platesphp.com/templates/sections/&quot;&gt;Plates&lt;/a&gt; and &lt;a href=&quot;http://api.symfony.com/2.0/Symfony/Component/Templating/Helper/SlotsHelper.html&quot;&gt;Symfony&lt;/a&gt;, and figured it would be a nice bit of feature parity to add. He was right.&lt;/p&gt;

&lt;p&gt;It also involves a small BC-breaking change. Instead of assigning the inner view content to a template variable, we now store that content internally and expose it via a &lt;code class=&quot;highlighter-rouge&quot;&gt;getContent()&lt;/code&gt; method. So instead of &lt;code class=&quot;highlighter-rouge&quot;&gt;echo $this-&amp;gt;content_var_name&lt;/code&gt; to place the content in the layout, we now use &lt;code class=&quot;highlighter-rouge&quot;&gt;echo $this-&amp;gt;getContent()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Aura.View and Aura.Html 2.0.0-beta1 Released!</title>
   <link href="http://auraphp.com/blog/2014/05/15/view-html-2beta1/"/>
   <updated>2014-05-15T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2014/05/15/view-html-2beta1</id>
   <content type="html">&lt;p&gt;We have new v2 beta releases!&lt;/p&gt;

&lt;h3 id=&quot;auraview&quot;&gt;Aura.View&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.View&quot;&gt;Aura.View&lt;/a&gt; 2.0.0-beta1 is a reduced implementation of the v1 View package. It is notably different from v1 in several ways:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;The templates can still be include files, but (and this is new) they can also be closures. This means that you can completely avoid the file system for templates if you like. (We bind closures to the &lt;em&gt;View&lt;/em&gt; instance so you can use &lt;code class=&quot;highlighter-rouge&quot;&gt;$this&lt;/code&gt; from inside the closure to reference data, helpers, and so on.)&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;The library no longer searches through directory stacks/hierarchies for templates. Those kinds of file-system scan turned out to be fine in most cases, but in high-performance situations it becomes a drag on performance. The search stacks have been replaced with a &lt;em&gt;TemplateRegistry&lt;/em&gt; where you explicitly register templates by name. This involves more setup work but makes it easier to determine where the templates are coming from.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;The library does not auto-escape data for output any more. Auto-escaping seemed like a good idea for v1 but it turned out to be more trouble than it was worth. In fact, there are no escapers included at all any more (see below for more about that).&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;There are no longer any escapers or helpers included, although the package does include a bare-bones &lt;em&gt;HelperRegistry&lt;/em&gt; so you can add your own callables as helpers.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What? No escapers or helpers? Have no fear; they have not disappeared, they have only been moved into the Aura.Html package.&lt;/p&gt;

&lt;h3 id=&quot;aurahtml&quot;&gt;Aura.Html&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Html&quot;&gt;Aura.Html&lt;/a&gt; 2.0.0-beta1 contains a collection of helpers extracted from the v1 Aura.View package. These helpers are completely standalone and are not dependent on any particular view system: instantiate a &lt;em&gt;HelperLocator&lt;/em&gt; from the Aura.Html package and you can use the helpers from any PHP code.  As an example of the standalone nature of the Aura.Html helpers, &lt;a href=&quot;http://harikt.com/blog/2014/05/13/extending-plates-with-aura-html-helpers/&quot;&gt;Hari has shown how to integrate it&lt;/a&gt; with &lt;a href=&quot;http://platesphp.com&quot;&gt;Plates&lt;/a&gt; from Jonathan Reinink.&lt;/p&gt;

&lt;p&gt;And what a &lt;a href=&quot;https://github.com/auraphp/Aura.Html/blob/2.x/README-HELPERS.md&quot;&gt;set of helpers&lt;/a&gt;, especially the &lt;a href=&quot;https://github.com/auraphp/Aura.Html/blob/2.x/README-FORMS.md&quot;&gt;form helpers&lt;/a&gt;! All of the HTML5 input types are supported. This makes building form elements very easy, especially since the data structure for each element is just an array. Any library that can generate the recognized array structure can be used to feed the form input helpers. (Incidentally, &lt;a href=&quot;https://github.com/auraphp/Aura.Input&quot;&gt;Aura.Input&lt;/a&gt; generates the recognized structure.)&lt;/p&gt;

&lt;p&gt;In addition, the package includes &lt;a href=&quot;https://github.com/auraphp/Aura.Html#escaping&quot;&gt;a powerful escaping mechanism&lt;/a&gt; derived from Zend\Escaper and modified for conceptual integrity with the rest of Aura. The Aura.Html &lt;em&gt;Escaper&lt;/em&gt; exposes static methods to make escaping as non-verbose as possible. Place a &lt;code class=&quot;highlighter-rouge&quot;&gt;use Aura\Html\Escaper as e&lt;/code&gt; statement at the top of your PHP-based template file, and you can issue …&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;e::h()&lt;/code&gt; to escape HTML;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;e::a()&lt;/code&gt; to escape attributes, including arrays of attribute key-value pairs;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;e::c()&lt;/code&gt; to escape CSS; and&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;e::j()&lt;/code&gt; to escape JavaScript.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;(Normally in Aura we avoid static methods, but the verbosity tradeoff here was too good to ignore.)&lt;/p&gt;

&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;If you already have an project and all you need is a PHP-based template system, or if you already have a view system and all you need is some form helpers, then Aura is for you! Each package is completely decoupled from the others, meaning you can download just what you need and not worry about inter-library dependencies. Try &lt;a href=&quot;https://github.com/auraphp/Aura.View&quot;&gt;Aura.View&lt;/a&gt; and &lt;a href=&quot;https://github.com/auraphp/Aura.Html&quot;&gt;Aura.Html&lt;/a&gt; today!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>First v2 Beta Releases of Web_Project, Cli_Project, and Framework_Project</title>
   <link href="http://auraphp.com/blog/2014/04/17/project-beta-releases/"/>
   <updated>2014-04-17T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2014/04/17/project-beta-releases</id>
   <content type="html">&lt;p&gt;Earlier this week, we put the final touches on the “micro/macro” frameworks for &lt;a href=&quot;https://github.com/auraphp/Aura.Web_Project&quot;&gt;v2 web projects&lt;/a&gt; and &lt;a href=&quot;https://github.com/auraphp/Aura.Cli_Project&quot;&gt;v2 command line projects&lt;/a&gt;. Although these had been delayed a bit while working out the &lt;a href=&quot;https://github.com/auraphp/Aura.Di&quot;&gt;Aura.Di&lt;/a&gt; v2 beta release, they both now have their first “Google beta” releases!&lt;/p&gt;

&lt;h3 id=&quot;projects&quot;&gt;Projects&lt;/h3&gt;

&lt;p&gt;We have spoken before of &lt;a href=&quot;https://github.com/auraphp/Aura.Web_Project&quot;&gt;Aura.Web_Project&lt;/a&gt; as a &lt;a href=&quot;http://auraphp.com/blog/2013/12/12/aura-v2-web-project/&quot;&gt;“micro/macro” framework&lt;/a&gt;. The idea is that it starts as a very minimal system, with only router, dispatcher, request, and response functionality. But thanks to the &lt;a href=&quot;http://auraphp.com/blog/2014/04/07/two-stage-config/&quot;&gt;Composer-assisted configuration system&lt;/a&gt;, it’s very easy to add whatever functionality you want, making the project as large or as small as you need.  Installation is as easy as issuing &lt;code class=&quot;highlighter-rouge&quot;&gt;composer create-project -s beta aura/web-project&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;(https://github.com/auraphp/Aura.Cli_Project)&quot;&gt;Aura.Cli_Project&lt;/a&gt; takes exactly the same approach, but for command-line applications. It consists of a “context” and standard I/O system (the equivalents of a request and response), along with a console and dispatcher. It uses the same configuration system as Web_Project, so you start with a very minimal system that grows only as you need it. Getting started is as just as easy: &lt;code class=&quot;highlighter-rouge&quot;&gt;composer create-project -s beta aura/cli-project&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Finally, we have &lt;a href=&quot;(https://github.com/auraphp/Aura.Framework_Project)&quot;&gt;Aura.Framework_Project&lt;/a&gt;; it is a combination of both Web_Project and Cli_Project. That one installs just like the others:
&lt;code class=&quot;highlighter-rouge&quot;&gt;composer create-project -s beta aura/framework-project&lt;/code&gt;. The goal on the Framework_Project more extensive than with the other two; while they are more micro to begin with, the Framework_Project will eventually become more of a full-stack system.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;N.b.: Unlike Aura library packages, which are fully decoupled and independent from all other packages, the &lt;code class=&quot;highlighter-rouge&quot;&gt;*_Kernel&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;*_Project&lt;/code&gt; packages &lt;strong&gt;do&lt;/strong&gt; have dependencies. This is because their purpose is to combine other packages together.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;kernels&quot;&gt;Kernels&lt;/h3&gt;

&lt;p&gt;Each project is little more than a skeleton around a core “kernel” package. The &lt;a href=&quot;https://github.com/auraphp/Aura.Web_Kernel/tree/2.x/src&quot;&gt;Aura.Web_Kernel&lt;/a&gt; is what actually provides the glue to connect the underlying library packages together, as does the &lt;a href=&quot;https://github.com/auraphp/Aura.Cli_Kernel/tree/2.x/src&quot;&gt;Aura.Cli_Kernel&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Keeping the kernel separate from the project means we can update the kernel without having to re-install a project. The separation between kernel and project also makes it possible to combine or stack the kernel packages. For example, the web and CLI kernel packages depend on a the same underlying &lt;a href=&quot;https://github.com/auraphp/Aura.Project_Kernel&quot;&gt;Project_Kernel&lt;/a&gt; to handle the common task of configuration and setup.  Similarly, the Framework_Project uses both the web and CLI kernel packages together.&lt;/p&gt;

&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;If you are the kind of developer who wants to keep dependencies to a minimum, but still wants a little bit of architecture to start with, then &lt;a href=&quot;http://auraphp.com&quot;&gt;Aura&lt;/a&gt; fits the bill. Download individual library packages with no dependencies, or install a minimal project package and add only what you need. Try it out today!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Aura.Sql 2.0 Stable Released</title>
   <link href="http://auraphp.com/blog/2014/04/10/aura-sql-2-stable/"/>
   <updated>2014-04-10T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2014/04/10/aura-sql-2-stable</id>
   <content type="html">&lt;p&gt;Last week, we released &lt;a href=&quot;https://github.com/auraphp/Aura.Sql&quot;&gt;Aura.Sql&lt;/a&gt; v2 stable. Install it via Composer using &lt;code class=&quot;highlighter-rouge&quot;&gt;{&quot;require&quot;: {&quot;aura/sql&quot;: &quot;2.*&quot;}}&lt;/code&gt;, or download a package and read change notes on &lt;a href=&quot;https://github.com/auraphp/Aura.Sql/releases&quot;&gt;the releases page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you’re not already familiar with it, the Aura.Sql package primarily provides an &lt;em&gt;ExtendedPdo&lt;/em&gt; object with convenience functions extended from &lt;em&gt;PDO&lt;/em&gt;. This means your existing &lt;em&gt;PDO&lt;/em&gt;-typehinted code can take an &lt;em&gt;ExtendedPdo&lt;/em&gt; object directly. As with all other Aura libraries, it has 100% unit test coverage, and is completely decoupled from all other packages, having no additional dependencies.&lt;/p&gt;

&lt;p&gt;Unfortunately, this stable release has a few BC breaks from the “Google beta” release before it:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Previously, the ExtendedPdo object itself would retain values to bind against the next query. After discussion with interested parties, notably Rasmus Schultz, I was convinced that it was too much of a departure from normal PDO semantics.&lt;/p&gt;

  &lt;p&gt;Thus, the collection of values for binding has been removed. The methods query(), exec(), and prepare() no longer take bound values directly. Instead,we have a new method perform() that acts like query() but takes an array of values to bind at query time. We also have a new method prepareWithValues() that prepares a statement and binds values at that time. Finally, the new method fetchAffected() acts like exec(), but with bind values passed at the time of calling (just like with the other fetch*() methods).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But we have a new feature as well thanks to Stan Lemon. If you have an existing PDO instance, you can pass it to the &lt;em&gt;ExtendedPdo&lt;/em&gt; constructor to decorate the existing instance with the extended behaviors. This can help in in transitional situations.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Composer-Assisted Two-Stage Configuration</title>
   <link href="http://auraphp.com/blog/2014/04/07/two-stage-config/"/>
   <updated>2014-04-07T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2014/04/07/two-stage-config</id>
   <content type="html">&lt;p&gt;One of the design choices for configuration in &lt;a href=&quot;http://solarphp.com&quot;&gt;Solar&lt;/a&gt;, and later in &lt;a href=&quot;http://auraphp.com/framework&quot;&gt;the Aura v1 framework&lt;/a&gt;, was that all values were inteded to be passed at construction time. If you wanted to set up a router, for example, you would create an array structure to define all the routes, and then the DI container would pass that structure as a constructor param when creating the router object.&lt;/p&gt;

&lt;p&gt;In a most situations, config via constructor param is perfectly reasonable.  Unfortunately, there are some times where it’s not as practical as I would like. It can feel clumsy setting up these kinds of huge data structures, such as for a router system. We wanted to find a solution to these less frequent but still necessary setup situations, perhaps using a programmatic approach.&lt;/p&gt;

&lt;p&gt;The problem is that programmatic setup of foundational components can itself be a little clunky. The solution I see most often for this is to use static methods on the target object; for example, &lt;code class=&quot;highlighter-rouge&quot;&gt;Router::add()&lt;/code&gt; to map a new route. In Aura, static methods are a design approach that we consciously avoid. We want to keep good scope separation at all times, and make all dependencies explicit. Statics are not congruent with those goals.&lt;/p&gt;

&lt;h3 id=&quot;two-stage-config&quot;&gt;Two-Stage Config&lt;/h3&gt;

&lt;p&gt;After a long period of consideration, research, and experiment, we have found a non-static solution for programmatic configuration through a DI container. It is part of a two-stage configuration process, implemented through a &lt;a href=&quot;https://github.com/auraphp/Aura.Di/blob/bb309817b23fce9c119f850c0e943426cbff8c9e/src/ContainerBuilder.php&quot;&gt;&lt;em&gt;ContainerBuilder&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The two stages are “define” and “modify”:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;In the “define” stage, the &lt;em&gt;Config&lt;/em&gt; object defines constructor params, setter method values, and services. This is the equivalent of the previous single-stage Solar and Aura v1 configuration system.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;The &lt;em&gt;ContainerBuilder&lt;/em&gt; then locks the &lt;em&gt;Container&lt;/em&gt; so that its definitions cannot be changed, and then begins the “modify” stage. In this second stage, we retrieve service objects from the &lt;em&gt;Container&lt;/em&gt; and modify them programmatically.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;classes-not-includes&quot;&gt;Classes, Not Includes&lt;/h3&gt;

&lt;p&gt;We originally tried do this define-and-modify process with include files, as is usually the case with configuration approaches. With this approach, we needed two config files (&lt;code class=&quot;highlighter-rouge&quot;&gt;define.php&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;modify.php&lt;/code&gt;) for each configuration mode. We also needed an &lt;a href=&quot;https://github.com/auraphp/Aura.Includer&quot;&gt;Aura.Includer&lt;/a&gt; to scan the file system in predefined locations for the config file pairs for each installed package.&lt;/p&gt;

&lt;p&gt;However, that include-oriented approach never felt quite right. A couple of weeks ago it occurred to me that we could use classes for the two-stage config operations. This would allow for autoloading, independent testing, a smaller number of files, and a host of other subtle quality improvements. This led to the creation of the &lt;a href=&quot;https://github.com/auraphp/Aura.Di/blob/bb309817b23fce9c119f850c0e943426cbff8c9e/src/Config.php&quot;&gt;&lt;em&gt;Config&lt;/em&gt;&lt;/a&gt; class, which is now part of the Aura.Di v2 package.&lt;/p&gt;

&lt;p&gt;So now, instead of each Aura package carrying a pair of define and modify includes in a subdirectory named for the config mode, we have a single class file for each config mode. The class file is in a subnamespace &lt;code class=&quot;highlighter-rouge&quot;&gt;_Config&lt;/code&gt; under the package namespace. Here are two examples, one from the &lt;a href=&quot;https://github.com/auraphp/Aura.Web_Kernel/blob/1cf523ce1e90d111aa691b3cd29b150aa8e057e6/config/Common.php&quot;&gt;Aura.Web_Kernel&lt;/a&gt; package, and one from the &lt;a href=&quot;https://github.com/auraphp/Aura.Web_Project/blob/34755dd5f1e67ade59edf49e69f715ad41cdceff/config/Common.php&quot;&gt;Aura.Web_Project&lt;/a&gt; package.&lt;/p&gt;

&lt;p&gt;Because they are classes, you can call other methods as needed, subclass or inherit, use traits, create instance properties and local variables for configuration logic, and so on. You could even call &lt;code class=&quot;highlighter-rouge&quot;&gt;include&lt;/code&gt; in the methods if you wanted, keeping the class as a scaffold for much larger configuration files. This gives great flexibility to the confguration system.&lt;/p&gt;

&lt;h3 id=&quot;composer-assistance&quot;&gt;Composer Assistance&lt;/h3&gt;

&lt;p&gt;None of this is any good if the application cannot find and load the configuraiton logic.  To make sure the Aura project installation can find all the package config files, we use the &lt;code class=&quot;highlighter-rouge&quot;&gt;{&quot;extra&quot;: {&quot;aura&quot;: { ... } } }&lt;/code&gt; elements of the &lt;code class=&quot;highlighter-rouge&quot;&gt;composer.json&lt;/code&gt; in each package to provide a mapping from the config mode to the config class. As &lt;a href=&quot;https://github.com/auraphp/Aura.Cli/blob/7c15b148248ee8370f07374b493d128a84afc9e0/composer.json#L24-L40&quot;&gt;this example from Aura.Cli&lt;/a&gt; shows, we accomplish this in two parts:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Create a PSR-4 entry for the &lt;code class=&quot;highlighter-rouge&quot;&gt;Aura\Cli\_Config&lt;/code&gt; namespace that maps to the package &lt;code class=&quot;highlighter-rouge&quot;&gt;config/&lt;/code&gt; directory, and&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Create an entry for the config mode that maps to the &lt;em&gt;Config&lt;/em&gt; class for that mode.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is where the “extra” entry provided by Composer really shines. We can place critical project-level information in the &lt;code class=&quot;highlighter-rouge&quot;&gt;composer.json&lt;/code&gt; for each package under the “extra” entry, namespaced for “aura”. This information can be structured any way we like.&lt;/p&gt;

&lt;p&gt;We then inject the decoded JSON data from the project-level &lt;code class=&quot;highlighter-rouge&quot;&gt;composer.json&lt;/code&gt; along with the decoded JSON data from &lt;code class=&quot;highlighter-rouge&quot;&gt;vendor/composer/installed.json&lt;/code&gt; into our &lt;a href=&quot;https://github.com/auraphp/Aura.Project_Kernel/blob/1e938da37ba0378a2e6549d6f11570dffaa825f2/src/Project.php&quot;&gt;&lt;em&gt;Project&lt;/em&gt;&lt;/a&gt; service. Note that the &lt;em&gt;Project&lt;/em&gt; object does not read the Composer data itself; that data is &lt;a href=&quot;https://github.com/auraphp/Aura.Project_Kernel/blob/a95f4302772e69be85c578e3b59b0ed7ce49fb23/src/Factory.php&quot;&gt;injected at construction time&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Finally, we use &lt;a href=&quot;https://github.com/auraphp/Aura.Project_Kernel/blob/1e938da37ba0378a2e6549d6f11570dffaa825f2/src/Project.php#L155-L162&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;getConfigClasses()&lt;/code&gt;&lt;/a&gt; to get back that project-level information from the object, and use them to load our &lt;em&gt;ContainerBuilder&lt;/em&gt;.&lt;/p&gt;

&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;With this two-stage configuration mechanism, using classes instead of includes, and using Composer to map the config modes the to the config classes, we have the benefits of both a define-only config system &lt;em&gt;and&lt;/em&gt; a programmatic modification system. This gives us the best of both worlds, and helps us avoid resorting to static methods for configuration.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Aura.Marshal, A Database-less non-ORM</title>
   <link href="http://auraphp.com/blog/2014/02/17/aura-marshal/"/>
   <updated>2014-02-17T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2014/02/17/aura-marshal</id>
   <content type="html">&lt;p&gt;Today’s post is about &lt;a href=&quot;https://github.com/auraphp/Aura.Marshal&quot;&gt;Aura.Marshal&lt;/a&gt;, a database-independent tool that receives results from your data sources and marshals those result sets into domain model objects of your own design, preserving data relationships along the way.&lt;/p&gt;

&lt;p&gt;It’s probably not correct to call Aura.Marshal an object-relational manager. With ORMs proper like Doctrine and Propel, the ORM issues queries for you using an embedded or preferred database library.&lt;/p&gt;

&lt;p&gt;With Aura.Marshal, you use the data retrieval tools of your choice and write your own queries to retrieve data from a data source. You then &lt;a href=&quot;https://github.com/auraphp/Aura.Marshal#loading-data&quot;&gt;load the result data&lt;/a&gt; into an &lt;a href=&quot;https://github.com/auraphp/Aura.Marshal#defining-types&quot;&gt;entity type object&lt;/a&gt;, and the marshal &lt;a href=&quot;https://github.com/auraphp/Aura.Marshal#reading-data&quot;&gt;automatically wires up entity and collection objects&lt;/a&gt; for you based on a &lt;a href=&quot;https://github.com/auraphp/Aura.Marshal#defining-relationships&quot;&gt;relationship scheme&lt;/a&gt; you define for it.&lt;/p&gt;

&lt;p&gt;The great benefit of this approach is that it completely decouples the in-memory object wiring from the act of doing the queries in the first place.  The Marshal knows how to build and interrelate the objects, but it has no idea how to get the data for those objects in the first place.  Without the query-building stuff, the Marshal package turns out to be pretty light, comparatively speaking (only about 900 non-comment lines of source code, plus about 1300 lines of tests).&lt;/p&gt;

&lt;p&gt;Among other things, this means you can use any database abstraction layer of your choice (or no abstraction layer at all). Indeed, your data source can be anything at all, not just an SQL database. It could be CSV, XML, JSON, the results of an API call, a set of no-SQL documents, or any other format.  As long as the results can be represented as an array, Aura.Marshal can receive them and wire them up into objects for you.&lt;/p&gt;

&lt;p&gt;Because the Marshal does not issue queries on its own, it means a DBA can tune the data retrieval layer of your application to its most efficient use in plain old SQL if needed.  Of course, one of the drawbacks here is that someone on the team actually needs to know how to use SQL (or another data retrieval system of choice).  But for fine control over queries, as well as keeping good separation of concerns and minimizing the size of your dependency packages, Aura.Marshal is hard to beat.&lt;/p&gt;

&lt;p&gt;If you like clean code, fully decoupled libraries, and truly independent packages, then &lt;a href=&quot;http://auraphp.com&quot;&gt;the Aura project&lt;/a&gt; is for you. Download a single package and start using it in your project today, with no added dependencies. Also be sure to join the &lt;a href=&quot;http://groups.google.com/group/auraphp&quot;&gt;mailing list&lt;/a&gt; and check out the #auraphp IRC channel on Freenode!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Aura.Cli 2.0.0-beta1 Released</title>
   <link href="http://auraphp.com/blog/2014/01/11/aura-cli-2beta1/"/>
   <updated>2014-01-11T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2014/01/11/aura-cli-2beta1</id>
   <content type="html">&lt;p&gt;Starting this week’s “one release a day” series is the 2.0.0-beta1 release of &lt;a href=&quot;https://github.com/auraphp/Aura.Cli/tree/2.x&quot;&gt;Aura.Cli&lt;/a&gt;. You can &lt;a href=&quot;https://github.com/auraphp/Aura.Cli/releases&quot;&gt;download it&lt;/a&gt; directly or install via &lt;a href=&quot;https://packagist.org/packages/aura/cli&quot;&gt;Composer and Packagist&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The Aura.Cli package provides the command-line equivalents of web request and response objects. The &lt;a href=&quot;https://github.com/auraphp/Aura.Cli/tree/2.x#context-discovery&quot;&gt;&lt;em&gt;Context&lt;/em&gt;&lt;/a&gt; (request-equivalent) object allows insight into the &lt;code class=&quot;highlighter-rouge&quot;&gt;$_ENV&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;$_SERVER&lt;/code&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;$argv&lt;/code&gt; values, along with a &lt;a href=&quot;https://github.com/auraphp/Aura.Cli/tree/2.x#getopt-support&quot;&gt;&lt;em&gt;Getopt&lt;/em&gt;&lt;/a&gt; object that lets you build and then parse flags and options passed at the command line. The &lt;a href=&quot;https://github.com/auraphp/Aura.Cli/tree/2.x#standard-inputoutput-streams&quot;&gt;&lt;em&gt;Stdio&lt;/em&gt;&lt;/a&gt; (response-equivalent) object provides access to to the standard input/output/error streams.&lt;/p&gt;

&lt;p&gt;As with other Aura libraries, the Aura.Cli has a very narrow focus. Its purpose is not to provide a base object for commands or a console for exeucting commands, but instead to provide tools for you to use in your own command objects and scripts.  (Writing a &lt;a href=&quot;https://github.com/auraphp/Aura.Cli/tree/2.x#writing-commands&quot;&gt;standalone command script&lt;/a&gt; with Aura.Cli is pretty straightforward.)&lt;/p&gt;

&lt;p&gt;If you like clean code, fully decoupled libraries, and truly independent packages, then the Aura project is for you. You can download a single package and start using it in your project today, with no added dependencies.&lt;/p&gt;

&lt;p&gt;Be sure to join the &lt;a href=&quot;http://groups.google.com/group/auraphp&quot;&gt;mailing list&lt;/a&gt; and check out the #auraphp IRC channel on Freenode!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Aura.Sql_Schema 2.0.0-beta1 Released</title>
   <link href="http://auraphp.com/blog/2014/01/10/aura-sql-schema-2beta1/"/>
   <updated>2014-01-10T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2014/01/10/aura-sql-schema-2beta1</id>
   <content type="html">&lt;p&gt;Wrapping up this week’s “one release a day” series is the 2.0.0-beta1 release of &lt;a href=&quot;https://github.com/auraphp/Aura.Sql_Schema/tree/2.x&quot;&gt;Aura.Sql_Schema&lt;/a&gt;. You can &lt;a href=&quot;https://github.com/auraphp/Aura.Sql_Schema/releases&quot;&gt;download it&lt;/a&gt; directly or install via &lt;a href=&quot;https://packagist.org/packages/aura/sql-schema&quot;&gt;Composer and Packagist&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The Aura.Sql_Schema package contains PDO-based tools to read table and column information from a database.  If you already use PDO, or if your database abstraction layer of choice uses PDO under the hood, you can feed that PDO object to the &lt;em&gt;Schema&lt;/em&gt; object and start reading your table and column information.  (Because it is typehinted to PDO, this means the &lt;em&gt;Schema&lt;/em&gt; can use an &lt;a href=&quot;https://github.com/auraphp/Aura.Sql/tree/2.x&quot;&gt;Aura.Sql v2&lt;/a&gt; &lt;em&gt;ExtendedPdo&lt;/em&gt; object as well.)  The package supports MySQL, PostgreSQL, SQLite, and Microsoft SQL Server.&lt;/p&gt;

&lt;p&gt;If you like clean code, fully decoupled libraries, and truly independent packages, then the Aura project is for you. You can download a single package and start using it in your project today, with no added dependencies.&lt;/p&gt;

&lt;p&gt;Be sure to join the &lt;a href=&quot;http://groups.google.com/group/auraphp&quot;&gt;mailing list&lt;/a&gt; and check out the #auraphp IRC channel on Freenode!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Aura.Web 2.0.0-beta1 Released</title>
   <link href="http://auraphp.com/blog/2014/01/09/aura-web-2beta1/"/>
   <updated>2014-01-09T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2014/01/09/aura-web-2beta1</id>
   <content type="html">&lt;p&gt;Our “one release a day” series continues with the 2.0.0-beta1 release of &lt;a href=&quot;https://github.com/auraphp/Aura.Web/tree/2.x&quot;&gt;Aura.Web&lt;/a&gt;. You can &lt;a href=&quot;https://github.com/auraphp/Aura.Web/releases&quot;&gt;download it&lt;/a&gt; directly or install via &lt;a href=&quot;https://packagist.org/packages/aura/web&quot;&gt;Composer and Packagist&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Whereas the v1 package included controllers, renderers, and other
functionality, the v2 package provides only &lt;em&gt;Request&lt;/em&gt; and
&lt;em&gt;Response&lt;/em&gt; objects. These objects are independent of any particular controller
system, and independent of any specific HTTP delivery mechanism, which means
they can be used in any new or existing codebase without introducing other
dependencies. You can read more about the distillation of these concerns into separate packages &lt;a href=&quot;http://auraphp.com/blog/2013/11/11/aura-v2-web/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As a side note, you can see from the timing of these recent releases that Aura libraries are completely independent from each other.  There’s no subtree-split or extract-and-build-for-release processing; each library is completely contained in its own repository, making individual releases through &lt;a href=&quot;https://github.com/auraphp/bin/blob/master/Release2.php&quot;&gt;our admin script&lt;/a&gt; a trivial matter.&lt;/p&gt;

&lt;p&gt;If you like clean code, fully decoupled libraries, and truly independent packages, then the Aura project is for you. You can download a single package and start using it in your project today, with no added dependencies.&lt;/p&gt;

&lt;p&gt;Be sure to join the &lt;a href=&quot;http://groups.google.com/group/auraphp&quot;&gt;mailing list&lt;/a&gt; and check out the #auraphp IRC channel on Freenode!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Aura.Router 2.0.0-beta1 Released</title>
   <link href="http://auraphp.com/blog/2014/01/08/aura-router-2beta1/"/>
   <updated>2014-01-08T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2014/01/08/aura-router-2beta1</id>
   <content type="html">&lt;p&gt;Continuing our string of library package releases, today we have the 2.0.0-beta1 release of &lt;a href=&quot;https://github.com/auraphp/Aura.Router/tree/2.x&quot;&gt;Aura.Router&lt;/a&gt;. Given a URL path and a copy of &lt;code class=&quot;highlighter-rouge&quot;&gt;$_SERVER&lt;/code&gt;, it will extract path-info and &lt;code class=&quot;highlighter-rouge&quot;&gt;$_SERVER&lt;/code&gt; values for a specific route. You can &lt;a href=&quot;https://github.com/auraphp/Aura.Router/releases&quot;&gt;download it&lt;/a&gt; directly or install via &lt;a href=&quot;https://packagist.org/packages/aura/router&quot;&gt;Composer and Packagist&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The Aura.Router package does not provide a dispatching mechanism. Your application is expected to take the information provided by the matching route and dispatch to a controller on its own. You might do this with &lt;a href=&quot;https://github.com/auraphp/Aura.Dispatcher/tree/2.x&quot;&gt;Aura.Dispatcher&lt;/a&gt; or with &lt;a href=&quot;https://github.com/auraphp/Aura.Router/tree/2.x#dispatching-a-route&quot;&gt;some other system of your own devising&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In addition to all the standard stuff like adding routes and generating links, Aura.Router has some added conveniences:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Router/tree/2.x#optional-params&quot;&gt;Nice-looking “optional” params.&lt;/a&gt; To specify optional params, use a notation like &lt;code class=&quot;highlighter-rouge&quot;&gt;{/year,month,day}&lt;/code&gt; in the path. Optional params are sequentially optional. This means that, in the example, you cannot have a “day” without a “month”, and you cannot have a “month” without a “year”. If you generate a link with optional params, the params will be filled in if they are present in the data for the link.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Router/tree/2.x#attaching-route-groups&quot;&gt;Attaching route groups.&lt;/a&gt; You can add a series of routes all at once under a single “mount point” in your application via a closure.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Router/tree/2.x#attaching-rest-resource-routes&quot;&gt;Attaching REST resource routes.&lt;/a&gt; The router can attach a series of REST resource routes for you with the &lt;code class=&quot;highlighter-rouge&quot;&gt;attachResource()&lt;/code&gt; method. One call to that method with a resource name and base path will add named &lt;code class=&quot;highlighter-rouge&quot;&gt;browse&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;read&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;edit&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;add&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;delete&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;create&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;update&lt;/code&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;replace&lt;/code&gt; routes for you under that base path. Don’t like the defaults on those? Set your own resource attachment callback with &lt;code class=&quot;highlighter-rouge&quot;&gt;setResourceCallback()&lt;/code&gt;.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you like clean code, fully decoupled libraries, and truly independent packages, then the Aura project is for you. You can download a single package and start using it in your project today, with no added dependencies.&lt;/p&gt;

&lt;p&gt;Be sure to join the &lt;a href=&quot;http://groups.google.com/group/auraphp&quot;&gt;mailing list&lt;/a&gt; and check out the #auraphp IRC channel on Freenode!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Aura.Sql_Query 2.0.0-beta1 Released</title>
   <link href="http://auraphp.com/blog/2014/01/07/aura-sql-query-2beta1/"/>
   <updated>2014-01-07T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2014/01/07/aura-sql-query-2beta1</id>
   <content type="html">&lt;p&gt;We’re happy to announce the 2.0.0-beta1 release of &lt;a href=&quot;https://github.com/auraphp/Aura.Sql_Query/tree/2.x&quot;&gt;Aura.Sql_Query&lt;/a&gt;, a database-connection-independent query builder. You can &lt;a href=&quot;https://github.com/auraphp/Aura.Sql_Query/releases&quot;&gt;download it&lt;/a&gt; directly or install via &lt;a href=&quot;https://packagist.org/packages/aura/sql-query&quot;&gt;Composer and Packagist&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This is one of the packages that was extracted from the prior &lt;a href=&quot;https://github.com/auraphp/Aura.Sql/&quot;&gt;Aura.Sql v1&lt;/a&gt; package. There was some demand for keeping the database &lt;em&gt;connection&lt;/em&gt; portions separate from the &lt;em&gt;query builder&lt;/em&gt; (and other) portions, thus the splitting-up of the original v1 package.&lt;/p&gt;

&lt;p&gt;What’s interesting (to me anyway) is that originally, I didn’t think it would be possible to separate the two.  A query &lt;em&gt;builder&lt;/em&gt; seemed inextricable from a query &lt;em&gt;connection&lt;/em&gt;.  But it turned out to be possible, and the separation is pretty clean.  Check out the &lt;a href=&quot;https://github.com/auraphp/Aura.Sql_Query/tree/2.x&quot;&gt;README&lt;/a&gt; for examples.&lt;/p&gt;

&lt;p&gt;If you like clean code, fully decoupled libraries, and truly independent packages, then the Aura project is for you. You can download a single package and start using it in your project today, with no added dependencies.&lt;/p&gt;

&lt;p&gt;Be sure to join the &lt;a href=&quot;http://groups.google.com/group/auraphp&quot;&gt;mailing list&lt;/a&gt; and check out the #auraphp IRC channel on Freenode!&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Version 2 Beta Releases | Includer, Autoload, Sql, Dispatcher</title>
   <link href="http://auraphp.com/blog/2014/01/06/v2-beta-releases/"/>
   <updated>2014-01-06T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2014/01/06/v2-beta-releases</id>
   <content type="html">&lt;p&gt;In addition to the &lt;a href=&quot;http://auraphp.com/blog/2014/01/03/first-psr-4-autoloader/&quot;&gt;Aura.Autoload v2&lt;/a&gt; “Google Beta” release from last week, we have been releasing v2 beta versions of other packages as well:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Includer/tree/2.x&quot;&gt;Aura.Includer v2&lt;/a&gt; on Wed, 01 Jan 2014&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Autoload/tree/2.x&quot;&gt;Aura.Autoload v2&lt;/a&gt; on Thu, 02 Jan 2014&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Sql/tree/2.x&quot;&gt;Aura.Sql v2&lt;/a&gt; on Fri, 03 Jan 2014&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Dispatcher/tree/2.x&quot;&gt;Aura.Dispatcher v2&lt;/a&gt; on Mon, 06 Jan 2014&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hey, that looks like a pattern: one release per weekday of the new year. Who knows what tomorrow will bring?  Regardless, you can see continuing updates on our &lt;a href=&quot;/packages/v2&quot;&gt;v2 packages page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The new &lt;a href=&quot;http://developer.github.com/v3/repos/releases/&quot;&gt;Github releases API&lt;/a&gt; has been a real blessing here. Our &lt;a href=&quot;https://github.com/auraphp/bin/blob/master/Release2.php#L228-L248&quot;&gt;release2 admin script&lt;/a&gt; uses it to make the release directly from whatever branch we happen to be on at the time of release.  Because each Aura library package is completely self-contained, the release tool can run the tests, check composer.json, etc. very easily before it makes the release. (Non-library packages, which do have dependencies, have an additional &lt;code class=&quot;highlighter-rouge&quot;&gt;composer install&lt;/code&gt; step before the tests run.)&lt;/p&gt;

&lt;p&gt;Happy belated New Year to all, and many thanks to the Aura contributors who have made these releases possible!&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>First PSR-4 Autoloader Released | Aura.Autoload 2.0.0-beta1</title>
   <link href="http://auraphp.com/blog/2014/01/03/first-psr-4-autoloader/"/>
   <updated>2014-01-03T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2014/01/03/first-psr-4-autoloader</id>
   <content type="html">&lt;p&gt;I suppose it makes sense that since the the main author behind the &lt;a href=&quot;https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md&quot;&gt;PSR-4 Autoloader  recommendation&lt;/a&gt; is also the lead on the Aura project, that Aura would have the first PSR-4 implementation.  You can download it here …&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Autoload/releases/tag/2.0.0-beta1&quot;&gt;https://github.com/auraphp/Aura.Autoload/releases/tag/2.0.0-beta1&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;and you can find the README here (or in the download, of course):&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Autoload/tree/2.x&quot;&gt;https://github.com/auraphp/Aura.Autoload/tree/2.x&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I expect Composer will have support for PSR-4 soon as well.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; Well that didn’t take long: &lt;a href=&quot;http://seld.be/notes/psr-4-autoloading-support-in-composer&quot;&gt;PSR-4 autoloading support in Composer&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Which is Lighter, Silex or Aura.Web_Project?</title>
   <link href="http://auraphp.com/blog/2013/12/23/lightness-silex-vs-web-project/"/>
   <updated>2013-12-23T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2013/12/23/lightness-silex-vs-web-project</id>
   <content type="html">&lt;p&gt;At least one commenter at &lt;a href=&quot;http://www.reddit.com/r/PHP/comments/1sq7fi/lighter_than_silex_and_slimmer_than_slim_auraweb/&quot;&gt;Reddit&lt;/a&gt; pointed &lt;a href=&quot;https://igor.io/2013/09/02/how-heavy-is-silex.html&quot;&gt;to this Silex article&lt;/a&gt; and used it as their basis for evaluating my claim that &lt;a href=&quot;http://auraphp.com/blog/2013/12/12/aura-v2-web-project/&quot;&gt;Aura.Web_Project is lighter than Silex&lt;/a&gt;. Others had similar sentiments.&lt;/p&gt;

&lt;p&gt;Too many people, including the Silex article author, use absolute terms like “light” and “heavy” and “bloated”, instead of relative terms like “lighter” and “heavier” and “more bloated” and “less bloated”, to describe software. Any time someone uses an absolute term like that, you need to ask: “Compared to what?” Always remember that there is no such thing as “bloated” or “heavy” or “light”; there is only “heavier” or “lighter” or “more bloated” or “less bloated” in comparison to something else.&lt;/p&gt;

&lt;table&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;I don’t know if the measurements in that article are valid or useful for defining “what makes a microframework” but they do provide a basis for comparison. I understand that some people think “measuring (size&lt;/td&gt;
      &lt;td&gt;lines-of-code&lt;/td&gt;
      &lt;td&gt;number-of-classes) is stupid and it doesn’t matter!” Maybe it is, maybe it’s not. The author of the article seemed to think it was worthwhile to mention those numbers in relation to Silex, whether or not he thought they “mattered.”&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;So, let’s go with that article and use its approach to make a comparison between Silex and Aura.Web_Project to see if my earlier claim, using the terms and measurements outlined by the Silex post author, is accurate.&lt;/p&gt;

&lt;h3 id=&quot;methodology&quot;&gt;Methodology&lt;/h3&gt;

&lt;p&gt;The Silex article does not define its measurement methodology as well as I would like. There are no steps listed so his results can be replicated, or so the process can be applied to other systems. This means I had to do a little guessing to figure out the author’s process. I came up with the following:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Install the system in question and remove its tests.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Modify the &lt;code class=&quot;highlighter-rouge&quot;&gt;index.php&lt;/code&gt; bootstrap script to show the classes actually used in a dynamic dispatch.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Run &lt;code class=&quot;highlighter-rouge&quot;&gt;du&lt;/code&gt; to check disk usage.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Run &lt;code class=&quot;highlighter-rouge&quot;&gt;cloc&lt;/code&gt; to count the non-comment non-blank lines of code (NCLOC) in the entire system.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Invoke the &lt;code class=&quot;highlighter-rouge&quot;&gt;index.php&lt;/code&gt; bootstrap script to see a list of the classes actually used in a “standard request”.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Given that list of classes, run &lt;code class=&quot;highlighter-rouge&quot;&gt;cloc&lt;/code&gt; to count the non-comment non-blank lines of code (NCLOC) in the class files that are actually used in a “standard request”.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The term “standard request” is from the Silex post. I don’t know what the author means by that, so in this article it’s a bare-bones invocation of the framework, a “Hello World” call that tells you the dynamic dispatch has been completed.&lt;/p&gt;

&lt;p&gt;In order for you to see exactly what I did and what the the results were, here are links to &lt;a href=&quot;https://gist.github.com/pmjones/8074310&quot;&gt;the script&lt;/a&gt; and &lt;a href=&quot;https://gist.github.com/pmjones/8074442&quot;&gt;the output&lt;/a&gt;. You can run the script yourself and see the results on your own system. If you notice anything wrong with the script or its output, please let me know so I can fix it and correct this article and its conclusions.&lt;/p&gt;

&lt;h3 id=&quot;measurements-and-comparisons&quot;&gt;Measurements and Comparisons&lt;/h3&gt;

&lt;p&gt;As you can see from the above script, we are comparing the bare-bones Silex 1.1.2 installation without any providers to a bare-bones Aura.Web_Project as installed via &lt;code class=&quot;highlighter-rouge&quot;&gt;composer create-project&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I list the following measurements only because the original Silex article uses them. There are some measurement differences from the original article; I am willing to ascribe the differences to changes in the Silex codebase since that time.&lt;/p&gt;

&lt;h4 id=&quot;total-package-dependencies&quot;&gt;Total Package Dependencies&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;Silex: 7 &lt;a href=&quot;https://gist.github.com/pmjones/8074442#file-gistfile1-txt-L6-L29&quot;&gt;output&lt;/a&gt;, not including itself&lt;/li&gt;
  &lt;li&gt;Aura.Web_Project: 9 &lt;a href=&quot;https://gist.github.com/pmjones/8074442#file-gistfile1-txt-L59-L85&quot;&gt;output&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Aura has two more package dependencies than Silex. Aura is minus an event handling system, but adds an Includer for reading config files, a Project_Kernel as the foundation for the Web_Kernel, and Monolog.&lt;/p&gt;

&lt;h4 id=&quot;total-disk-usage&quot;&gt;Total Disk Usage&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;Silex: 2.6M &lt;a href=&quot;https://gist.github.com/pmjones/8074442#file-gistfile1-txt-L97-L101&quot;&gt;output&lt;/a&gt;, althought original article states 3.5M&lt;/li&gt;
  &lt;li&gt;Aura.Web_Project: 1.2M &lt;a href=&quot;https://gist.github.com/pmjones/8074442#file-gistfile1-txt-L103-L107&quot;&gt;output&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In terms of bytes-on-disk, even with two more package dependencies, Aura.Web_Project is less than half the size of Silex.&lt;/p&gt;

&lt;h4 id=&quot;total-non-comment-lines-of-php-code&quot;&gt;Total Non-Comment Lines Of PHP Code&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;Silex: 23327 &lt;a href=&quot;https://gist.github.com/pmjones/8074442#file-gistfile1-txt-L109-L121&quot;&gt;output&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Aura.Web_Project: 7465 &lt;a href=&quot;https://gist.github.com/pmjones/8074442#file-gistfile1-txt-L130-L142&quot;&gt;output&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even with two more package dependencies, Aura.Web_Project has 1/3 the NCLOC than Silex.&lt;/p&gt;

&lt;h4 id=&quot;total-class-count&quot;&gt;Total Class Count&lt;/h4&gt;

&lt;p&gt;The class-counting command is here: &lt;a href=&quot;https://gist.github.com/pmjones/8074310#file-gistfile1-sh-L97&quot;&gt;https://gist.github.com/pmjones/8074310#file-gistfile1-sh-L97&lt;/a&gt; and includes only classes and abstract classes, not interfaces or traits.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Silex: 311 &lt;a href=&quot;https://gist.github.com/pmjones/8074442#file-gistfile1-txt-L149-L153&quot;&gt;output&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Aura.Web_Project: 148 &lt;a href=&quot;https://gist.github.com/pmjones/8074442#file-gistfile1-txt-L155-L159&quot;&gt;output&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even with two more dependencies, Aura.Web_Project has 1/2 the total class count of Silex.&lt;/p&gt;

&lt;h4 id=&quot;actual-usage-class-count&quot;&gt;“Actual Usage” Class Count&lt;/h4&gt;

&lt;p&gt;This is determined by doing an &lt;code class=&quot;highlighter-rouge&quot;&gt;array_diff()&lt;/code&gt; between &lt;code class=&quot;highlighter-rouge&quot;&gt;get_declared_classes()&lt;/code&gt; before and after the framework is invoked via a web server. It includes only classes and abstract classes, not interfaces or traits.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Silex: 45 &lt;a href=&quot;https://gist.github.com/pmjones/8074442#file-gistfile1-txt-L161-L217&quot;&gt;output&lt;/a&gt;; the original article claimed a “standard request” in Silex uses 50 classes, but the author did not state what a “standard request” was.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Aura.Web_Project: 53 &lt;a href=&quot;https://gist.github.com/pmjones/8074442#file-gistfile1-txt-L221-L285&quot;&gt;output&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In a bare-bones “hello world” that invokes only the dynamic dispatch cycle, Aura.Web_Project uses eight more classes (i.e., almost 1/5 more) than Silex.&lt;/p&gt;

&lt;p&gt;Take a look at the actual class lists linked above. Note that Aura splits the request object into 21 (!) classes, and the response object into 7, for a total of 28 classes related to request and response handling. In Silex 1.1.2, I see only 8 request/response classes from Symfony HttpFoundation.  This means that similar functionality has been split across more classes in Aura.Web_Project.&lt;/p&gt;

&lt;h4 id=&quot;actual-usage-non-comment-lines-of-php-code&quot;&gt;“Actual Usage” Non-Comment Lines Of PHP Code&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;Silex: 4388 &lt;a href=&quot;https://gist.github.com/pmjones/8074442#file-gistfile1-txt-L289-L301&quot;&gt;output&lt;/a&gt;; The original article stated a total of 4018&lt;/li&gt;
  &lt;li&gt;Aura.Web_Project: 3555 &lt;a href=&quot;https://gist.github.com/pmjones/8074442#file-gistfile1-txt-L306-L318&quot;&gt;output&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even though Aura.Web_Project uses eight more classes, its NCLOC count is only 81% that of Silex (i.e., almost 1/5 smaller).&lt;/p&gt;

&lt;h4 id=&quot;minimal-interface&quot;&gt;Minimal Interface&lt;/h4&gt;

&lt;p&gt;At the end of the original article, the author states …&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;For the most part you will only ever deal with the following types:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Silex\Application&lt;/li&gt;
    &lt;li&gt;Silex\Controller&lt;/li&gt;
    &lt;li&gt;Silex\Route&lt;/li&gt;
    &lt;li&gt;Symfony\Component\HttFoundation\Request&lt;/li&gt;
    &lt;li&gt;Symfony\Component\HttFoundation\Response&lt;/li&gt;
    &lt;li&gt;Pimple&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;…&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Minimal interface &amp;gt; minimal lines of code.&lt;/li&gt;
    &lt;li&gt;Silex is quite lightweight.&lt;/li&gt;
    &lt;li&gt;The entire public API consists of 5 classes.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;(The article summary says 5 classes, but there are 6 classes in that list. Because Silex\Application extends Pimple I think it’s fair for the author not to count Pimple separately there.)&lt;/p&gt;

&lt;p&gt;For Aura.Web_Project, “for the most part” there are only 4:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Aura\Di&lt;/li&gt;
  &lt;li&gt;Aura\Router&lt;/li&gt;
  &lt;li&gt;Aura\Web\Request&lt;/li&gt;
  &lt;li&gt;Aura\Web\Response&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;Does all this mean it is true that Aura.Web_Project is lighter than Silex? It depends on how you measure:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;If you measure by the number of package dependencies, disregarding how similar functionality is split up between packages, then Silex is lighter.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;If you measure by the total disk usage, Aura.Web_Project is lighter.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;If you measure by the total NCLOC, Aura.Web_Project is lighter.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;If you measure by the total class count, Aura.Web_Project is lighter.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;If you measure by the acutual-usage class count, disregarding how similar functionality is split up among classes, then Silex is lighter.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;If you measure by the actual-usage NCLOC, Aura.Web_Project is lighter.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;If you measure by how many classes “for the most part” are in the public API, Aura.Web_Project is lighter.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In 5 of the 7 measures put forth by the original Silex article, Aura.Web_Project is the lighter of the two.  The original author’s claim that “Silex is quite lightweight” might be true in some other way, but is it not as “lightweight” as Aura.Web_Project according to the measures he puts forth.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>A Peek At Aura v2 -- Aura.Web_Project, The Micro/Macro Web Framework</title>
   <link href="http://auraphp.com/blog/2013/12/12/aura-v2-web-project/"/>
   <updated>2013-12-12T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2013/12/12/aura-v2-web-project</id>
   <content type="html">&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;UPDATE (2014-07-17):&lt;/strong&gt; The configuration mechanism described in this post has been superseded by later development; see &lt;a href=&quot;http://auraphp.com/blog/2014/04/07/two-stage-config/&quot;&gt;Composer-Assisted Two-Stage Configuration&lt;/a&gt; for more.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;(In this series, we have been discussing the improvements over Aura v1 that
are being incorporated into v2.)&lt;/p&gt;

&lt;p&gt;Lighter than &lt;a href=&quot;http://silex.sensiolabs.org&quot;&gt;Silex&lt;/a&gt;, and slimmer than &lt;a href=&quot;http://www.slimframework.com&quot;&gt;Slim&lt;/a&gt;, the &lt;a href=&quot;https://github.com/auraphp/Aura.Web_Kernel&quot;&gt;Aura.Web_Project&lt;/a&gt;
package is a minimalist web-specific project framework that starts out small
and grows only as you need it.&lt;/p&gt;

&lt;p&gt;By “minimal” we mean &lt;em&gt;very&lt;/em&gt; minimal. The project package provides only a
&lt;a href=&quot;https://github.com/auraphp/Aura.Di/tree/2.x&quot;&gt;dependency injection container&lt;/a&gt;,
a &lt;a href=&quot;https://github.com/auraphp/Aura.Project_Kernel&quot;&gt;configuration system&lt;/a&gt;,
a &lt;a href=&quot;https://github.com/auraphp/Aura.Router/tree/2.x&quot;&gt;router&lt;/a&gt;,
a &lt;a href=&quot;https://github.com/auraphp/Aura.Dispatcher&quot;&gt;dispatcher&lt;/a&gt;,
a pair of &lt;a href=&quot;http://github.com/auraphp/Aura.Web/tree/2.x&quot;&gt;request and response&lt;/a&gt; objects,
and a &lt;a href=&quot;https://github.com/Seldaek/monolog&quot;&gt;Monolog&lt;/a&gt; instance for logging.&lt;/p&gt;

&lt;p&gt;This minimal implementation should not be taken as “restrictive”:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;The DI container, coupled with the project kernel’s two-stage configuration,
allows a wide range of programmatic service definitions.  This means &lt;em&gt;no
more static calls&lt;/em&gt; to configure services; edit the &lt;code class=&quot;highlighter-rouge&quot;&gt;modify&lt;/code&gt; stage config
files, pull a service out of the container, and operate on it directly.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;You can add &lt;em&gt;any&lt;/em&gt; library you want into the project, not just Aura
libraries, through Composer and the DI container. This means the
bundle/plugin universe is made up of &lt;strong&gt;anything written in PHP&lt;/strong&gt;, not just
Aura-specific plugins.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;As noted in earlier articles in this series, the &lt;a href=&quot;/blog/2013/11/18/aura-v2-router&quot;&gt;router&lt;/a&gt; and &lt;a href=&quot;/blog/2013/11/04/aura-v2-dispatcher&quot;&gt;dispatcher&lt;/a&gt; are
completely separated from each other, and are built with iterative
refactoring in mind. This means you can start with micro-framework-like
closure controllers, and work your way into more complex controller objects
of your own design.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;projects-kernels-dependencies&quot;&gt;Projects? Kernels? Dependencies?&lt;/h3&gt;

&lt;p&gt;It had to happen at some point. Unlike Aura &lt;em&gt;library&lt;/em&gt; packages, the &lt;em&gt;project&lt;/em&gt;
and associated &lt;em&gt;kernel&lt;/em&gt; packages have dependencies. This is something we
can’t get around; the idea behind Aura has always been to build its framework
out of the independent library packages, but of course that means the
framework itself is not independent of the libraries.&lt;/p&gt;

&lt;p&gt;(The &lt;code class=&quot;highlighter-rouge&quot;&gt;Aura.*_Project&lt;/code&gt; packages are system skeletons, providing a directory
structure for the proejct. The &lt;code class=&quot;highlighter-rouge&quot;&gt;Aura.*_Kernel&lt;/code&gt; packages bring together
the libraries necessary for the project skeleton.)&lt;/p&gt;

&lt;h3 id=&quot;getting-started&quot;&gt;Getting Started&lt;/h3&gt;

&lt;p&gt;You can start a new &lt;a href=&quot;https://github.com/auraphp/Aura.Web_Kernel&quot;&gt;Aura.Web_Project&lt;/a&gt; via &lt;a href=&quot;http://getcomposer.org&quot;&gt;Composer&lt;/a&gt; in a
&lt;code class=&quot;highlighter-rouge&quot;&gt;{$PROJECT_PATH}&lt;/code&gt; of your choosing:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;composer create-project --stability=dev aura/web-project {$PROJECT_PATH}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will create the project skeleton and install all of the necessary
library packages.&lt;/p&gt;

&lt;p&gt;Once you have installed the project, start the built-in PHP server inside the
new project web directory:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cd {$PROJECT_PATH}
php -S localhost:8000 -t web/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When you browse to &lt;a href=&quot;http://localhost:8000&quot;&gt;http://localhost:8000&lt;/a&gt; you should see “Hello World!” as
the output.&lt;/p&gt;

&lt;h3 id=&quot;controllers-micromacro&quot;&gt;Controllers: Micro/Macro?&lt;/h3&gt;

&lt;p&gt;When we say “micro/macro”, we mean that the system starts out as a the most
micro of micro-frameworks, but is built with the idea that eventually you may
want to refactor your architecture to a full-stack type of system.&lt;/p&gt;

&lt;h4 id=&quot;micro-controller&quot;&gt;Micro Controller&lt;/h4&gt;

&lt;p&gt;For example, you can start by embedding your controller logic directly in
the router system …&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;/**
 * {$PROJECT_PATH}/config/default/modify/router.php
 */&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$di&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'web_request'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$di&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'web_response'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$router&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'blog.read'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'/blog/read/{id}'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addValues&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'controller'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;nv&quot;&gt;$content&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Reading blog post &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$id&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;htmlspecialchars&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
                &lt;span class=&quot;nv&quot;&gt;$content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ENT_QUOTES&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ENT_SUBSTITUTE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'UTF-8'&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h4 id=&quot;macro-controller&quot;&gt;Macro Controller&lt;/h4&gt;

&lt;p&gt;You can then migrate that to a more full-stack system (or you can
start with a full stack style in the first place).  This is more complex but
is much more powerful, maintainable, and testable in the long run.&lt;/p&gt;

&lt;p&gt;First, define a controller class and place it in the project &lt;code class=&quot;highlighter-rouge&quot;&gt;src/&lt;/code&gt; directory.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;/**
 * {$PROJECT_PATH}/src/App/Controllers/BlogController.php
 */&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;App\Controllers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Aura\Web\Request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Aura\Web\Response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;BlogController&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;__construct&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Request&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Response&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;request&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;response&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nv&quot;&gt;$content&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Reading blog post &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$id&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;htmlspecialchars&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;nv&quot;&gt;$content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ENT_QUOTES&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ENT_SUBSTITUTE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'UTF-8'&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;(Note that you don’t need to extend a base controller here. The
&lt;a href=&quot;https://github.com/auraphp/Aura.Web_Kernel&quot;&gt;Aura.Web_Project&lt;/a&gt; package does not force any specific controller
methodology on you. Of course, if you want to, you can create your own base
controllers and extend them.)&lt;/p&gt;

&lt;p&gt;Next, tell the project how to build the &lt;em&gt;BlogController&lt;/em&gt; through the DI
system. Edit the project &lt;code class=&quot;highlighter-rouge&quot;&gt;config/default/define.php&lt;/code&gt; config file to tell the
DI system to pass &lt;em&gt;Request&lt;/em&gt; and &lt;em&gt;Response&lt;/em&gt; objects to the constructor.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;/**
 * {$PROJECT_PATH}/config/default/define.php
 */&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$di&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'App\Controllers\BlogController'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;s1&quot;&gt;'request'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$di&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;lazyGet&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'web_request'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;s1&quot;&gt;'response'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$di&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;lazyGet&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'web_response'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;After that, put the &lt;em&gt;App\Controllers\BlogController&lt;/em&gt; object in the dispatcher
under the name &lt;code class=&quot;highlighter-rouge&quot;&gt;blog&lt;/code&gt; as a lazy-loaded instantiation …&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;/**
 * {$PROJECT_PATH}/config/default/modify/dispatcher.php
 */&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$dispatcher&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setObject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'blog'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$di&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;lazyNew&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'App\Controllers\BlogController'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;… and finally, point the router to the &lt;code class=&quot;highlighter-rouge&quot;&gt;blog&lt;/code&gt; controller object and its
its &lt;code class=&quot;highlighter-rouge&quot;&gt;read&lt;/code&gt; action:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;/**
 * {$PROJECT_PATH}/config/default/modify/dispatcher.php
 */&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$router&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'blog.read'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'/blog/read/{id}'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addValues&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'controller'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'blog'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'action'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'read'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;configuration&quot;&gt;Configuration?&lt;/h3&gt;

&lt;p&gt;As with the Aura v1, configuration files are located in
&lt;code class=&quot;highlighter-rouge&quot;&gt;{$PROJECT_PATH}/config&lt;/code&gt; directory. Previously, they were single files,
labeled for the config mode. In Aura v2, config files are organized into
subdirectories by config mode. (The config mode is still stored in the &lt;code class=&quot;highlighter-rouge&quot;&gt;_mode&lt;/code&gt;
file in the config directory.)&lt;/p&gt;

&lt;p&gt;Whereas Aura v1 projects used a single-stage config system, loading up the
individual config files to define params, setters, and services, Aura v2
projects use a two-stage configuration system:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;First, all &lt;code class=&quot;highlighter-rouge&quot;&gt;define.php&lt;/code&gt; files are included from the packages and the
project; these define constructor parameters, setter methods, and shared
services through the DI container.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;After that, the DI container is locked, and all &lt;code class=&quot;highlighter-rouge&quot;&gt;modify.php&lt;/code&gt; files are
included; these are for retrieving services from the DI container for
programmatic modification.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;(The &lt;code class=&quot;highlighter-rouge&quot;&gt;default&lt;/code&gt; mode directory is always loaded; if the mode is something other
than &lt;code class=&quot;highlighter-rouge&quot;&gt;default&lt;/code&gt; then the files in that directory will be loaded after &lt;code class=&quot;highlighter-rouge&quot;&gt;default&lt;/code&gt;.)&lt;/p&gt;

&lt;p&gt;This two-stage process provides a very powerful system for configuring any and
all PHP libraries, especially those that have been registered as services in
the DI container. However, this power comes with some level of complexity; the
rules are simple, but they lead to complex combinations and effects. As such,
will write about the configuration system in specific at a later time.&lt;/p&gt;

&lt;h3 id=&quot;adding-functionality&quot;&gt;Adding Functionality&lt;/h3&gt;

&lt;p&gt;Adding new functionality is as easy as modifying the project &lt;code class=&quot;highlighter-rouge&quot;&gt;composer.json&lt;/code&gt;
file, doing &lt;code class=&quot;highlighter-rouge&quot;&gt;composer update&lt;/code&gt;, and then changing your config files to build
the new library objects properly. If you are adding an Aura library, the
system knows enough to configure it automatically via the library package’s
&lt;code class=&quot;highlighter-rouge&quot;&gt;config/&lt;/code&gt; directory, but &lt;em&gt;any&lt;/em&gt; reasonably well-structured PHP library can be
included and configured.&lt;/p&gt;

&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;The point of &lt;a href=&quot;https://github.com/auraphp/Aura.Web_Kernel&quot;&gt;Aura.Web_Project&lt;/a&gt; is to provide an absolute minimal framework
for building web apps in a way that promotes separation of concerns along with
a refactorable architecture. The DI container and two-stage configuration
system are the key components here, with the fully-separated router and
dispatcher layered on top of them.&lt;/p&gt;

&lt;p&gt;If you like clean code, fully decoupled libraries, and truly independent
packages, then &lt;a href=&quot;http://auraphp.com&quot;&gt;the Aura project&lt;/a&gt; is for you. Download a single package
and start using it in your project today, with no added dependencies.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>A Peek At Aura v2 -- Aura.Router</title>
   <link href="http://auraphp.com/blog/2013/11/18/aura-v2-router/"/>
   <updated>2013-11-18T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2013/11/18/aura-v2-router</id>
   <content type="html">&lt;p&gt;Lately, we’ve been going over the migration of v2 packages from v1. Today,
I’ll talk about the updated &lt;a href=&quot;https://github.com/auraphp/Aura.Router/tree/2.x&quot;&gt;Aura.Router v2&lt;/a&gt; package. While not an example
of extracting a new package from an existing one, it has a couple of features
that other routers don’t currently have, in addition to being truly
independent and completely decoupled from any other package.&lt;/p&gt;

&lt;p&gt;(This post describes only some of the features of the router; please visit
the &lt;a href=&quot;https://github.com/auraphp/Aura.Router/tree/2.x&quot;&gt;Aura.Router v2&lt;/a&gt; package page for full information. Also, unlike v1,
the v2 package is PHP 5.3 compatible!)&lt;/p&gt;

&lt;h3 id=&quot;only-routing-no-dispatching&quot;&gt;Only Routing, No Dispatching&lt;/h3&gt;

&lt;p&gt;Anyone using a framework system built in the past 5 years or so should already
be familiar with routers. A router takes the incoming URL path, along with
other optional data, and extracts a series of values that determine what
controller and action should be executed, along with the parameters to send
along to the controller and action.&lt;/p&gt;

&lt;p&gt;Most routing systems combine the “routing” task with the “dispatch” task. That
is, they &lt;em&gt;both&lt;/em&gt; extract the parameters &lt;em&gt;and&lt;/em&gt; pick the controller/action.
&lt;a href=&quot;https://github.com/auraphp/Aura.Router/tree/2.x&quot;&gt;Aura.Router v2&lt;/a&gt;, because of its truly independent nature, &lt;em&gt;only&lt;/em&gt; does
routing. It turns out that dispatching is something that can be independent of
routing, and so we have a separate &lt;a href=&quot;https://github.com/auraphp/Aura.Dispatcher&quot;&gt;Aura.Dispatcher&lt;/a&gt; package to handle that
(although you can use any dispatching system you like).&lt;/p&gt;

&lt;h3 id=&quot;the-basics&quot;&gt;The Basics&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Router/tree/2.x&quot;&gt;Aura.Router v2&lt;/a&gt; has the basic features one expects: map a path to a route,
define token regexes, etc.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// add a basic route with name, path, token regexes, and default values
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$router&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'blog.read'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'/blog/read/{id}{format}'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addTokens&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'id'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'\d+'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'format'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'(\.\w+)?'&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addValues&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'controller'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Blog'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'action'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'read'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// use addGet(), addPost(), etc. to limit the matching HTTP method.
// use setSecure() to limit to secure connections.
&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Because &lt;a href=&quot;https://github.com/auraphp/Aura.Router/tree/2.x&quot;&gt;Aura.Router v2&lt;/a&gt; is completely decoupled, you have to feed it the
incoming URL path and server information when doing matching (it does not make
assumptions about the execution environment):&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// get the incoming request URL path
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$path&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;parse_url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$_SERVER&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'REQUEST_URI'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;PHP_URL_PATH&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// get the route based on the path and server
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$route&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$router&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$_SERVER&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;If there is a match, the &lt;code class=&quot;highlighter-rouge&quot;&gt;$route&lt;/code&gt; variable will be a &lt;em&gt;Route&lt;/em&gt; object (otherwise
false).  You can then dispatch to the controller and action of your choice
by getting the &lt;code class=&quot;highlighter-rouge&quot;&gt;$route-&amp;gt;params&lt;/code&gt;; the following is naive but works just fine
when autoloading is set up:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// get the route params
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$params&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$route&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// what class and method should we dispatch to?
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$class&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;App\Controllers\{$params['controller']}Controller&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$method&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'action'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Action'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// with the above 'blog.read' route, this will execute
// \App\Controllers\BlogController::readAction()
// and get back the result
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$controller&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$class&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$controller&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$method&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;If you’re looking for an independent dispatching system with a little more
power and flexibility, checkout &lt;a href=&quot;https://github.com/auraphp/Aura.Dispatcher&quot;&gt;Aura.Dispatcher&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;routing-by-server-values&quot;&gt;Routing By Server Values&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Router/tree/2.x&quot;&gt;Aura.Router v2&lt;/a&gt; allows you to examine the &lt;code class=&quot;highlighter-rouge&quot;&gt;$_SERVER&lt;/code&gt; values and pick a
route based on them using the &lt;code class=&quot;highlighter-rouge&quot;&gt;addServer()&lt;/code&gt; method. For example, if you want
to match routes based on the &lt;code class=&quot;highlighter-rouge&quot;&gt;HTTP_ACCEPT&lt;/code&gt; value …&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$router&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addRoute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'json_only'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'/accept/json/{id}'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addServer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// must be of quality *, 1.0, or 0.1-0.9
&lt;/span&gt;        &lt;span class=&quot;s1&quot;&gt;'HTTP_ACCEPT'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'application/json(;q=(\*|1\.0|[0\.[1-9]]))?'&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;In that naive example, there must be a &lt;code class=&quot;highlighter-rouge&quot;&gt;$_SERVER['HTTP_ACCEPT']&lt;/code&gt; string that
matches the given regex for the route to match. The matching &lt;code class=&quot;highlighter-rouge&quot;&gt;HTTP_ACCEPT&lt;/code&gt;
portion will be placed in the &lt;code class=&quot;highlighter-rouge&quot;&gt;$route-&amp;gt;params&lt;/code&gt; for you to use as you wish.&lt;/p&gt;

&lt;h3 id=&quot;sequentially-optional-params&quot;&gt;Sequentially Optional Params&lt;/h3&gt;

&lt;p&gt;Sometimes we need a params in the route path to be &lt;em&gt;sequentially&lt;/em&gt; optional.
The classic example is a blog archive organized by year, month, and day.
We don’t want to have to write three routes, one for &lt;code class=&quot;highlighter-rouge&quot;&gt;/{year}&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;/{year}/{month}&lt;/code&gt;,
and &lt;code class=&quot;highlighter-rouge&quot;&gt;/{year}/{month}/{day}&lt;/code&gt;, each with repeated information about the route.&lt;/p&gt;

&lt;p&gt;In &lt;a href=&quot;https://github.com/auraphp/Aura.Router/tree/2.x&quot;&gt;Aura.Router v2&lt;/a&gt;, there is a special notation similar to &lt;a href=&quot;https://tools.ietf.org/html/rfc6570&quot;&gt;URI Template&lt;/a&gt;s
that indicates sequentially optional params:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$router&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'blog.archive'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'/blog/archive{/year,month,day}'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addTokens&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'year'&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'\d{4}'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'month'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'\d{2}'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'day'&lt;/span&gt;   &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'\d{2}'&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addValues&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'controller'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'blog'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'action'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'archive'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'year'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'month'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'day'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;With that, the following routes will all match the ‘archive’ route, and will
set the appropriate values:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/blog/archive
/blog/archive/1979
/blog/archive/1979/11
/blog/archive/1979/11/07
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Incidentally, this means that the commonly used controller/action/id catchall
route is easy to implement with defaults in place:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$router&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'catchall'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'{/controller,action,id}'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addValues&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'controller'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'default'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'action'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'index'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'id'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;That means &lt;code class=&quot;highlighter-rouge&quot;&gt;/&lt;/code&gt; will have params indicating the &lt;code class=&quot;highlighter-rouge&quot;&gt;default&lt;/code&gt; controller &lt;code class=&quot;highlighter-rouge&quot;&gt;index&lt;/code&gt;
action, &lt;code class=&quot;highlighter-rouge&quot;&gt;/foo&lt;/code&gt; will indicate the &lt;code class=&quot;highlighter-rouge&quot;&gt;foo&lt;/code&gt; controller &lt;code class=&quot;highlighter-rouge&quot;&gt;index&lt;/code&gt; action, &lt;code class=&quot;highlighter-rouge&quot;&gt;/foo/bar&lt;/code&gt;
will indicate the &lt;code class=&quot;highlighter-rouge&quot;&gt;foo&lt;/code&gt; controller &lt;code class=&quot;highlighter-rouge&quot;&gt;bar&lt;/code&gt; action, and &lt;code class=&quot;highlighter-rouge&quot;&gt;/foo/bar/42&lt;/code&gt; will
indicate the &lt;code class=&quot;highlighter-rouge&quot;&gt;foo&lt;/code&gt; controller &lt;code class=&quot;highlighter-rouge&quot;&gt;bar&lt;/code&gt; action with &lt;code class=&quot;highlighter-rouge&quot;&gt;id&lt;/code&gt; of 42.&lt;/p&gt;

&lt;h3 id=&quot;attaching-route-groups&quot;&gt;Attaching Route Groups&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Router/tree/2.x&quot;&gt;Aura.Router v2&lt;/a&gt; is different from v1 in how it attaches what are variously
called sub-routes or route groups.  Previously, we used a descriptor array,
but in practice that turned out to be a little unwieldly. The new version
uses a callable to allow you attach route groups programmatically:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// attach routes to the '/blog' path prefix, and prefix all names with 'blog.'
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$router&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;attach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'blog'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'/blog'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$router&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// blog.browse at /blog
&lt;/span&gt;    &lt;span class=&quot;nv&quot;&gt;$router&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'browse'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// blog.read at /blog/read/{id}{format}
&lt;/span&gt;    &lt;span class=&quot;nv&quot;&gt;$router&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'read'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'/{id}{format}'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addTokens&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;s1&quot;&gt;'id'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'\d+'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;s1&quot;&gt;'format'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'(\.\w+)?'&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;See a longer example &lt;a href=&quot;https://github.com/auraphp/Aura.Router/tree/2.x#attaching-route-groups&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As a side note, the router will automatically add default &lt;code class=&quot;highlighter-rouge&quot;&gt;controller&lt;/code&gt; and
&lt;code class=&quot;highlighter-rouge&quot;&gt;action&lt;/code&gt; values for you here. The &lt;code class=&quot;highlighter-rouge&quot;&gt;controller&lt;/code&gt; value is the route name prefix,
and the &lt;code class=&quot;highlighter-rouge&quot;&gt;action&lt;/code&gt; value is the sub-route name. Of course, these can be
overridden by path params or your own default values.&lt;/p&gt;

&lt;h3 id=&quot;attaching-rest-routes&quot;&gt;Attaching REST Routes&lt;/h3&gt;

&lt;p&gt;As a consequence of using a closure to add route groups, we can now add REST
resource routes in a single call to &lt;code class=&quot;highlighter-rouge&quot;&gt;attachResource()&lt;/code&gt;:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$router&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;attachResource&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'blog'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'/blog'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;This will add seven REST routes with appropriate names, paths, HTTP methods,
and token regexes; you can see the list &lt;a href=&quot;https://github.com/auraphp/Aura.Router/tree/2.x#attaching-rest-resource-routes&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you decide those routes are not to your liking, you can override the
default behavior by using &lt;code class=&quot;highlighter-rouge&quot;&gt;setResourceCallable()&lt;/code&gt; to pass callable of your own
to create resource routes:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$router&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setResourceCallable&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$router&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;$router&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addPost&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'create'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'/{id}'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;$router&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addGet&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'read'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'/{id}'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;$router&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addPatch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'update'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'/{id}'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;$router&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addDelete&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'delete'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'/{id}'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;That example will cause four CRUD routes to be added when you call
&lt;code class=&quot;highlighter-rouge&quot;&gt;attachResource()&lt;/code&gt;.&lt;/p&gt;

&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/auraphp/Aura.Router/tree/2.x&quot;&gt;Aura.Router v2&lt;/a&gt; library retains the strengths of the v1 offering while
adding convenience and power, all in a completely decoupled package with no
other dependencies. It keeps a separation between routing and dispatching,
allowing you to drop it into any system you like and use any dispatching
mechanism of your own choice.&lt;/p&gt;

&lt;p&gt;If you like clean code, fully decoupled libraries, and truly independent
packages, then &lt;a href=&quot;http://auraphp.com&quot;&gt;the Aura project&lt;/a&gt; is for you. Download a single package
and start using it in your project today, with no added dependencies.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>A Peek At Aura v2 -- Aura.Web</title>
   <link href="http://auraphp.com/blog/2013/11/11/aura-v2-web/"/>
   <updated>2013-11-11T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2013/11/11/aura-v2-web</id>
   <content type="html">&lt;p&gt;In the &lt;a href=&quot;http://auraphp.com/blog/2013/09/30/lessons-learned/&quot;&gt;lessons learned&lt;/a&gt; post a few weeks ago, I wrote about how &lt;a href=&quot;http://auraphp.com&quot;&gt;Aura&lt;/a&gt;
was born of the idea that we could extract independent decoupled packages from
&lt;a href=&quot;http://solarphp.com&quot;&gt;Solar&lt;/a&gt;, and how in doing so, we discovered that some of those extracted
packages themsleves could be further split into independent pieces.&lt;/p&gt;

&lt;p&gt;The last example of this was how &lt;a href=&quot;http://auraphp.com/blog/2013/11/04/aura-v2-dispatcher/&quot;&gt;we extracted Aura.Dispatcher&lt;/a&gt; from three
separate packages. Today, I’m going to talk about how the &lt;a href=&quot;https://github.com/auraphp/Aura.Web/tree/2.x&quot;&gt;Aura.Web v2&lt;/a&gt;
package has been slimmed down as a result of Aura.Dispatcher being created.
(Incidentally, &lt;a href=&quot;https://github.com/auraphp/Aura.Web/tree/2.x&quot;&gt;Aura.Web v2&lt;/a&gt; is also PHP 5.3 compatible!)&lt;/p&gt;

&lt;h3 id=&quot;auraweb-version-1&quot;&gt;Aura.Web, version 1&lt;/h3&gt;

&lt;p&gt;Aura.Web v1 took the parts of &lt;a href=&quot;http://solarphp.com&quot;&gt;Solar&lt;/a&gt; related to web controllers and
combined them into a single independent package. The v1 package contains …&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;a &lt;em&gt;ControllerInterface&lt;/em&gt; along with an &lt;em&gt;AbstractPage&lt;/em&gt; controller object to
provide a base controller for web actions;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;a &lt;em&gt;Context&lt;/em&gt; object to represent the web request for the controller;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;a &lt;em&gt;Response&lt;/em&gt; data-transfer object to represent the web response from the
controller;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;an &lt;em&gt;Accept&lt;/em&gt; object to deal with content-type, language, charset, and
encoding negotiation;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;a &lt;em&gt;RendererInterface&lt;/em&gt; along with an &lt;em&gt;AbstractRenderer&lt;/em&gt; to allow controller
implementation authors to use any rendering system they liked, such as
&lt;a href=&quot;https://github.com/bobthecow/mustache.php&quot;&gt;Mustache&lt;/a&gt; or &lt;a href=&quot;https://github.com/auraphp/Aura.View&quot;&gt;Aura.View&lt;/a&gt;; and,&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;a segregated &lt;em&gt;SignalInterface&lt;/em&gt; and a bare-bones &lt;em&gt;Signal&lt;/em&gt; implementation
to handle controller hooks like pre-action, post-action, etc.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As I said in the &lt;a href=&quot;http://auraphp.com/blog/2013/10/21/aura-sql-v2-extended-pdo/&quot;&gt;peek at Aura.Sql v2&lt;/a&gt; post, when you are used to certain
things always being bundled together, it can be hard to see how they could be
separated. In the Aura.Sql case, we moved some of the functionality around so
that connections, schema discovery, and query building could become
independent of each other; the no longer needed to be provided simultaneously.&lt;/p&gt;

&lt;p&gt;In the Aura.Web case, it turns out extracting &lt;a href=&quot;https://github.com/auraphp/Aura.Dispatcher&quot;&gt;Aura.Dispatcher&lt;/a&gt; was the key
to reducing the Aura.Web package contents. With Aura.Dispatcher, any object
can be a controller, since it can dispatch to any method on any object (as
well as dispatching to closures). In turn, there is no more need for the
Aura.Web package to provide a base controller with interfaces for various
implementations. Instead, you can dispatch to any object you like, with the
dependencies you prefer, as your controller. That controller object can be
implemented at the framework level, or in a separate package or bundle.&lt;/p&gt;

&lt;p&gt;As a result, this means that web-specific request and response objects can be
in their own package independent of any particular controller implementation.
The &lt;a href=&quot;https://github.com/auraphp/Aura.Web/tree/2.x&quot;&gt;Aura.Web v2&lt;/a&gt; package contains only those request and response objects.&lt;/p&gt;

&lt;h3 id=&quot;request&quot;&gt;Request&lt;/h3&gt;

&lt;p&gt;First, the &lt;a href=&quot;https://github.com/auraphp/Aura.Web/tree/2.x&quot;&gt;Aura.Web v2&lt;/a&gt; &lt;em&gt;Request&lt;/em&gt; object is &lt;strong&gt;not&lt;/strong&gt; an HTTP request
representation. It contains copies of &lt;code class=&quot;highlighter-rouge&quot;&gt;$_ENV&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;$_SERVER&lt;/code&gt;, etc., that are
clearly not part of an HTTP request proper. More strictly speaking, the
&lt;em&gt;Request&lt;/em&gt; object represents the &lt;strong&gt;web request execution environment&lt;/strong&gt; of PHP.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Request&lt;/em&gt; object has various sub-objects representing all of the
&lt;a href=&quot;https://github.com/auraphp/Aura.Web/blob/2.x/README-REQUEST.md#superglobals&quot;&gt;PHP superglobals&lt;/a&gt;,
along with objects for …&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Web/blob/2.x/README-REQUEST.md#client&quot;&gt;the client making the request&lt;/a&gt;,&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Web/blob/2.x/README-REQUEST.md#content&quot;&gt;the raw body of the request&lt;/a&gt;,&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Web/blob/2.x/README-REQUEST.md#headers&quot;&gt;the request headers&lt;/a&gt;,&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Web/blob/2.x/README-REQUEST.md#method&quot;&gt;the request method&lt;/a&gt;,&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Web/blob/2.x/README-REQUEST.md#accept&quot;&gt;content negotiation&lt;/a&gt;,&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Web/blob/2.x/README-REQUEST.md#params&quot;&gt;arbitrary path-info parameters&lt;/a&gt;,
such as those generated by a &lt;a href=&quot;http://github.com/auraphp/Aura.Router&quot;&gt;router&lt;/a&gt;, and&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Web/blob/2.x/README-REQUEST.md#url&quot;&gt;the request URL&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;em&gt;Request&lt;/em&gt; object can be used in any controller (or any other object,
really).&lt;/p&gt;

&lt;h3 id=&quot;response&quot;&gt;Response&lt;/h3&gt;

&lt;p&gt;As with the &lt;em&gt;Request&lt;/em&gt; object, the &lt;em&gt;Response&lt;/em&gt; object only describes the web
response, and is not an HTTP response proper.  It has sub-objects for …&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Web/blob/2.x/README-RESPONSE.md#status&quot;&gt;status headers&lt;/a&gt;,&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Web/blob/2.x/README-RESPONSE.md#cache&quot;&gt;cache headers&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Web/blob/2.x/README-RESPONSE.md#cookies&quot;&gt;cookie headers&lt;/a&gt;,&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Web/blob/2.x/README-RESPONSE.md#redirect&quot;&gt;redirection headers&lt;/a&gt;,&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Web/blob/2.x/README-RESPONSE.md#headers&quot;&gt;all other headers&lt;/a&gt;, and&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Web/blob/2.x/README-RESPONSE.md#content&quot;&gt;the response content&lt;/a&gt;,
along with convenience methods related to content type, charset, disposition, and filename.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you have built a &lt;em&gt;Response&lt;/em&gt; object with any controller of your
preference, you can send it with any HTTP mechanism you like, including
&lt;a href=&quot;https://github.com/auraphp/Aura.Web/blob/2.x/README-RESPONSE.md#sending-the-response&quot;&gt;plain PHP&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;Whereas the v1 package included controllers, renderers, and other
functionality, the &lt;a href=&quot;https://github.com/auraphp/Aura.Web/tree/2.x&quot;&gt;Aura.Web v2&lt;/a&gt; package provides only &lt;em&gt;Request&lt;/em&gt; and
&lt;em&gt;Response&lt;/em&gt; objects. These objects are independent of any particular controller
system, and independent of any specific HTTP delivery mechanism, which means
they can be used in any new or existing codebase without introducing other
dependencies.&lt;/p&gt;

&lt;p&gt;By extracting functionality to independent packages, &lt;a href=&quot;http://auraphp.com&quot;&gt;Aura&lt;/a&gt; v2 continues to
make good on its core promises. If you like clean code, fully decoupled
libraries, and truly independent packages, then &lt;a href=&quot;http://auraphp.com&quot;&gt;the Aura project&lt;/a&gt; is
for you. Download a single package and start using it in your project today,
with no added dependencies.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>A Peek At Aura v2 -- Aura.Dispatcher</title>
   <link href="http://auraphp.com/blog/2013/11/04/aura-v2-dispatcher/"/>
   <updated>2013-11-04T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2013/11/04/aura-v2-dispatcher</id>
   <content type="html">&lt;p&gt;In the &lt;a href=&quot;http://auraphp.com/blog/2013/09/30/lessons-learned/&quot;&gt;lessons learned&lt;/a&gt; post, I talked about how &lt;a href=&quot;http://auraphp.com&quot;&gt;Aura&lt;/a&gt; was born of the
idea that we could extract independent decoupled packages from &lt;a href=&quot;http://solarphp.com&quot;&gt;Solar&lt;/a&gt;, and
how in doing so, we discovered that some of those extracted packages themsleves
could be further split into independent pieces.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://auraphp.com/blog/2013/10/21/aura-sql-v2-extended-pdo/&quot;&gt;Previously&lt;/a&gt;, I wrote about &lt;a href=&quot;https://github.com/auraphp/Aura.Sql/tree/2.x&quot;&gt;Aura.Sql-v2&lt;/a&gt;, &lt;a href=&quot;https://github.com/auraphp/Aura.Sql_Query/tree/2.x&quot;&gt;Aura.Sql_Query&lt;/a&gt;, and
&lt;a href=&quot;https://github.com/auraphp/Aura.Sql_Schema/tree/2.x&quot;&gt;Aura.Sql_Schema&lt;/a&gt; as extractions from a single Aura.Sql package.&lt;/p&gt;

&lt;p&gt;Today, I’m going to talk about &lt;a href=&quot;https://github.com/auraphp/Aura.Dispatcher&quot;&gt;Aura.Dispatcher&lt;/a&gt; as a combined extraction
from three separate packages.&lt;/p&gt;

&lt;h3 id=&quot;dispatchers&quot;&gt;Dispatchers&lt;/h3&gt;

&lt;p&gt;At its core, a dispatcher uses a set of parameters to determine what logic
should be invoked.  That set of parameters is generally the result of parsing
a URL with a &lt;a href=&quot;http://github.com/auraphp/Aura.Router&quot;&gt;router&lt;/a&gt;, but it could come from anywhere.&lt;/p&gt;

&lt;p&gt;In Aura v1, we actually have two layers of dispatchers. First, there is a
front controller at the &lt;a href=&quot;https://github.com/auraphp/Aura.Framework&quot;&gt;Aura.Framework&lt;/a&gt; level to determine what page
controller class should be instantiated. Then, at the &lt;a href=&quot;http://github.com/auraphp/Aura.Web&quot;&gt;Aura.Web&lt;/a&gt; page
controller level, there is an internal dispatcher that picks what method will
be invoked. (Some dispatchers work in only one pass to pick both the class and
the method; others, such as micro-framework dispatchers, pick only a closure
to execute.)&lt;/p&gt;

&lt;p&gt;In addition to the web dispatching, the Aura v1 framework also has a CLI
equivalent of a front controller. It picks the right command class based on
the CLI input, but the method is always the same.&lt;/p&gt;

&lt;p&gt;Finally, it’s not enough to know what object should get instantiated;
something has to actually instantiate it. As such, the web and CLI front
controllers need factories to create the objects they are dispatching to.&lt;/p&gt;

&lt;h3 id=&quot;extraction-and-behavior&quot;&gt;Extraction and Behavior&lt;/h3&gt;

&lt;p&gt;It turns out that dispatching at the framework level, and at the web and CLI
levels, is all remarkably similar. After realizing that, we extracted the
dispatching logic to its own independent package, without any dependendcies on
any other packages.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/auraphp/Aura.Dispatcher&quot;&gt;Aura.Dispatcher&lt;/a&gt; package lets you define named objects that will get
instantiated only as they are dispatched to (i.e., lazy loading). It picks
which named object to instantiate, and optionally which method to invoke,
based on an array of router values (or any other array you wish to pass). It
also works as a micro-framework dispatcher; instead of using an object factory
proper, you can add a named closure and &lt;em&gt;that&lt;/em&gt; will be invoked.&lt;/p&gt;

&lt;p&gt;Additionally, if you want a two-stage invocation where the dispatcher picks
an object, and the object picks its own method, &lt;a href=&quot;https://github.com/auraphp/Aura.Dispatcher&quot;&gt;Aura.Dispatcher&lt;/a&gt; comes
with a &lt;a href=&quot;https://github.com/auraphp/Aura.Dispatcher#intercessory-dispatch-methods&quot;&gt;trait&lt;/a&gt; that lets you pass named parameters to any method you like.
You can use that trait in any object to pick a method and invoke it with the
router (or other) parameters.&lt;/p&gt;

&lt;h3 id=&quot;refactoring-from-micro--to-full-stack-frameworks&quot;&gt;Refactoring From Micro- to Full-Stack Frameworks&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Dispatcher&quot;&gt;Aura.Dispatcher&lt;/a&gt; is built with the idea that some developers may begin with
a micro-framework architecture, and evolve over time toward a full-stack
architecture.  Here’s an outline of the &lt;a href=&quot;https://github.com/auraphp/Aura.Dispatcher#refactoring-to-architecture-changes&quot;&gt;full description&lt;/a&gt;; note that the
logic used to invoke the dispatcher &lt;em&gt;never changes&lt;/em&gt;; the only thing that
changes are the params being passed and the object being dispatched to.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;At first, the developer uses closures embedded in the routers parameters
passed to the dispatcher; this is a typical micro-framework approach.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;After adding several closure-based controllers to a router, the developer
is likely to want to keep the routing configurations separate from the
controller actions. At this point the developer may start putting the
controller actions into the dispatcher as named closures.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;As the number and complexity of controllers continues to grow, the
developer may wish to convert the controller closures into separately
invokable classes, lazy-loading along the way.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Finally, the developer may collect several action methods into a single
controller, keeping related functionality in the same class.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With that, we have a clear path from closures in a router, to closures in the
dispatcher, to invokable classes factoried by the dispatcher, and finally to
classes of multiple methods factoried by the dispatcher.  This means you can
modify your application architecture and not have to worry about swapping
dispatcher systems.&lt;/p&gt;

&lt;h3 id=&quot;next-steps&quot;&gt;Next Steps&lt;/h3&gt;

&lt;p&gt;Because we have extracted the dispatcher behaviors from both the &lt;a href=&quot;http://github.com/auraphp/Aura.Web&quot;&gt;Aura.Web&lt;/a&gt;
and &lt;a href=&quot;http://github.com/auraphp/Aura.Cli&quot;&gt;Aura.Cli&lt;/a&gt; packages, it means that those packages can become further
reduced in size and more focused. More on the &lt;a href=&quot;https://github.com/auraphp/Aura.Web/tree/2.x&quot;&gt;Aura.Web v2&lt;/a&gt; package next time!&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>A Peek At Aura v2 -- Aura.Sql and ExtendedPdo</title>
   <link href="http://auraphp.com/blog/2013/10/21/aura-sql-v2-extended-pdo/"/>
   <updated>2013-10-21T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2013/10/21/aura-sql-v2-extended-pdo</id>
   <content type="html">&lt;p&gt;In the &lt;a href=&quot;http://auraphp.com/blog/2013/09/30/lessons-learned/&quot;&gt;lessons learned&lt;/a&gt; post, I talked about how &lt;a href=&quot;http://auraphp.com&quot;&gt;Aura&lt;/a&gt; was born of the
idea that we could extract independent decoupled packages from &lt;a href=&quot;http://solarphp.com&quot;&gt;Solar&lt;/a&gt;, and
how in doing so, we discovered that some of those extracted packages themselves
could be further split into independent pieces.&lt;/p&gt;

&lt;p&gt;For example, take &lt;a href=&quot;http://github.com/auraphp/Aura.Sql&quot;&gt;Aura.Sql&lt;/a&gt;. From &lt;a href=&quot;http://solarphp.com/apidoc/package.Solar_Sql&quot;&gt;Solar_Sql&lt;/a&gt;, we pulled out the database
connection abstraction layers, the query objects, and the schema discovery
tools, then added on a connection manager and a mapper/gateway implementation.
It was very natural to think of all these things as belonging together; they
all need an SQL connection, so of course they should be bundled with an
SQL connection implementation, right?&lt;/p&gt;

&lt;h3 id=&quot;even-more-decoupling&quot;&gt;Even More Decoupling&lt;/h3&gt;

&lt;p&gt;Well, it turns out that merely extracting the SQL parts was not good enough
for some of our audience. They asked, “Can we download &lt;em&gt;just&lt;/em&gt; the SQL
connection classes, without the query objects or the mapper?” As with Solar,
we had to answer, “No; although the Aura.Sql package is independent from every
other Aura package, the various SQL tools all have be taken together as a
whole.”&lt;/p&gt;

&lt;p&gt;As a result, we have done even more decoupling with the &lt;a href=&quot;https://github.com/auraphp/Aura.Sql/tree/2.x&quot;&gt;Aura.Sql-v2&lt;/a&gt;
packages.  We have managed to make these packages independent from each other:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Sql/tree/2.x&quot;&gt;Aura.Sql-v2&lt;/a&gt; is composed primarily of an extended PDO implementation,
along with a connection manager and a bare-bones profiler. Its only
dependency is the native &lt;a href=&quot;http://php.net/pdo&quot;&gt;PDO&lt;/a&gt;; there are no userland dependencies. As an
added bonus, we have taken pains to make it PHP 5.3 compatible.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Sql_Query/tree/2.x&quot;&gt;Aura.Sql_Query&lt;/a&gt; is a package of SELECT, INSERT, UPDATE, and DELETE query
objects for MySQL, PostgreSQL, SQLite, and Microsoft SQL Server. It has no
dependencies at all, not even on PDO. You build your query with the object,
then pass it along to the database abstraction layer of your choice. Because
it uses traits, it is for PHP 5.4 and up.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Sql_Schema/tree/2.x&quot;&gt;Aura.Sql_Schema&lt;/a&gt; comprises “list tables” and “list columns” functionality
for MySQL, PostgreSQL, SQLite, and Microsoft. As with &lt;a href=&quot;https://github.com/auraphp/Aura.Sql/tree/2.x&quot;&gt;Aura.Sql-v2&lt;/a&gt;, its
only dependency is the native &lt;a href=&quot;http://php.net/pdo&quot;&gt;PDO&lt;/a&gt; (note, &lt;strong&gt;not&lt;/strong&gt; the Aura.Sql-v2
&lt;em&gt;ExtendedPdo&lt;/em&gt;). Also as with &lt;a href=&quot;https://github.com/auraphp/Aura.Sql/tree/2.x&quot;&gt;Aura.Sql-v2&lt;/a&gt;, it is PHP 5.3 compatible.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With this dedicated effort at decoupling and true independence, you can now
use &lt;em&gt;just&lt;/em&gt; the extended PDO connection object, &lt;em&gt;or&lt;/em&gt; the query objects, &lt;em&gt;or&lt;/em&gt;
the schema discovery tools, without having to download the others. Of course,
you can use them all in concert if you like.&lt;/p&gt;

&lt;p&gt;Let’s talk a little more about just the new &lt;a href=&quot;https://github.com/auraphp/Aura.Sql/tree/2.x&quot;&gt;Aura.Sql-v2&lt;/a&gt; package.&lt;/p&gt;

&lt;h3 id=&quot;aurasql-v2-the-extendedpdo-class&quot;&gt;Aura.Sql-v2: The ExtendedPdo Class&lt;/h3&gt;

&lt;p&gt;Instead of wrapping PDO, the &lt;em&gt;ExtendedPdo&lt;/em&gt; class extends PDO directly. Among
other things, this means you can drop it into any code already using PDO,
including methods and functions typhinted against PDO, with no changes.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;(N.b.: The only caveat here is that persistent connections may be an issue
with extensions of PDO. If you simply cannot do without persistent
connections, ExtendedPdo may not be for you.)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once you have replaced PDO with ExtendedPdo, you can begin to use the added
functionality in &lt;a href=&quot;https://github.com/auraphp/Aura.Sql/tree/2.x&quot;&gt;Aura.Sql-v2&lt;/a&gt; piece by piece.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Sql/tree/2.x#lazy-connection&quot;&gt;Lazy connection.&lt;/a&gt;&lt;/strong&gt; &lt;em&gt;ExtendedPdo&lt;/em&gt; connects to the database only on
method calls that require a connection. This means you can create an
instance and not incur the cost of a connection if you never make a query.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Sql/tree/2.x#bind-values&quot;&gt;Bind values.&lt;/a&gt;&lt;/strong&gt; You may provide values for binding to the next query
using &lt;code class=&quot;highlighter-rouge&quot;&gt;bindValues()&lt;/code&gt;. Multiple calls to &lt;code class=&quot;highlighter-rouge&quot;&gt;bindValues()&lt;/code&gt; will merge, not
reset, the values. The values will be reset after calling &lt;code class=&quot;highlighter-rouge&quot;&gt;query()&lt;/code&gt;,
&lt;code class=&quot;highlighter-rouge&quot;&gt;exec()&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;prepare()&lt;/code&gt;, or any of the &lt;code class=&quot;highlighter-rouge&quot;&gt;fetch*()&lt;/code&gt; methods. In addition,
binding values that do not have any corresponding placeholders will not
cause an error.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Sql/tree/2.x#array-quoting&quot;&gt;Array quoting.&lt;/a&gt;&lt;/strong&gt; The &lt;code class=&quot;highlighter-rouge&quot;&gt;quote()&lt;/code&gt; method will accept an array as input,
and return a string of comma-separated quoted values. In addition, named
placeholders in prepared statements that are bound to array values will be
replaced with comma-separated quoted values. This means you can bind an
array of values to a placeholder used with an &lt;code class=&quot;highlighter-rouge&quot;&gt;IN (...)&lt;/code&gt; condition.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Sql/tree/2.x#fetch-methods&quot;&gt;Fetch methods.&lt;/a&gt;&lt;/strong&gt; &lt;em&gt;ExtendedPdo&lt;/em&gt; provides several &lt;code class=&quot;highlighter-rouge&quot;&gt;fetch*()&lt;/code&gt; methods for
commonly-used fetch styles. For example, you can call &lt;code class=&quot;highlighter-rouge&quot;&gt;fetchAll()&lt;/code&gt; directly
on the instance instead of having to prepare a statement, bind values,
execute, and then fetch from the prepared statement. All of the &lt;code class=&quot;highlighter-rouge&quot;&gt;fetch*()&lt;/code&gt;
methods take an array of values to bind to to the query statement.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Exceptions by default.&lt;/strong&gt; &lt;em&gt;ExtendedPdo&lt;/em&gt; starts in the
&lt;code class=&quot;highlighter-rouge&quot;&gt;ERRMODE_EXCEPTION&lt;/code&gt; mode for error reporting instead of the &lt;code class=&quot;highlighter-rouge&quot;&gt;ERRMODE_SILENT&lt;/code&gt;
mode.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Sql/tree/2.x#profiler&quot;&gt;Profiler.&lt;/a&gt;&lt;/strong&gt; An optional query profiler is provided, along with an
interface for other implementations.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Sql/tree/2.x#connection-locator&quot;&gt;Connection locator.&lt;/a&gt;&lt;/strong&gt; A optional lazy-loading service locator is
provided for picking different database connections (default, read, and
write).&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All this functionality is the result of extracting three classes, plus interfaces and
exceptions, into their own independent package.&lt;/p&gt;

&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;If you are the kind of developer who likes clean code, fully decoupled
libraries, and truly independent packages, then you can see from the above
examples that &lt;a href=&quot;http://auraphp.com&quot;&gt;the Aura project&lt;/a&gt; is for you. Download a single library
package and start using it in your project today, with no added dependencies.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Lessons Learned From The Aura Project</title>
   <link href="http://auraphp.com/blog/2013/09/30/lessons-learned/"/>
   <updated>2013-09-30T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2013/09/30/lessons-learned</id>
   <content type="html">&lt;h2 id=&quot;tldr&quot;&gt;tl;dr&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;“Libraries first” is the way to go; it imposes good discipline&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Extracting is detailed work, but you get testable units&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;DependencyInjection is awesome …&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;… but in-library ServiceLocators can be useful&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;There are still lots of PHP 5.3 users&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;If you have server or session vars in your HTTP request object, it’s not an
HTTP request object&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Some packages are still too broad in scope&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;From PEAR to Composer&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;People love ORMs&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;New packages: Aura.Dispatcher, Aura.Includer, Aura.Sql_Query, and others&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;PHP 5.3 support in some new packages&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;

&lt;p&gt;As you may know, &lt;a href=&quot;http://auraphp.com&quot;&gt;Aura&lt;/a&gt; is essentially the second version of the &lt;a href=&quot;http://solarphp.com&quot;&gt;Solar&lt;/a&gt; framework. (The name change was to differentiate from the later-arriving but more well-known &lt;a href=&quot;https://lucene.apache.org/solr/&quot;&gt;Solr&lt;/a&gt;.)&lt;/p&gt;

&lt;p&gt;Whereas Solar was monolithic, Aura is primarily a series of completely independent libraries extracted from Solar. Each library in Aura is completely independent of the others. It also provides a system package that composes the various libararies into a full-stack framework.&lt;/p&gt;

&lt;p&gt;I present this article to give insight into some (but not all) of the lessons learned from the process of creating the Aura project packages.  (To list “all” would take way too long, and this article long enough already.)&lt;/p&gt;

&lt;h2 id=&quot;looking-back&quot;&gt;Looking Back&lt;/h2&gt;

&lt;h3 id=&quot;libraries-first-is-the-way-to-go&quot;&gt;“Libraries First” Is The Way To Go&lt;/h3&gt;

&lt;p&gt;Extracting libraries first, and only then going on to find a way to tie them together in a framework, was exactly the right approach.  Having the discipline to say that no one library could depend on any other changed the way we looked at how a framework should operate, and how the libraries should interact in a framework. It gave us libraries that can be used in &lt;em&gt;any&lt;/em&gt; system, not just an Aura system.&lt;/p&gt;

&lt;p&gt;Having said that, it was our practice to have a proof-of-concept framework system running along the way, so that we could test the tying-together process as we went.  As we realized what worked and what didn’t at the framework level, we were able to go back and revise the library so that it was more friendly in a shared system.&lt;/p&gt;

&lt;h3 id=&quot;extracting-is-detailed-work-but-you-get-testable-units&quot;&gt;Extracting Is Detailed Work, But You Get Testable Units&lt;/h3&gt;

&lt;p&gt;Just because the code to be extracted already exists, does not mean it’s easy to extract it. Since the original system was monolithic, tracing the dependencies and either extracting them or copying them was a time-consuming process. Because the original system did not have 100% test coverage, we needed to write unit tests for the newly extracted units. However, by extacting the units, it was actually &lt;em&gt;possible&lt;/em&gt; to write unit tests.&lt;/p&gt;

&lt;h3 id=&quot;dependencyinjection-is-awesome-&quot;&gt;DependencyInjection Is Awesome …&lt;/h3&gt;

&lt;p&gt;Solar used a variation of ServiceLocator for inversion of control. When you have control of the whole system, ServiceLocator is reasonable, but in a suite of completely independent libraries, using a ServiceLocator to coordinate them means introducing a dependency. That in turn means the packages are no longer independent of each other. This is why we setted on using DependencyInjection early in the project (and even then only after trying lots of different ServiceLocator variations).&lt;/p&gt;

&lt;p&gt;Using DependencyInjection for the libraries has been a complete and total win. Aside from having to change how you think about dependencies, the technique provides an unmitigated positive outcome.  The added bonus of having the &lt;a href=&quot;https://github.com/auraphp/Aura.Di&quot;&gt;Aura.Di&lt;/a&gt; DependencyInjection container to manage injections has likewise been of immense benefit.&lt;/p&gt;

&lt;h3 id=&quot;-but-in-library-servicelocators-can-be-useful&quot;&gt;… But In-Library ServiceLocators Can Be Useful&lt;/h3&gt;

&lt;p&gt;However, using a ServiceLocator &lt;em&gt;inside&lt;/em&gt; a library &lt;em&gt;only&lt;/em&gt; for the purposes of that library has turned out to be a reasonable approach.  For example, the helpers in &lt;a href=&quot;https://github.com/auraphp/Aura.View&quot;&gt;Aura.View&lt;/a&gt; are collected into a locator, and the locator is injected into the template object.  That particular locator is not reused outside the Aura.View package.&lt;/p&gt;

&lt;p&gt;Each package that ends up needing a locator gets its own, sometimes more than one depending on the service that needs to be located.  Obviously this is not &lt;a href=&quot;https://en.wikipedia.org/wiki/Don%27t_repeat_yourself&quot;&gt;DRY&lt;/a&gt; behavior.  The tradeoff is that you completely avoid the temptation to use a shared ServiceLocator across multiple packages, thereby introducing dependencies and reducing testability.&lt;/p&gt;

&lt;p&gt;(Incidentally, writing a ServiceLocator is dead simple in PHP 5.3 and later; perhaps that deserves a post of its own.)&lt;/p&gt;

&lt;h3 id=&quot;there-are-still-lots-of-php-53-users&quot;&gt;There Are Still Lots Of PHP 5.3 Users&lt;/h3&gt;

&lt;p&gt;The first major work on the Aura project started in Feb 2011. At that time, we targeted PHP 5.3, which had been out for quite a while.  When PHP 5.4 came out in Mar 2012, it was too hard to resist the new short array syntax and &lt;code class=&quot;highlighter-rouge&quot;&gt;callable&lt;/code&gt; typehint, so we changed the minimum PHP requirement to 5.4.  Adoption of PHP 5.4 has not been as quick as we thought it might be; we still get lots of requests for 5.3 versions of the packages.  Some folks have actually backported some of the packages to 5.3.&lt;/p&gt;

&lt;h3 id=&quot;you-keep-saying-http--i-do-not-think-it-means-what-you-think-it-means&quot;&gt;You Keep Saying “HTTP” – I Do Not Think It Means What You Think It Means&lt;/h3&gt;

&lt;p&gt;If you have representations of &lt;code class=&quot;highlighter-rouge&quot;&gt;$_ENV&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;$_SERVER&lt;/code&gt;, or &lt;code class=&quot;highlighter-rouge&quot;&gt;$_SESSION&lt;/code&gt; in your HTTP request object, it’s not an &lt;em&gt;HTTP&lt;/em&gt; request object.  The same goes for a wide range of other functionality.  An HTTP request is composed of headers and content, not server variables.  Your request object may be a &lt;em&gt;web&lt;/em&gt; request, or it may be a representation of the PHP execution context, but it’s not an HTTP request object.&lt;/p&gt;

&lt;p&gt;For us, providing an &lt;a href=&quot;https://github.com/auraphp/Aura.Web&quot;&gt;Aura.Web&lt;/a&gt; request object completely independent of an HTTP (proper) request object was a big win.  The web (not HTTP) response object, as a data-transfer object, being able to be translated to any other HTTP response, was also a big win for testability and separation of concerns.&lt;/p&gt;

&lt;h3 id=&quot;some-packages-still-too-broad-in-scope&quot;&gt;Some Packages Still Too Broad In Scope&lt;/h3&gt;

&lt;p&gt;We successfully made the split between bootstrapping (at the framework level), routing, front-controller dispatching, the actual controllers, and the HTTP request/response cycle; between command-line dispatching and the actual commands; between input modeling, input filtering, and form output generation; between session handling and everything else; and so on.&lt;/p&gt;

&lt;p&gt;However, it turns out that some packages can be split apart even more. For example, the &lt;a href=&quot;https://github.com/auraphp/Aura.Web&quot;&gt;Aura.Web&lt;/a&gt; package could easily have the web “request” and “response” objects (not to be confused with HTTP request/response) removed to their own package for reuse; likewise, the internal dispatching mechanism can be pulled out for reuse as well.  &lt;a href=&quot;https://github.com/auraphp/Aura.Sql&quot;&gt;Aura.Sql&lt;/a&gt;, &lt;a href=&quot;https://github.com/auraphp/Aura.Cli&quot;&gt;Aura.Cli&lt;/a&gt;, &lt;a href=&quot;https://github.com/auraphp/Aura.View&quot;&gt;Aura.View&lt;/a&gt;, and even parts of the framework itself have candidates for further extraction.&lt;/p&gt;

&lt;p&gt;The drive to put more functionality in a library can be unnoticeable, even when your explicit goal is to separate concerns, because you’re used to thinking about a problem in a certain way.  That can make it hard to see which pieces &lt;em&gt;may&lt;/em&gt; be delivered separately and which &lt;em&gt;must&lt;/em&gt; go togther.&lt;/p&gt;

&lt;h3 id=&quot;from-pear-to-composer&quot;&gt;From PEAR to Composer&lt;/h3&gt;

&lt;p&gt;When we started the project, &lt;a href=&quot;http://pear.php.net&quot;&gt;PEAR&lt;/a&gt; was still the package manager of record in PHP land.  We centered our release process around writing PEAR &lt;code class=&quot;highlighter-rouge&quot;&gt;package.xml&lt;/code&gt; files, based on the previous Solar release process.  When Composer came along, we tried for a while to target both packaging systems.  I will admit to dismissing Composer at first and trying very hard to make PEAR do what we wanted (I am as susceptible to inertia as anyone else ;-) but in the end Composer was much more suited to our needs.  (I say this as someone who has a long PEAR history and background.)&lt;/p&gt;

&lt;h3 id=&quot;people-love-orms&quot;&gt;People Love ORMs&lt;/h3&gt;

&lt;p&gt;Aura provides a DataMapper as part of &lt;a href=&quot;https://github.com/auraphp/Aura.Sql&quot;&gt;Aura.Sql&lt;/a&gt;, and a marshalling tool in &lt;a href=&quot;https://github.com/auraphp/Aura.Marshal&quot;&gt;Aura.Marshal&lt;/a&gt;, so you can build your own model layer any way you like.  But people (reasonably) want something to do all the work for them. We had &lt;code class=&quot;highlighter-rouge&quot;&gt;Solar_Sql_Model&lt;/code&gt; previously, and there’s been an expectation that we’ll provide something similar in Aura.&lt;/p&gt;

&lt;p&gt;Writing a &lt;em&gt;good&lt;/em&gt; ORM is exceptionally difficult, time-consuming, and detail-oriented. It is a huge time-sink and takes over your life.  It also turns out that an ORM is, by its nature, not something that is easy to decouple.  Finally, &lt;em&gt;using&lt;/em&gt; an ORM seems like heaven at first, until you reach the edges of its usability, and then like a Twilight Zone episode you realize you are actually in hell.&lt;/p&gt;

&lt;p&gt;So, not providing an ORM has been a mixed bag. We have been able to concentrate on other useful components without getting dragged down by writing an ORM.  On the other hand, there’s clearly a desire for them in the PHP world. The lack of an ORM package for Aura has been perceived as a negative by some people, even as they also note they want to do things their own way.&lt;/p&gt;

&lt;h2 id=&quot;looking-ahead&quot;&gt;Looking Ahead&lt;/h2&gt;

&lt;p&gt;As we improve on Aura v1 and begin work on Aura v2 libraries, here’s some of what we expect to do.&lt;/p&gt;

&lt;h3 id=&quot;further-extraction&quot;&gt;Further Extraction&lt;/h3&gt;

&lt;p&gt;As noted above, some packages have functionality candidates for extraction.&lt;/p&gt;

&lt;p&gt;We can derive an &lt;a href=&quot;https://github.com/auraphp/Aura.Dispatcher&quot;&gt;Aura.Dispatcher&lt;/a&gt; package from combined functionality of the &lt;a href=&quot;https://github.com/auraphp/Aura.Cli&quot;&gt;Aura.Cli&lt;/a&gt;, &lt;a href=&quot;https://github.com/auraphp/Aura.Web&quot;&gt;Aura.Web&lt;/a&gt;, and &lt;a href=&quot;https://github.com/auraphp/Aura.Framework&quot;&gt;Aura.Framework&lt;/a&gt; packages. This makes full-stack &lt;em&gt;and&lt;/em&gt; micro-framework dispatch styles available in a single package.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/auraphp/Aura.Web&quot;&gt;Aura.Web&lt;/a&gt; package can have its request/response objects extracted as well. At that point, because dispatching has been extracted, there’s no need for a base controller object in &lt;a href=&quot;https://github.com/auraphp/Aura.Web&quot;&gt;Aura.Web&lt;/a&gt;. Your own controllers become trivial to implement in any way you like. The same goes for &lt;a href=&quot;https://github.com/auraphp/Aura.Cli&quot;&gt;Aura.Cli&lt;/a&gt;, in that the &lt;em&gt;Context&lt;/em&gt; and &lt;em&gt;Stdio&lt;/em&gt; objects can live in a package of their own, leaving commands for independent implementation.&lt;/p&gt;

&lt;p&gt;The framework package has a technique for including configuration files from the various packages. This can be pulled out into a general-purpose &lt;a href=&quot;https://github.com/auraphp/Aura.Includer&quot;&gt;Aura.Includer&lt;/a&gt; package.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/auraphp/Aura.View&quot;&gt;Aura.View&lt;/a&gt; package currently has the helpers bound to it, but it turns out the helpers are easily extractable to their own &lt;a href=&quot;https://github.com/auraphp/Aura.Html&quot;&gt;Aura.Html&lt;/a&gt; package.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/auraphp/Aura.Sql&quot;&gt;Aura.Sql&lt;/a&gt; package is particularly interesting.  It seems like the database connection functions, query objects, and schema discovery functions all have to be bound together.  But, by moving some of the functionality around, it turns out they can be split up into their own independent packages.  Take a look at &lt;a href=&quot;https://github.com/auraphp/Aura.Sql/tree/2.x&quot;&gt;Aura.Sql-2.x&lt;/a&gt;, &lt;a href=&quot;https://github.com/auraphp/Aura.Sql_Query&quot;&gt;Aura.Sql_Query&lt;/a&gt;, and &lt;a href=&quot;https://github.com/auraphp/Aura.Sql_Schema&quot;&gt;Aura.Sql_Schema&lt;/a&gt; to see how we’re doing it.&lt;/p&gt;

&lt;h3 id=&quot;package-organization&quot;&gt;Package Organization&lt;/h3&gt;

&lt;p&gt;As you can see from the new packages, we expect to use &lt;a href=&quot;https://github.com/php-fig/fig-standards/blob/master/proposed/psr-4-autoloader/psr-4-autoloader.md&quot;&gt;PSR-4&lt;/a&gt; instead of &lt;a href=&quot;https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md&quot;&gt;PSR-0&lt;/a&gt;. This makes the &lt;code class=&quot;highlighter-rouge&quot;&gt;src/&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;tests/&lt;/code&gt; directories somewhat more shallow and easier to navigate.  We will be getting rid of the &lt;code class=&quot;highlighter-rouge&quot;&gt;meta/&lt;/code&gt; directory, since it was an artifact of attempting to maintain both PEAR and Composer packages.&lt;/p&gt;

&lt;h3 id=&quot;php-53&quot;&gt;PHP 5.3&lt;/h3&gt;

&lt;p&gt;Where reasonable, we will consider re-implementing functionality for PHP 5.3, but this is likely to be the case only for v2 libraries.&lt;/p&gt;

&lt;p&gt;This is something we’ve gone back-and-forth on, and it’s been a hard call.  Basically, if a library must have traits, it will be PHP 5.4 only; otherwise, we might try to use the old array syntax and avoid the &lt;code class=&quot;highlighter-rouge&quot;&gt;callable&lt;/code&gt; typehint for the sake of broader usability.&lt;/p&gt;

&lt;h2 id=&quot;thats-all-for-now&quot;&gt;That’s All For Now&lt;/h2&gt;

&lt;p&gt;There’s a lot of other stuff in the works, but that’s all we can discuss for now!  Join the &lt;a href=&quot;https://groups.google.com/forum/#!forum/auraphp&quot;&gt;mailing list&lt;/a&gt; and watch us on &lt;a href=&quot;http://twitter.com/auraphp&quot;&gt;Twitter&lt;/a&gt; for more updates.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Aura.Di And Testable Controllers</title>
   <link href="http://auraphp.com/blog/2013/09/23/aura-di-testable-controllers/"/>
   <updated>2013-09-23T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2013/09/23/aura-di-testable-controllers</id>
   <content type="html">&lt;p&gt;Brandon Savage mentions his use of &lt;a href=&quot;https://github.com/auraphp/Aura.Di&quot;&gt;Aura.Di&lt;/a&gt; in his blog post
&lt;a href=&quot;http://www.brandonsavage.net/the-myth-of-the-untestable-controller&quot;&gt;The Myth of the Untestable Controller&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Back when I was working on Zend Framework, controllers were
untestable.  They had lots of dependencies, many of which were
difficult if not impossible to mock. Testing a controller, at least in
isolation, was nearly impossible.&lt;/p&gt;

  &lt;p&gt;…&lt;/p&gt;

  &lt;p&gt;But the controller, being just an object, is as testable as you want
it to be.&lt;/p&gt;

  &lt;p&gt;In a small framework that I’ve written, the controller is entirely
testable. Dependencies are injected through use of a dependency
inversion container (&lt;a href=&quot;https://github.com/auraphp/Aura.Di&quot;&gt;Aura.Di&lt;/a&gt; in fact). These dependencies can be
effectively mocked. The controller is responsible for returning a
response object that is decoupled from an HTTP response which can be
inspected and evaluated for correctness.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Sounds like there’s some use of &lt;a href=&quot;https://github.com/auraphp/Aura.Web&quot;&gt;Aura.Web&lt;/a&gt; in there too.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Aura Framework -- Stable 1.0.0 System Release</title>
   <link href="http://auraphp.com/blog/2013/09/18/aura-framework-stable-system-release/"/>
   <updated>2013-09-18T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2013/09/18/aura-framework-stable-system-release</id>
   <content type="html">&lt;p&gt;The Aura “system” package, which combines a system skeleton and the Aura libraries into a full-stack framework, was released today at 1.0.0 stable. This makes it formally ready for production use (although it has been in production use informally for the past year or so).&lt;/p&gt;

&lt;p&gt;You can now start an Aura project with a single &lt;a href=&quot;http://getcomposer.org&quot;&gt;Composer&lt;/a&gt; command:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;composer create-project aura/system /path/to/your/project
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Take a look at the &lt;a href=&quot;http://auraphp.com/framework&quot;&gt;installation instructions&lt;/a&gt; for more information.&lt;/p&gt;

&lt;p&gt;It feels great to have both &lt;a href=&quot;http://auraphp.com/packages&quot;&gt;stable, decoupled, truly independent package libraries&lt;/a&gt; &lt;strong&gt;and&lt;/strong&gt; a system that integrates them into a framework. Many, many thanks to everyone involved who helped get us to this point.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>New Releases -- Input, Sql, View</title>
   <link href="http://auraphp.com/blog/2013/09/17/new-releases-input-sql-view/"/>
   <updated>2013-09-17T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2013/09/17/new-releases-input-sql-view</id>
   <content type="html">&lt;p&gt;On the heels of last week’s slew of releases, we have three followups!&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/auraphp/Aura.Input&quot;&gt;Aura.Input&lt;/a&gt; package got a feature-level bump to 1.1.0, with a new FormFactory. Thanks to Hari KT for championing that one.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Sql&quot;&gt;Aura.Sql&lt;/a&gt; is now at 1.3.0, due to lots of work from MAXakaWIZARD to provide SQLite- and PostgreSQL-specific query objects.&lt;/p&gt;

&lt;p&gt;Finally, the &lt;a href=&quot;https://github.com/auraphp/Aura.View&quot;&gt;Aura.View&lt;/a&gt; package got a bugfix and is now at 1.2.1; it handles content-type negotiation better for those times when there is no &lt;code class=&quot;highlighter-rouge&quot;&gt;Accept&lt;/code&gt; header.&lt;/p&gt;

&lt;p&gt;Take a look at &lt;a href=&quot;http://auraphp.com/packages&quot;&gt;all of the Aura packages here&lt;/a&gt; – each of them completely decoupled from the others, ready for you to use with no additional dependencies.&lt;/p&gt;

&lt;p&gt;Thanks to everyone who helped on these releases!&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>All Aura Libraries Now Stable</title>
   <link href="http://auraphp.com/blog/2013/09/11/all-libraries-now-stable/"/>
   <updated>2013-09-11T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2013/09/11/all-libraries-now-stable</id>
   <content type="html">&lt;p&gt;As of yesterday, the three remaining “Google Beta” libraries were marked as
stable and released:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Filter&quot;&gt;Aura.Filter&lt;/a&gt; provides validation
and sanitizing for data objects and arrays.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Input&quot;&gt;Aura.Input&lt;/a&gt; has tools to describe
and filter user inputs from an HTML form, including sub-forms/sub-fieldsets,
fieldset collections, an interface for injecting custom filter systems, and
CSRF protection.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Input&quot;&gt;Aura.Intl&lt;/a&gt; provides
internationalization (I18N) tools, specifically package-oriented per-locale
message translation.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This means all the Aura library packages are now stable, and formally ready
for production use.&lt;/p&gt;

&lt;h2 id=&quot;maintenance-and-feature-releases&quot;&gt;Maintenance and Feature Releases&lt;/h2&gt;

&lt;p&gt;In addition, we have issued releases of all the other Aura libraries. The
substantial changes were to these packages:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Aura.Http: (CHG) Transport now adds a ‘Close’ header when sending a request.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Aura.Router: (CHG) Route::attach() now works with an empty path.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Aura.Session: (CHG) Manager::destroy() now checks whether the session is
started; if not, starts it, and then destroys. (This is because sessions are
lazy-loading in Aura.)&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Aura.Sql:&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;
        &lt;p&gt;(ADD) Profiler::getLastQuery() to get the last profiled query.&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;(CHG) AbstractConnection::fetchAll(), fetchAssoc(), fetchCol(), and
fetchPairs() all now take a third param: a callable to apply to each row
in the results.&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;(NEW) Query\Mysql classes to support MySQL-specific functionality:&lt;/p&gt;

        &lt;ul&gt;
          &lt;li&gt;
            &lt;p&gt;(NEW) Query\Mysql\Select with &lt;code class=&quot;highlighter-rouge&quot;&gt;SQL_CALC_FOUND_ROWS&lt;/code&gt; and other
mysql-specific flags.&lt;/p&gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;p&gt;(NEW) Query\Mysql\Insert with &lt;code class=&quot;highlighter-rouge&quot;&gt;IGNORE&lt;/code&gt; and other mysql-specific
flags.&lt;/p&gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;p&gt;(NEW) Query\Mysql\Update with &lt;code class=&quot;highlighter-rouge&quot;&gt;IGNORE&lt;/code&gt; and other mysql-specific
flags, as well as LIMIT functionality.&lt;/p&gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;p&gt;(NEW) Query\Mysql\Delete with LOW_PRIORITY and other mysql-specific
flags, as well as LIMIT functionality.&lt;/p&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Aura.View:&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;
        &lt;p&gt;(CHG) Escaper\Object now recursively escapes arrays instead of
converting to ArrayObject and wrapping in an escaper&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;(ADD) TwoStepView::getTemplate() to get the template out of the view&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;(NEW) Helper\Form\Checkboxes&lt;/p&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;package-documentation-and-new-manual&quot;&gt;Package Documentation and New Manual&lt;/h2&gt;

&lt;p&gt;We have reorganized the package documentation somewhat; instead of keeping
API docs in the &lt;code class=&quot;highlighter-rouge&quot;&gt;gh-pages&lt;/code&gt; branch of each library repository, we are now
pushing them to the main site repo. It turns out this is easier for site
maintenance in many ways, not least of which is keeping a consistent look and
feel for the site.&lt;/p&gt;

&lt;p&gt;In addition, we have incorporated a new
&lt;a href=&quot;http://auraphp.com/framework/1.x/en/&quot;&gt;manual&lt;/a&gt;. Many thanks to Hari KT for
putting that together.&lt;/p&gt;

&lt;h2 id=&quot;the-future&quot;&gt;The Future!&lt;/h2&gt;

&lt;p&gt;The next step is to make a stable Framework and system release. After that, we
can review our initial goals to check our progress. Finally, in addition to
maintaining the v1 libraries, we can begin thinking about how to move toward
Aura v2 to take advantage of the current state of PHP.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>New Site, New Logo, and New Releases</title>
   <link href="http://auraphp.com/blog/2013/05/09/new-site-logo-releases/"/>
   <updated>2013-05-09T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2013/05/09/new-site-logo-releases</id>
   <content type="html">&lt;p&gt;Last week we updated the project site layout with a variation on &lt;a href=&quot;http://twitter.github.io/bootstrap/&quot;&gt;Bootstrap&lt;/a&gt;
called &lt;a href=&quot;http://bootswatch.com/spacelab/&quot;&gt;Spacelab&lt;/a&gt;, and incorporated our new &lt;a href=&quot;http://auraphp.com/img/aura-logo-black.png&quot;&gt;logo&lt;/a&gt;. Along with that, over
the past few weeks, we have been quietly releasing updated versions of all our
library &lt;a href=&quot;http://auraphp.com/packages&quot;&gt;packages&lt;/a&gt;. Many thanks to everyone who contributed; you should try one
out today!&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>New System Release, Including Aura.Framework and Aura.Demo</title>
   <link href="http://auraphp.com/blog/2012/12/18/new-system-release/"/>
   <updated>2012-12-18T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2012/12/18/new-system-release</id>
   <content type="html">&lt;p&gt;Late last night we released version 1.0.0-beta4 of the full-stack &lt;a href=&quot;http://auraphp.github.com/system&quot;&gt;system&lt;/a&gt;,
which composes all the independent Aura packages into a coherent framework
using the &lt;a href=&quot;http://auraphp.github.com/Aura.Framework&quot;&gt;Aura.Framework&lt;/a&gt; package in a project skeleton. We have extracted
the “hello world” portions into their own &lt;a href=&quot;http://auraphp.github.com/Aura.Demo&quot;&gt;Aura.Demo&lt;/a&gt; package so that it can
be removed or disabled when you begin your project. &lt;a href=&quot;http://auraphp.github.com/system/downloads/auraphp-system-1.0.0-beta4.tgz&quot;&gt;Download&lt;/a&gt; it and take
it for a spin!&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Aura.Micro -- Experimental Replacement for Silex</title>
   <link href="http://auraphp.com/blog/2012/12/14/aura-micro-experimental-replacement-for-silex/"/>
   <updated>2012-12-14T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2012/12/14/aura-micro-experimental-replacement-for-silex</id>
   <content type="html">&lt;p&gt;Micro-frameworks have gotten a lot of attention in the PHP community over the
last year. Many people are familiar with &lt;a href=&quot;http://silex.sensiolabs.org&quot;&gt;Silex&lt;/a&gt;, the extremely popular
micro-framework built on top of Symfony Components. There’s something really
elegant about the way you can write a quick little application with a micro-framework.&lt;/p&gt;

&lt;p&gt;I was recently working on a small project that used &lt;a href=&quot;http://silex.sensiolabs.org&quot;&gt;Silex&lt;/a&gt;. 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.&lt;/p&gt;

&lt;p&gt;When I think about going lean I always find myself coming back to Aura.
&lt;a href=&quot;http://auraphp.github.com/2012/06/20/aura-router-also-as-micro-framework/&quot;&gt;Micro-frameworks are not a new to idea to Aura&lt;/a&gt;, so I wondered if
I could take the elegance and ease of Silex by wrapping up &lt;a href=&quot;https://github.com/auraphp/Aura.Router&quot;&gt;Aura.Router&lt;/a&gt; and
exposing it through a similar API. The result is &lt;a href=&quot;http://github.com/stanlemon/aura-micro&quot;&gt;Aura.Micro&lt;/a&gt;, a light
wrapper for Aura.Router to get a Silex-style API.&lt;/p&gt;

&lt;p&gt;A couple of things are worth noting:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;First, this is just an experiment and I had no intention of 100% parity with
Silex. Silex is built onto Pimple, mixing the ideas of a micro-framework and
a service locator. Aura.Micro is just a micro-framework for quick and easy
web application routing.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Second, I very intentionally decided to make Aura.Router the &lt;strong&gt;only
dependency&lt;/strong&gt; for Aura.Micro. This means that rather than leverage
&lt;a href=&quot;https://github.com/auraphp/Aura.Signal&quot;&gt;Aura.Signal&lt;/a&gt; or &lt;a href=&quot;https://github.com/auraphp/Aura.Di&quot;&gt;Aura.Di&lt;/a&gt; (both really awesome libraries!), or even some
other Event and Dependency Injection libraries, I added a super-light
callback system to provide methods like &lt;code class=&quot;highlighter-rouge&quot;&gt;$app-&amp;gt;before()&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;$app-&amp;gt;after()&lt;/code&gt;
and &lt;code class=&quot;highlighter-rouge&quot;&gt;$app-&amp;gt;finish()&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;$app-&amp;gt;error()&lt;/code&gt;. I completely ignored pieces
like the Silex service providers.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So what does Aura.Micro look like in practice?&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$app&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Aura\Micro\Micro&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;before&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Running before&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;PHP_EOL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;after&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Running after&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;PHP_EOL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;finish&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Running finish&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;PHP_EOL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Error&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;PHP_EOL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/test&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Testing&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;PHP_EOL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/hello/&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;:world&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$world&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Hello &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$world&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;PHP_EOL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;You can clone &lt;a href=&quot;http://github.com/stanlemon/aura-micro&quot;&gt;Aura.Micro&lt;/a&gt; from GitHub or drop the following into your
&lt;code class=&quot;highlighter-rouge&quot;&gt;composer.json&lt;/code&gt; file:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;{
    &quot;repositories&quot;: [
        {
            &quot;type&quot;: &quot;vcs&quot;,
            &quot;url&quot;: &quot;http://github.com/stanlemon/aura-micro&quot;
        }
    ],
    &quot;require&quot;: {
        &quot;stanlemon/aura-micro&quot;: &quot;*&quot;
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Have ideas on how to improve this little wrapper? Add an issue or send over a
pull request!&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Aura Is More Decoupled Than ZF2 and Symfony2</title>
   <link href="http://auraphp.com/blog/2012/12/11/aura-more-decoupled-than-zf2-and-symfony2/"/>
   <updated>2012-12-11T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2012/12/11/aura-more-decoupled-than-zf2-and-symfony2</id>
   <content type="html">&lt;p&gt;PHP Magazin published a followup interview with Paul M. Jones about Aura,
regarding decoupled components in Zend Framework 2 and Symfony 2.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Being able to use Symfony2 components or ZF2 modules is not quite the
distinction I am making. The distinction is that all Aura packages (with
the exception of the Framework package) are completely independent, and
have no cross-package dependencies, whereas at least some of the
components from Symfony2 and ZF2 have dependency requirements.&lt;/p&gt;

  &lt;p&gt;By way of comparison, let’s examine something that ought to be relatively
straightforward: input validation and filtering. We’ll start with ZF2,
then move on to Symfony2, and end with Aura. In each case, we will try to
download the package and run its tests; this should be a good indicator of
whether or not the package can be used independently. We will discover
that you can’t do it at all with ZF2, you can kind of do it with Symfony2,
and that it’s trivially easy with Aura.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Read the full English translation of the interview here:
&lt;a href=&quot;http://paul-m-jones.com/archives/4176&quot;&gt;http://paul-m-jones.com/archives/4176&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>How Is Aura Better Than (er, Different From ;-) Symfony and Zend?</title>
   <link href="http://auraphp.com/blog/2012/12/06/how-is-aura-better/"/>
   <updated>2012-12-06T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2012/12/06/how-is-aura-better</id>
   <content type="html">&lt;p&gt;PHP Magazin published an interview with Paul M. Jones about the Aura project.
Read about it here: &lt;a href=&quot;http://paul-m-jones.com/archives/4152&quot;&gt;http://paul-m-jones.com/archives/4152&lt;/a&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>First Stable 1.0.0 Library Releases</title>
   <link href="http://auraphp.com/blog/2012/11/12/first-stable-releases/"/>
   <updated>2012-11-12T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2012/11/12/first-stable-releases</id>
   <content type="html">&lt;p&gt;The &lt;a href=&quot;http://auraphp.github.com&quot;&gt;Aura Project for PHP 5.4&lt;/a&gt; is happy to announce
its first release of 1.0.0 stable library packages. The packages include:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Autoload&quot;&gt;Aura.Autoload&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Cli&quot;&gt;Aura.Cli&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Di&quot;&gt;Aura.Di&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Http&quot;&gt;Aura.Http&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Marshal&quot;&gt;Aura.Marshal&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Router&quot;&gt;Aura.Router&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Signal&quot;&gt;Aura.Signal&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Sql&quot;&gt;Aura.Sql&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Uri&quot;&gt;Aura.Uri&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.View&quot;&gt;Aura.View&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Web&quot;&gt;Aura.Web&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In addition, we have initial beta releases of three new library packages:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Filter&quot;&gt;Aura.Filter&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Intl&quot;&gt;Aura.Intl&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/auraphp/Aura.Session&quot;&gt;Aura.Session&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each library package is independent of all the others, so you can pick and
choose which ones you want to use. With few exceptions, each class in each
package has 100% PHPUnit test coverage. Each package has a full README for
getting started. They all have a &lt;code class=&quot;highlighter-rouge&quot;&gt;composer.json&lt;/code&gt; file and are registered at
&lt;a href=&quot;https://packagist.org/search/?q=aura&quot;&gt;Packagist&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;While the above packages are completely independent of each other, Aura also
has a &lt;a href=&quot;https://github.com/auraphp/Aura.Framework&quot;&gt;Framework&lt;/a&gt; package that
binds them all together. Releasing the next version of that Framework and
system skeleton is the next thing for us to do.&lt;/p&gt;

&lt;p&gt;You can learn more about the Aura Project at &lt;a href=&quot;http://auraphp.github.com&quot;&gt;http://auraphp.github.com&lt;/a&gt;, and
please be sure to join our mailing list at
&lt;a href=&quot;http://groups.google.com/group/auraphp&quot;&gt;http://groups.google.com/group/auraphp&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Contributing to Aura Project</title>
   <link href="http://auraphp.com/blog/2012/07/13/contributing-to-aura-project/"/>
   <updated>2012-07-13T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2012/07/13/contributing-to-aura-project</id>
   <content type="html">&lt;p&gt;Sometimes you may have noticed a bug, or need a feature implemented, and need to contribute back to the aura community. These are some of the steps to help / contribute to aura project.&lt;/p&gt;

&lt;p&gt;#Set Up Git
First you need git and a github account. If you are new to git and github the &lt;a href=&quot;https://help.github.com/articles/set-up-git&quot;&gt;guide set up git&lt;/a&gt; will help you.&lt;/p&gt;

&lt;p&gt;#Fork A Repo&lt;/p&gt;

&lt;p&gt;Now you need to fork the repo you want to contribute. Here is a detailed guide on how to &lt;a href=&quot;https://help.github.com/articles/fork-a-repo&quot;&gt;fork a repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this example we will be using Aura.Web as the repo you need to fork and make the necessary changes(bug/features) and give a PR (Pull Request).&lt;/p&gt;

&lt;p&gt;Point your browser to https://github.com/auraphp/Aura.Web and click fork. Now the repo will be in your github account.&lt;/p&gt;

&lt;p&gt;Eg : &lt;code class=&quot;highlighter-rouge&quot;&gt;https://github.com/your-username/Aura.Web&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now you need to clone to your local system.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone git@github.com:username/Aura.Web.git

cd Aura.Web
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;All &lt;code class=&quot;highlighter-rouge&quot;&gt;Aura.Package&lt;/code&gt; has &lt;code class=&quot;highlighter-rouge&quot;&gt;master&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;develop&lt;/code&gt; branch. The &lt;code class=&quot;highlighter-rouge&quot;&gt;master&lt;/code&gt; points to the current or latest release. All the development activities goes in develop branch. There will be different tags for each release. So if you want to give a PR for a bug/feature then you create a branch from develop.&lt;/p&gt;

&lt;p&gt;Lets see in which branch you are in ( $ represents the terminal )&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ git branch
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Will list the local branches. For eg something like&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;*master
develop
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now you can checkout to develop branch like&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ git checkout develop 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Lets check on which branch we are&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ git branch

* develop
master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Lets add the remote repo as upstream (https://github.com/auraphp/Aura.Web)&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ git remote add upstream https://github.com/auraphp/Aura.Web.git
# Pulls in changes not present in your local repository, without modifying your files
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Never commit directly to &lt;code class=&quot;highlighter-rouge&quot;&gt;master&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;develop&lt;/code&gt; branches. Always create a new branch and give a PR. Lets see how we can do. 
Lets create another branch and do our experiments.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ git checkout -b experimental

Switched to a new branch 'experimental'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This has created a branch from your current branch(in this case &lt;code class=&quot;highlighter-rouge&quot;&gt;develop&lt;/code&gt;)&lt;/p&gt;

&lt;p&gt;Now you can do your experiments and commit the changes. In the mean time the develop branch of auraphp would have received many commits. So you may want to merge the changes.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ git fetch upstream
# Pulls in changes not present in your local repository, without modifying your files
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you want to merge the commits from the upstream/branch , to your current branch you can do like&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ git merge upstream/develop
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Sometimes there can be conflicts and you may want to resolve and commit manually.&lt;/p&gt;

&lt;p&gt;Before you push your branch to your github account remember to run &lt;code class=&quot;highlighter-rouge&quot;&gt;phpunit&lt;/code&gt; and check the PSR-1, PSR-2 by running PHP_CodeSniffer.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ git push -u origin experimental
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Once you have pushed give a PR to the develop branch if its a feature/changes.&lt;/p&gt;

&lt;p&gt;#Running PHPUnit
I assume you have already installed &lt;code class=&quot;highlighter-rouge&quot;&gt;phpunit&lt;/code&gt; . If not, have a look into &lt;a href=&quot;http://www.phpunit.de/manual/current/en/installation.html&quot;&gt;installing phpunit&lt;/a&gt; . From the tests folder run &lt;code class=&quot;highlighter-rouge&quot;&gt;phpunit&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd tests
$ phpunit
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;#Running PHP_CodeSniffer&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ git clone git://github.com/squizlabs/PHP_CodeSniffer.git
$ cd PHP_CodeSniffer
$ php scripts/phpcs -h
$ php scripts/phpcs --standard=PSR1 path-to-Aura.Web/src
$ php scripts/phpcs --standard=PSR2 path-to-Aura.Web/src
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can also install via pear. For more information look into https://github.com/squizlabs/PHP_CodeSniffer&lt;/p&gt;

&lt;p&gt;The core team has direct push/pull access but still its a good idea that &lt;a href=&quot;https://github.com/pmjones&quot;&gt;Paul M Jones&lt;/a&gt; do the merge. We will discuss about the PR, why the changes needed etc.&lt;/p&gt;

&lt;p&gt;Thanks for being with Aura and we love to see your contributions. If you have any queries feel free to comment below or create an issue or talk in #auraphp irc freenode or in &lt;a href=&quot;https://groups.google.com/group/auraphp&quot;&gt;https://groups.google.com/group/auraphp&lt;/a&gt; or tweet to &lt;a href=&quot;http://twitter.com/auraphp&quot;&gt;@auraphp&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you are new to irc, you can use &lt;a href=&quot;http://www.pidgin.im/&quot;&gt;pidgin&lt;/a&gt; or &lt;a href=&quot;http://xchat.org/&quot;&gt;x-chat&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Aura Team&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Aura.Router can also be used as a micro-framework dispatcher!</title>
   <link href="http://auraphp.com/blog/2012/06/20/aura-router-also-as-micro-framework/"/>
   <updated>2012-06-20T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2012/06/20/aura-router-also-as-micro-framework</id>
   <content type="html">&lt;p&gt;Sometimes you may wish to use Aura as a micro-framework. It’s also possible to assigning anonymous function to controller:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$map&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;read&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/blog/read/&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;:id}{:format&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;params&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;id&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;(\d+)&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;format&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;(\..+)?&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;values&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;controller&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;nv&quot;&gt;$id&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Reading blog ID &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$id&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;format&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;.html&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;When you are using Aura.Router as a micro-framework, the dispatcher will look something similar to the one below:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$params&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$route&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$controller&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;controller&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;unset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;controller&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$controller&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Via &lt;a href=&quot;http://phpmaster.com/web-routing-in-php-with-aura-router/&quot;&gt;Web Routing in PHP with Aura.Router&lt;/a&gt;. 
The Aura project for PHP 5.4 codebase is &lt;a href=&quot;https://github.com/auraphp&quot;&gt;https://github.com/auraphp&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Slides from Decoupled Library Packages for PHP 5.4 at PHP | Tek 12</title>
   <link href="http://auraphp.com/blog/2012/05/25/slides-from-talk-decoupled-library-packages-for-php/"/>
   <updated>2012-05-25T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2012/05/25/slides-from-talk-decoupled-library-packages-for-php</id>
   <content type="html">&lt;p&gt;Below are the slides from the talk given by Paul M Jones at PHP Tek 12.
If you were there, please give feedback on the talk: &lt;a href=&quot;http://joind.in/talk/view/6495&quot;&gt;http://joind.in/talk/view/6495&lt;/a&gt;.&lt;/p&gt;

&lt;iframe src=&quot;http://www.slideshare.net/slideshow/embed_code/13065200&quot; width=&quot;425&quot; height=&quot;355&quot; frameborder=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
</content>
 </entry>
 
 <entry>
   <title>Writing / Sharing your experience with Aura</title>
   <link href="http://auraphp.com/blog/2012/05/18/writing-blog-post-for-aura/"/>
   <updated>2012-05-18T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2012/05/18/writing-blog-post-for-aura</id>
   <content type="html">&lt;p&gt;When you play with aura components, sometimes you may have faced some technical difficulties which people may have never faced. Its always hard to remember what all things we did to resolve it. In such cases we write small snippets of code either in blog or as pastie for future reference. Its a good habit to share stuffs that we learn. There can be better way to do other than that also.&lt;/p&gt;

&lt;p&gt;If you like to share something on aura components, you can share here.&lt;/p&gt;

&lt;p&gt;#How can you write posts on aura blog?&lt;/p&gt;

&lt;p&gt;Fork https://github.com/auraphp/auraphp.github.com&lt;/p&gt;

&lt;p&gt;Add your post to the &lt;code class=&quot;highlighter-rouge&quot;&gt;_posts&lt;/code&gt; directory with naming convention as&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;yyyy-mm-dd-url-of-post&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Open it on your favourite editor and post&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;---
layout: post
category : category-name
tags : [tags]
---
    
Contents. If you want to highlight some code snippets add 4 spaces in front of it.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can see the examples over https://github.com/auraphp/auraphp.github.com/tree/master/_posts&lt;/p&gt;

&lt;p&gt;Now commit and push to your repository and and initiate a Pull Request.&lt;/p&gt;

&lt;p&gt;We will verify it and publish …. Easy right ?&lt;/p&gt;

&lt;p&gt;Then why are you waiting ? Start writing :-) .&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Finally blog is here</title>
   <link href="http://auraphp.com/blog/2012/05/17/finally-blog-is-here/"/>
   <updated>2012-05-17T00:00:00UTC</updated>
   <id>hhttp://auraphp.com/blog/2012/05/17/finally-blog-is-here</id>
   <content type="html">&lt;p&gt;So finally we have a blog for aura project. We are happy to set the blog before Beta-3. We have some shiny new feature coming for Aura.Http, Aura.View components. Stay tuned for the upcoming Beta-3 release in coming days.&lt;/p&gt;

&lt;p&gt;In the mean time if you are new to aura, we welcome you to join irc of #auraphp channel in freenode. You can also join google groups.&lt;/p&gt;

&lt;p&gt;Hari K T&lt;/p&gt;
</content>
 </entry>
 

</feed>
