| [ Index ] |
PHP Cross Reference of Limb3 |
[Summary view] [Print] [Text view]
1 <?php 2 /* 3 * Limb PHP Framework 4 * 5 * @link http://limb-project.com 6 * @copyright Copyright © 2004-2007 BIT(http://bit-creative.com) 7 * @license LGPL http://www.gnu.org/copyleft/lesser.html 8 */ 9 lmb_require('limb/js/common.inc.php'); 10 lmb_require('limb/fs/src/lmbFs.class.php'); 11 lmb_require('limb/js/src/lmbJsPreprocessor.class.php'); 12 13 /** 14 * class JsCliCmd. 15 * 16 * @package js 17 * @version $Id$ 18 */ 19 class JsCliCmd extends lmbCliBaseCmd 20 { 21 function execute($argv) 22 { 23 $this->help($argv); 24 } 25 26 function build($argv) 27 { 28 $input = new lmbCliInput(); 29 $input->setMinimumArguments(2); 30 $input->read($argv, false); 31 32 $arguments = $input->getArguments(); 33 34 if(!$dest_file = array_pop($arguments)) 35 { 36 echo "Error: You must specify output file.\n"; 37 return 1; 38 } 39 40 $src_files = array(); 41 foreach($arguments as $src_file) 42 $src_files[] = realpath($src_file); 43 44 if(empty($src_files)) 45 { 46 echo "Error: You must specify at least one input file.\n"; 47 return 1; 48 } 49 50 $builder = new lmbJsPreprocessor(); 51 try 52 { 53 $contents = $builder->processFiles($src_files); 54 } 55 catch(lmbException $e) 56 { 57 echo 'Build error: ' . $e->getMessage(); 58 return 1; 59 } 60 61 lmbFs :: safeWrite($dest_file, $contents); 62 63 return 0; 64 } 65 66 function help($argv) 67 { 68 $txt = <<<EOD 69 Usage: 70 js build <input_file> [<input_file> <input_file> ...] <output_file> 71 72 Process directives in all specified javascript files as set of <input_file> into one <output_file>. 73 Only one #include directive supported now by default. 74 75 Options: 76 -h, --help dysplays this message 77 78 EOD; 79 80 echo $txt; 81 } 82 } 83 84 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Sat Nov 22 03:48:54 2008 | Cross-referenced by PHPXref 0.7 |