This release is to remind about the phpworld conference happening at Washington DC. If you are there Paul M Jones, the creator and lead on Aura, is giving talks on It Was Like That When I Got Here: Steps Toward Modernizing a Legacy Codebase and Action-Domain-Responder: A Web-Specific Refinement of MVC. Check out the schedule.

Releases

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.

Aura.Accept

Aura.Accept as extracted from Aura.Web got stable release.

An example how you could make use of content-negotiation is shown below.

<?php
// assume the request indicates these Accept values (XML is best, then CSV,
// then anything else)
$_SERVER['HTTP_ACCEPT'] = 'application/xml;q=1.0,text/csv;q=0.5,*;q=0.1';

// create the accept factory
$accept_factory = new AcceptFactory($_SERVER);

// create the accept object
$accept = $accept_factory->newInstance();

// assume our application has `application/json` and `text/csv` available
// as media types, in order of highest-to-lowest preference for delivery
$available = array(
    'application/json',
    'text/csv',
);

// get the best match between what the request finds acceptable and what we
// have available; the result in this case is 'text/csv'
$media = $accept->negotiateMedia($available);
echo $media->getValue(); // text/csv

Consider looking into the docs for more information

Aura.Di

Aura.Di 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 issue 68

  • Add Container::setAutoResolve(), Factory::setAutoResolve(), etc. to allow disabling of auto-resolution

  • When auto-resolution is disabled, Factory::newInstance() now throws Exception\MissingParam when a constructor param has not been defined

  • ContainerBuilder::newInstance() now takes a third param to enable/disable auto-resolution

  • AbstractContainerTest now allows you to enable/disable auto-resolve for the tests via a new getAutoResolve() method

Consider looking into the docs for more information

Aura.Auth

Aura.Auth released beta-2.

The PdoAdapter::buildSelectWhere() now honors the custom column name provided by the user.

<?php
$auth_factory = new \Aura\Auth\AuthFactory($_COOKIE);
$pdo = new \PDO(...);
$hash = new PasswordVerifier(PASSWORD_BCRYPT);
$cols = array('username', 'md5password');
$from = 'accounts';
$pdo_adapter = $auth_factory->newPdoAdapter($pdo, $hash, $cols, $from);

How to make use of OAuth Adapters is documented. Thanks to Frost

Before it is too late please give your feedback on remember me functionality.

Aura.Router

Aura.Router getting more awesome!

  • 2.1.0 : Added Router::generateRaw() to generate routes with raw data.

  • 2.1.1 : Fixed allow simplest possible match of a single Accept header type without a Q value.

  • 2.2.0 : Allow easier specification of $values[‘action’] directly from RouteCollection::add*() by passing a third param as the action value.

<?php
$router->add(
    'say_hello',
    '/hello/{name}',
    function ($params) {
        // Do the needful escaping
        echo "Hello " . $params['name'];
    });

Aura.Project_Kernel

Aura.Project_Kernel now have Factory::newKernel() and Factory::newContainer() have an added param, $auto_resolve, to allow you enable/disable auto-resolution in the container.

Other Releases

Other libraries that got doc update, turn off auto-resolution in tests and other minor issues fixed are:

Framework documentation

Added Quick start tutorial without database connectivity for Version 2. The framework documentation has been updated. If you find something missing open an issue or send pull requests

Other tutorials

Some were confused on the usage of Aura.View and Aura.Html so we have https://github.com/harikt/AuraViewExample

How to make use of Aura.Router and Aura.Dispatcher https://github.com/harikt/router-dispatcher

Conclusion

Thanks to the many contributors in the Aura community who made these releases possible!

Subscribe and get latest updates by email

Enter your email address:

Delivered by FeedBurner

blog comments powered by Disqus