PHP code example of crodas / build

1. Go to this page and download the library: Download crodas/build 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/ */

    

crodas / build example snippets


 // Tasks.php
/** 
 * @Task(build_site) 
 */
function concat_files($output, Array $input, Array $settings $builder)
{
  /* Do something with the input files */
  $content = "";
  foreach ($input as $f) {
    $content .= file_get_contents($f);
  }
  
  /* Write it in the $output file */
  file_put_contents($output, $content);
}

 // build.php

$builder  = new crodas\Build("/tasks.php");
$bundle_js = $build->build_site(['foo.js', 'xxx.js']);