Pure PHP task runner

Related tags

Task Runners task
Overview

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
Comments
  • Rename Taskfile to taskfile.php

    Rename Taskfile to taskfile.php

    For consistency it will be better if filename is lowercased like we used to with other tools, such as phpunit.xml, composer.json etc.

    And if file has no extension, then people who see this for the first time, does not know without opening what's inside. Also code highlighting will not work by default in most editors / IDEs.

    opened by laurisb 8
  • Question: Remote SSH tasks

    Question: Remote SSH tasks

    Hi - I'm looking at a few different PHP task runners right now: bldr, robo, Rocketeer - Are there plans for TaskPHP to include a remote SSH command task? Or maybe I overlooked something, Is this possible right now?

    Thanks!

    opened by richardbporter 2
  • Feature/extend tests

    Feature/extend tests

    Changes Made:

    • Included vfsStream within the require-dev block for mocking the filesystem in some tests
    • Additions to ProjectSpec to include extend in code coverage
    • Updated Project extend fn to check that closure is callable, and throw InvalidArgumentExtension otherwise
    • Use call_user_func to invoke closure
    opened by KashifSaadat 1
  • Task plan

    Task plan

    Core features:

    • Streams
    • Dependencies
    • Ease of coding tasks, piping etc.
    $project->plugins(function($plugins) {
        $plugins['fs'] = new Filesystem;
        $plugins['sass'] = new Sass;
    });
    
    $project->add('task1', function() {
    });
    
    $project->add('task2', ['fs', 'sass', function($fs, $sass) {
        $fs->read('style.scss')
            ->pipe($sass)
            ->pipe($fs->write('style.min.css'));
    }], ['task1']);
    
    enhancement 
    opened by mbfisher 0
  • Does Plugin\Sass\ScssPlugin exist?

    Does Plugin\Sass\ScssPlugin exist?

    The home page uses Plugin\Sass\ScssPlugin in the example file. Does this plugin exist? I can't find it.

    I think it would be good to add the composer requirements for getting this example file running. It's confusing for a new user to have to hunt down these plugins.

    opened by dlancea 1
  • New Behat Plugin

    New Behat Plugin

    Hey,

    I've the need for a Behat Plugin, working similar to how your PHPUnit Plugin has been implemented for use with my Behat Tasks. This should have the ability to take a list of command line arguments and execute them within the same Task process.

    Cheers,

    Kash

    opened by KashifSaadat 7
Owner
null
Modern task runner for PHP

RoboTask Modern and simple PHP task runner inspired by Gulp and Rake aimed to automate common tasks: writing cross-platform scripts processing assets

Consolidation 2.6k Dec 28, 2022
A versatile and lightweight PHP task runner, designed with simplicity in mind.

Blend A versatile and lightweight PHP task runner, designed with simplicity in mind. Table of Contents About Blend Installation Config Examples API Ch

Marwan Al-Soltany 42 Sep 29, 2022
Modern and simple PHP task runner inspired by Gulp and Rake aimed to automate common tasks

RoboTask Modern and simple PHP task runner inspired by Gulp and Rake aimed to automate common tasks: writing cross-platform scripts processing assets

Consolidation 2.6k Jan 3, 2023
Awesome Task Runner

Bldr Simplified Build System/Task Runner Uses Yaml, JSON, XML, PHP, or INI for configs Quick Usage To develop, run ./script/bootstrap, and then ./scri

null 223 Nov 20, 2022
Yii application runner

Yii application runner The package defines Yii application runner. Requirements PHP 7.4 or higher. Installation The package could be installed with co

Yii Software 9 Oct 15, 2022
🐺 Asynchronous Task Queue Based on Distributed Message Passing for PHP.

?? Asynchronous Task Queue Based on Distributed Message Passing for PHP.

Ahmed 36 Aug 11, 2022
A PHP implementation of a bare task loop.

TaskLoop A PHP implementation of a bare task loop. Installation. $ composer require thenlabs/task-loop 1.0.x-dev Usage. The file example.php contains

ThenLabs 1 Oct 17, 2022
Flow Framework Task Scheduler

This package provides a simple to use task scheduler for Neos Flow. Tasks are configured via settings, recurring tasks can be configured using cron syntax. Detailed options configure the first and last executions as well as options for the class handling the task.

Flowpack 11 Dec 21, 2022
Manage your Laravel Task Scheduling in a friendly interface and save schedules to the database.

Documentation This librarian creates a route(default: /schedule) in your application where it is possible to manage which schedules will be executed a

Roberson Faria 256 Dec 21, 2022
Task Scheduling with Cron Job in Laravel

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Shariful Islam 1 Oct 16, 2021
Laravel-Tasks is a Complete Build of Laravel 5.2 with Individual User Task Lists

An app of tasks lists for each individual user. Built on Laravel 5.2, using 5.2 authentication and middleware. This has robust verbose examples using Laravel best practices.

Jeremy Kenedy 26 Aug 27, 2022
xcron - the souped up, modernized cron/Task Scheduler for Windows, Mac OSX, Linux, and FreeBSD server and desktop operating systems.

xcron is the souped up, modernized cron/Task Scheduler for Windows, Mac OSX, Linux, and FreeBSD server and desktop operating systems. MIT or LGPL.

CubicleSoft 7 Nov 30, 2022
Laravel Cron Scheduling - The ability to run the Laravel task scheduler using different crons

Laravel Cron Scheduling Laravel Task Scheduling is a great way to manage the cron. But the documentation contains the following warning: By default, m

Sergey Zhidkov 4 Sep 9, 2022
Reset the live preset for debug settings with a task

Debug Settings Task This TYPO3 extension resets TYPO3 debug settings to the »live« preset on production using a scheduler task. Vision “Better safe th

webit! Gesellschaft für neue Medien mbH 1 Aug 15, 2022
PHP cron job scheduler

PHP Cron Scheduler This is a framework agnostic cron jobs scheduler that can be easily integrated with your project or run as a standalone command sch

Giuseppe Occhipinti 698 Jan 1, 2023
PHP port of resque (Workers and Queueing)

php-resque: PHP Resque Worker (and Enqueue) Resque is a Redis-backed library for creating background jobs, placing those jobs on one or more queues, a

Chris Boulton 3.5k Jan 5, 2023
Elegant SSH tasks for PHP.

Laravel Envoy Introduction Laravel Envoy provides a clean, minimal syntax for defining common tasks you run on your remote servers. Using Blade style

The Laravel Framework 1.5k Jan 1, 2023
Crunz is a framework-agnostic package to schedule periodic tasks (cron jobs) in PHP using a fluent API.

Crunz Install a cron job once and for all, manage the rest from the code. Crunz is a framework-agnostic package to schedule periodic tasks (cron jobs)

Reza Lavarian 1.4k Dec 26, 2022
A PHP-based job scheduler

Crunz Install a cron job once and for all, manage the rest from the code. Crunz is a framework-agnostic package to schedule periodic tasks (cron jobs)

null 58 Dec 26, 2022