noccylabs/actions-bundle

$ git tag


$ git branch
* master

NoccyLabs ActionsBundle

This bundle adds functionality similar to that of rake, phake, make etc into your Symfony project. The actions are located in app/actions/ in one or more .php files.

The advantage of this is that your tasks have access to the container, to doctrine, and anything else that is specific to your application.

ActionsBundle is currently very beta.

Actions and Tasks

Actions are groups of Tasks. Poorly named perhaps, but either way the actions should extend NoccyLabs\Bundle\ActionsBundle\Action and each of the defined public functions will be exported with a name matching the class and namespace:

class Tools_Source extends Action {
    // tools:source:build
    public function build() { ... }
}

namespace Tools {
    class Source extends Action {
        // tools:source:build
        public function build() { ... }
    }
}

Task annotations

class Tools_Source extends Action {
    /** @Task(desc="Build the project") * /
    public function build() { ... }
}

Anonymous tasks

Anonymous tasks are supported. desc() is used to describe the next task().

desc("Greet the world");
task("hello:world", function() { echo "Hello!\n"; });

desc("Greet localhost");
task("hello:localhost", function() { echo "Hai!\n"; });

Grouping anonymous tasks

Tasks can be grouped

group("hello", function() {
    desc("Greet the world");
    task("world", function() { echo "Hello!\n"; });

    desc("Greet localhost");
    task("localhost", function() { echo "Hai!\n"; });
});

Groups can be nested

group("tools", function () {
    group("source", function () {
        // tools:source:build
        task("build", ...);
    });
});

Configuration

The only configuration available is through parameters:

    noccylabs.actions.path      (string) The path where the actions can be found