PHP code example of wouterj / fred

1. Go to this page and download the library: Download wouterj/fred library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wouterj / fred example snippets


$fred->task('build', function () use ($fred) {
    // ... specify the tasks
});

use Symfony\Component\Finder\Finder;

$fred->task('build', function () use ($fred) {
    $fred->load(Finder::create()->files()->name('*.js')->in('/web/assets/raw'));
});

use Symfony\Component\Finder\Finder;
use WouterJ\Fred\Extension as Ext;

$fred->task('build', function () use ($fred) {
    $fred->load(Finder::create()->files()->name('*.js')->in('/web/assets/raw'))
        ->then(new Ext\JsHint())   // Lint the JS code using JsHint...
        ->then(new Ext\Uglify())   // ...minify the JS files using UglifyJS...
        ->then(new Ext\Compact())  // ...and combine all JS files into one file
    ;
});

$fred->load(Finder::create()->files()->name('*.js')->in('/web/assets/raw'))
    ->then(new Ext\JsHint())
    ->then(new Ext\Uglify())
    ->then(new Ext\Compact())
    ->dist('/web/assets/script.min.js')
;
bash
$ composer global