Fork me on GitHub

Powerstack a new powerful PHP 5 web framework that aims to provide a good base for rapid application development and prototyping.

Currently Powerstack is still in active development with a stable release due soon.
We are looking for any input or ideas so we can deliver an opensource web framework for everyone, from beginners to full time developers.


Powerstack is a full featured framework that draws on some of the most popular frameworks out there. Powerstack mainly draws ideas from Dancer a perl web framework.

Powerstack includes a very powerful plugin and hooks system, this make it very easy to extend the core functionality or provide your own custom functionality.

The most interesting and cool thing in Powerstack is how you define your routes/urls. It uses a similar system to that in Dancer.
This makes creating Restful web applications easy and straight forward.


In a Powerstack application you have a main route file which defines all your routes and what each route does.
This is a similar to controllers in MVC frameworks.

    // Hello world using Powerstack
    $app->get('/', function($request, $params) {
        echo "Hello world";

The above example defines the route for "/" which is the root route/url.
$app is the global application object the get() function handles HTTP GET Requests.
There are also functions for POST, PUT, DELETE. All these functions take take a string for the route and a callback function as parameters.
There is also an any() function the takes an array of HTTP Request methods followed by the route and callback function.
This means it doesn't take to long to put together an app.


Also a handy thing is the ability to have routes with placeholders.
This can be quite handy for Restful applications.

    $app->get('/:name', function($request, $params) {
        echo "Hello " . $params['name'];

The example above has a placeholder in the route. The value from the placeholder is accessible via the $params array.
Basically if you went "/jim" the page would say "Hello jim".


The config file for your application is a yaml file. That looks like so:

    name: Powerstack
    version: 1.0
        name: Name
        email: Email

    engine: twig
    viewsdir: app/views
            file: app/views/layouts/default.tpl

    engine: simple
    savepath: /tmp/sessions


        driver: pgsql | mysql | sqlite
        host: localhost
        name: Database Name
        user: Database Username
        pass: Database Password
        port: Database Port

        publickey: recaptcha public key
        privatekey: recaptcha private key
        ssl: false

        domain: piwik domain
        siteid: piwik siteid

        salt: 22 character salt

    # Debug mode should only be used for development!!!!!!!!!
    debug: true

The above example config file shows some of the options available.
All the value are available through the global $config variable.

    // Output Welcome to Powerstack
    $app->get('/', function($request, $params) {
        $appconf = config('application');
        echo "Welcome to " . $appconf->name;

More Info

Currently Powerstack is still in the development stage. But hopefully the first stable release will be available shortly.
So check back here for any updates and leave us a comment.

comments powered by Disqus