Popularity
3.1
Stable
Activity
0.0
Stable
182
14
16

Description

Got a PHP project? Heard of Grunt and Gulp but don't use NodeJS? Task is a pure PHP task runner.

Code Quality Rank: L5
Programming language: PHP
License: MIT License
Tags: Task Runners    
Latest version: v0.6.0

Task alternatives and similar libraries

Based on the "Task Runners" category.
Alternatively, view Task alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of Task or a related project?

Add another 'Task Runners' Library

README

task/task

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version Total Downloads Latest Unstable Version License

Got a PHP project? Heard of Grunt and Gulp but don't use NodeJS? Task is a pure PHP task runner.

  • Leverage PHP as a scripting language, and as your platform of choice.
  • Use loads of nice features inspired by Grunt and Gulp (and Phing).
  • Employ Symfony components for effortless CLI goodness.
  • Extend with plugins.

For more information and documentation goto taskphp.github.io, or tweet us at @taskphp.

Example

<?php

use Task\Plugin;

require 'vendor/autoload.php';

$project = new Task\Project('wow');

$project->inject(function ($container) {
    $container['phpspec'] = new Plugin\PhpSpecPlugin;
    $container['fs'] = new Plugin\FilesystemPlugin;
    $container['sass'] = (new Plugin\Sass\ScssPlugin)
        ->setPrefix('sass');
    $container['watch'] = new Plugin\WatchPlugin;
});

$project->addTask('greet', function () {
    $this->getOutput()->writeln('Hello, World!');
});

$project->addTask('test', ['phpspec', function ($phpspec) {
    $phpspec->command('run')
        ->setFormat('pretty')
        ->setVerbose(true)
        ->pipe($this->getOutput());
}]);

$project->addTask('css', ['fs', 'sass', function ($fs, $sass) {
    fs->open('my.scss')
        ->pipe($sass)
        ->pipe($fs->touch('my.css'));
}]);

$project->addTask('css.watch', ['watch', function ($watch) {
    $watch->init('my.scss')
        ->addListener('modify', function ($event) {
            $this->runTask('css', $this->getOutput());
        })
        ->start();
}]);

return $project;
$> task greet
Hello, World!

$> task test

      Task\Injector

  17  ✔ is initializable
  22  ✔ should call function with services

      Task\Project

  10  ✔ is initializable
  20  ✔ should have a container
  26  ✔ should resolve no dependencies
  32  ✔ should resolve one dependency
  39  ✔ should resolve many dependencies
  50  ✔ should normalize dependencies
  58  ✔ should normalize complex dependencies


2 specs
9 examples (9 passed)
29ms


*Note that all licence references and agreements mentioned in the Task README section above are relevant to that project's source code only.