pack('/path/to/files/', 'destination') * */ require_once 'Pman.php'; class Pman_Core_JsCompile extends Pman { static $cli_desc = "Wrapper around Javascript compression tools Runs the javascript compiler - merging all the JS files so the load faster. Note: cfg option Pman_Builder['jspacker'] must be set to location of jstoolkit code "; var $cli = false; function getAuth() { // command line only ATM $this->cli = HTML_FlexyFramework::get()->cli; // var_dump($this->cli); if ($this->cli) { return true; } return false; } function get($proj, $args) { if (empty($args)) { die("missing action : eg. build or install"); } // list of projects. if (empty($args[1])) { $ar = $this->gatherProjects(); echo "SELECT Component to build\n"; print_r($ar); exit; } else { $ar = array($args[1]); //$ar = $args; //array_shift($ar); } switch ($args[0]) { case 'build': foreach($ar as $p) { $this->build($p); //$this->install($p); } break; case 'install' : // needed for install on remote sites.. die('not yet..'); foreach($ar as $p) { $this->install($p); } break; } exit; } /** * packScript: * * @param {String} basedir absolute path to files * @param {Array} list of files (ontop of basedir) * @param {String} output url (path to basedir basically), or false * to not compile * * */ static function jsSort($a,$b) { $a = substr($a, 0, -3); $b= substr($b, 0, -3); if ($a == $b) { return 0; } return ($a > $b) ? +1 : -1; } function packScript($basedir, $files, $output_url, $compile=true) { // this outputs '; return; } foreach($ofiles as $f) { echo ''."\n"; } } function packCss($basedir, $files, $output_url) { // this outputs