All Projects → reisraff → Phulp

reisraff / Phulp

Licence: mit
The task manager for php

Projects that are alternatives of or similar to Phulp

Dramatiq
A fast and reliable background task processing library for Python 3.
Stars: ✭ 2,844 (+867.35%)
Mutual labels:  task-manager, task, task-runner
duty
A simple task runner.
Stars: ✭ 36 (-87.76%)
Mutual labels:  task, task-runner
taskctl
Concurrent task runner, developer's routine tasks automation toolkit. Simple modern alternative to GNU Make 🧰
Stars: ✭ 237 (-19.39%)
Mutual labels:  task-runner, watcher
arelo
a simple auto reload (live reload) utility
Stars: ✭ 54 (-81.63%)
Mutual labels:  task-runner, watcher
Pypyr
pypyr task-runner cli & api for automation pipelines. Automate anything by combining commands, different scripts in different languages & applications into one pipeline process.
Stars: ✭ 173 (-41.16%)
Mutual labels:  task-manager, task-runner
Ten Hands
⚡ Simplest way to organize and run command-line tasks
Stars: ✭ 228 (-22.45%)
Mutual labels:  task-manager, task-runner
rush
🏃‍♀️ Minimalistic CLI Tool for Managing and Running Bash Snippets
Stars: ✭ 35 (-88.1%)
Mutual labels:  task, task-runner
Dramatiq dashboard
A dashboard for dramatiq, specific to its Redis broker.
Stars: ✭ 82 (-72.11%)
Mutual labels:  task-manager, task-runner
bikeshed
Lock free hierarchical work scheduler
Stars: ✭ 78 (-73.47%)
Mutual labels:  task-runner, task-manager
reflow
A light-weight lock-free series/parallel combined scheduling framework for tasks. The goal is to maximize parallelism in order to minimize the execution time overall.
Stars: ✭ 23 (-92.18%)
Mutual labels:  task-runner, task-manager
hotbuild
a cross platform hot compilation tool for golang
Stars: ✭ 181 (-38.44%)
Mutual labels:  builder, watcher
Mmake
Mmake is a small program which wraps make to provide additional functionality, such as user-friendly help output, remote includes, and eventually more. It otherwise acts as a pass-through to standard make.
Stars: ✭ 1,593 (+441.84%)
Mutual labels:  task-manager, task-runner
celery.node
Celery task queue client/worker for nodejs
Stars: ✭ 164 (-44.22%)
Mutual labels:  task-runner, task-manager
composer
API-first task runner with three methods: task, run and watch.
Stars: ✭ 35 (-88.1%)
Mutual labels:  task, task-runner
Tasklite
The CLI task manager for power users
Stars: ✭ 91 (-69.05%)
Mutual labels:  task-manager, task
student-work
基于 Laravel5 开发的学生处任务发布监控系统
Stars: ✭ 22 (-92.52%)
Mutual labels:  task, task-manager
Taskr
A simple task manager app
Stars: ✭ 760 (+158.5%)
Mutual labels:  task-manager, task
Gantt Elastic
Gantt Chart [ javascript gantt chart, gantt component, vue gantt, vue gantt chart, responsive gantt, project manager , vue projects ]
Stars: ✭ 869 (+195.58%)
Mutual labels:  task-manager, task
taskit
A Task Runner in Bash
Stars: ✭ 35 (-88.1%)
Mutual labels:  gulp, task
lets
CLI task runner for developers - a better alternative to make
Stars: ✭ 50 (-82.99%)
Mutual labels:  task, task-runner

phulp

The task manager for php

Latest Stable Version Total Downloads Latest Unstable Version License Build Status

Why

Sometimes I need a tool like Gulp for my PHP projects, but I don't want to install npm only to install Gulp. I thought "I need something like Gulp, but in PHP". After a little research I found Phing, but it's not focused in minification and management for CSS/JS and related frontend stuff.

Well, I decided to write Phulp, the PHP port of Gulp! And a little curiosity: it's faster than Gulp.

PS: I made benchs using PHP 7

Documentation

Plugins

Like Gulp we also have plugins, and you also can create your own.

Available plugins you can find in the plugin section over the Phulp Page.

To make your plugin available in the Phulp plugin page, add the keyword "phulpplugin" in your composer.json file of your project, and don't forget to let a cool composer.json description.

And tag your github project with the tags "phulpplugin", and "phulp", to be searchable on github.

Usage

Install:
$ composer require --dev reisraff/phulp
Create your Phulpfile (the configuration file, that describes all your tasks):
<?php

use Phulp\Output as out;

// Define the default task
$phulp->task('default', function ($phulp) {
    out::outln(out::colorize('Arguments:', 'green'));
    out::outln(print_r($phulp->getArguments(), true));

    $phulp->start(['clean', 'iterate_src_folder', 'sync_command', 'async_command']);
    if ($phulp->getArgument('repeat-clean', false)) {
        out::outln(out::colorize('Repeating "clean"', 'green'));
        $phulp->start(['clean']);
    }
});

// Define the clean task
$phulp->task('clean', function ($phulp) {
    if (! file_exists('dist')) {
        mkdir('dist');
    }
    $phulp->src(['dist/*'])
        ->pipe($phulp->clean());
});

// Define the iterate_src_folder task
$phulp->task('iterate_src_folder', function ($phulp) {
    // Define the source folder
    $phulp->src(['src/*php'])
        ->pipe($phulp->iterate(function ($file) {
            out::outln(sprintf(
                '%s %s',
                out::colorize('Iterated ->', 'green'),
                out::colorize($file->getFullPath() . DIRECTORY_SEPARATOR . $file->getName(), 'blue')
            ));
        }))
        ->pipe($phulp->dest('dist/'));
});

// Define the sync_command task
$phulp->task('sync_command', function ($phulp) {
    $command = $phulp->exec(
        'sleep 1 && echo $MSG',
        [
            'env' => [
                'MSG' => 'Sync-command'
            ],
            'cwd' => '/tmp',
            'sync' => true, // defines sync,
            'quiet' => true,
            'onStdOut' => function ($line) { out::outln($line); },
            'onStdErr' => function ($line) { },
            'onFinish' => function ($exitCode, $stdOut, $stdErr) { },
        ]
    );

    $exitCode = $command->getExitCode();
    $stdout = $command->getStdout();
    $stderr = $command->getStderr();

    out::outln('done');
});

// Define the async_command task
$phulp->task('async_command', function ($phulp) {
    $command = $phulp->exec(
        'sleep 1 && echo $MSG',
        [
            'env' => [
                'MSG' => 'Async-command'
            ],
            'cwd' => '/tmp',
            'sync' => false, // defines async,
            'quiet' => false,
            'onStdOut' => function ($line) { },
            'onStdErr' => function ($line) { },
            'onFinish' => function ($exitCode, $stdOut, $stdErr) { },
        ]
    );

    out::outln('done');
});

// Define the watch task
$phulp->task('watch', function ($phulp) {
    // Phulp will watch 'src' folder
    $phulp->watch(
        $phulp->src(['src/*php']),
        function ($phulp, $distFile) {
            out::outln(sprintf(
                '%s %s',
                out::colorize('File Changed ->', 'green'),
                out::colorize($distFile->getFullPath() . DIRECTORY_SEPARATOR . $distFile->getName(), 'blue')
            ));
            $phulp->start(['default']);
        }
    );
});
Run:

Run the phulp over the Phulpfile directory

If you have not configured the bin-dir:

$ vendor/bin/phulp --help
$ vendor/bin/phulp # Will run the `default` task
$ vendor/bin/phulp --arg=repeat-clean:true # Will run the `default` task with the argument repeat-clean with value `true`
$ vendor/bin/phulp --autoload=/my/autoload/path/autoload.php # Will run the `default` task adding a alternative autoload php file
$ vendor/bin/phulp watch # Will run the `watch` task
The full documentation:

Docs

Example:

https://github.com/reisraff/phulp/blob/master/example/phulpfile.php

Run the example file:

$ composer install
$ cd example
$ ../bin/phulp
$ ../bin/phulp watch

Contributors Guide

Clone

$ git clone [email protected]:reisraff/phulp.git
$ cd phulp
$ composer install

Tests

First install the dependencies, and after you can run:

$ bin/phulp test

TODO

The "Issues" page from this repository is being used for TO-DO management.

Credits

@reisraff

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].