Letters from Lithium #2

About

Letters from Lithium keeps you up to date about what happens in the Lithium core and community. If you have interesting news to share, comment below or ping me on twitter.

Core News

Routing got a bit more awesome with route continuations. They allow you match more routes in one request, which is very useful in many cases. Take a look at this test case:

/**
* Tests that continuation routes properly fall through and aggregate multiple route parameters.
*/
public function testRouteContinuations() {
    Router::connect('/{:locale:en|de|it|jp}/{:args}', array(), array('continue' => true));
    Router::connect('/{:controller}/{:action}/{:id:[0-9]+}');

    $request = new Request(array('url' => '/en/posts/view/1138'));
    $result = Router::process($request)->params;
    $expected = array (
        'controller' => 'posts', 'action' => 'view', 'id' => '1138', 'locale' => 'en'
    );
    $this->assertEqual($expected, $result);
}

The data branch has been merged recently, which should improve the overall stability of the model layer and add a few smaller features. Thanks to Veselin Todorov, you can now use the “last” option in validations. This lets you better control the validation stack.

Richard McIntyre added console environment detection and Nate Abele improved the application detection process.

Of course, various other bugs have been fixed (including the HMAC bug) and small enhancements like collection sorting and Form::error() filtering found their way into the core.

Plugins

eLod (also known as “smoking_kiddo” on IRC) created a plugin called li3_console which provides a fully functional PHP REPL and also lets you interact with your Lithium environment (like models) from the command line.

If you need to deploy your Lithium application to remote servers and are used to Capistrano, you should take a look at capium. It is a ruby gem that provides deploy recipes and rake tasks for Lithium.

Blogs and Media

For those new to Lithium, David Golding recently published a very informative introduction here. It gets you up and running quickly and walks you through the creation of models, controllers and views.

Also, James Fuller released a few blog posts in the last weeks, covering various topics around Lithium. Head over to his blog and read about Flash Messages, the FormHelper, Web Service Calls, Filters and AppControllers.

Universe

Recently, Engine Yard (mostly known for their knowledge and cloud platforms in the Ruby on Rails world) acquired Orchestra to extend their language support. Orchestra is a great platform to deploy your PHP and Lithium applications on to, so give it a try (they also provide free accounts) if you haven’t already. The manual also provides a short guide if you need help.

Ciaro Vermeire started a (unofficial) community forum for Lithium, which you can find here. If you like this type of communication, feel free to register, ask for help and - most importantly - share what you know.

comments powered by Disqus