weevers/pulp

This package is abandoned and no longer maintained. No replacement package was suggested.

A streaming build system like gulp

v0.0.2 2015-04-02 01:25 UTC

This package is not auto-updated.

Last update: 2020-08-08 17:28:26 UTC


README

pulp is a streaming build system, something like gulp for PHP. Meaning: with src("*.css") you get a asynchronous duplex stream that emits virtual file objects. This stream can then be piped to one or more plugins or to a filesystem destination with dest("target-dir"). pulp is a weekend experiment, please use a VM if you want to play with it. Requires PHP 5.4+.

packagist status Travis build status AppVeyor build status Dependency status

Jump to: install / license

example

This example bundles all the javascript files in "assets" and its subdirectories, then writes it to "build/all.js".

<?php

use Weevers\Pulp\Pulp
  , Weevers\Pulp\Plugin;

$pulp = new Pulp();

$pulp
  ->src('assets/**/*.js')
  ->pipe(new Plugin\Concat('all.js'))
  ->pipe($pulp->dest('build'))
  ->each(function($file){
    echo "bundled all js in {$file->path}\n";
  })
;

// Nothing happens until we start an event loop
$pulp->run();

?>

If we leave out the Concat plugin, all javascript files are copied. Note that a file like "assets/js/app.js" would be copied to "build/js/app.js".

<?php

$pulp
  ->src('assets/**/*.js')
  ->pipe($pulp->dest('build'));

$pulp->run();

?>

install

With composer do:

composer require weevers/pulp

license

MIT © Vincent Weevers