Skip to content

rawebone/Wilson

Wilson

Author Latest Version Software License Build Status HHVM Status Coverage Status Quality Score Total Downloads SensioLabs Insight

Wilson is a PHP micro framework designed for simplicity and performance. It main features are:

  • Annotation based routing
  • Middleware
  • Service Location
  • HTTP Request/Response abstraction
  • HTTP Caching
  • Unit Testing

Its design is based around the Slim and Symfony frameworks, combining elements of both with the goal of creating system which is fast, correct, well documented, and simple.

Usage

At a glance, an application in the framework looks like this:

<?php

// File: public/index.php

require_once "/path/to/vendor/autoload.php";

$api = new Wilson\Api();
$api->resources = array("My\Restful\ResourceA");
$api->dispatch();
<?php

// File: src/My/Restful/ResourceA.php

namespace My\Restful;

class ResourceA
{
    /**
     * @route GET /resource-a/
     */
    function getCollection($request, $response, $services)
    {
        $response->json(array("a", "b", "c"));
    }
    
    /**
     * @route GET /resource-a/{file}.md
     * @where file [a-z]+
     */
    function getRecord($request, $response, $services)
    {
        $response->setBody(get_file($request->getParam("file")));
        $response->setHeader("Content-Type", "text/plain");
    }
}

Look at the wiki for a proper guide through the functionality.

Credits

This framework is a patchwork consisting of the ideas and pieces of code from numerous other projects:

  • Josh Lockhart and other contributors to Slim Framework
  • Fabien Potencier and other contributors to Symfony
  • Matthew Weier O'Phinney and other contributors to phly/http

License

The code is under the MIT license. Third party code licences:

About

A PHP micro framework designed for simplicity and performance

Resources

License

MIT and 3 other licenses found

Licenses found

MIT
LICENSE
BSD-2-Clause
LICENSE.PHLY
MIT
LICENSE.SLIM
MIT
LICENSE.SYMFONY

Stars

Watchers

Forks

Packages

No packages published

Languages