Show
Ignore:
Timestamp:
11/28/11 14:16:49 (1 year ago)
Author:
mbrevda
Message:

Upstream Changes: make php command a variable; more paging touches and fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.10/package.php

    r12942 r12977  
    3636$vars['svn_path'] = 'http://svn.freepbx.org'; 
    3737$vars['rm_files'] = array(); //files that will be deleted after the script completes 
     38$vars['php_-l']   = 'php -l'; 
    3839 
    3940//move cli args to longopts for clarity throught the script 
     
    160161  if ($vars['checkphp']) { 
    161162    var_dump($tar_dir); 
    162     $files = scandirr($tar_dir, true, $file_scan_exclude_list); 
     163    $files = package_scandirr($tar_dir, true, $file_scan_exclude_list); 
    163164    foreach ($files as $f) { 
    164165      if (pathinfo($f, PATHINFO_EXTENSION) == 'php') { 
    165166        $ret_val = 0; 
    166         system('php -l ' . $f, $ret_val); 
    167         if ($ret_val != 0) { 
     167         
     168        if (!run_cmd($vars['php_-l'] . ' ' . $f)) { 
    168169          echo('syntax error detected in ' . $f . ', ' .  $mod . ' won\'t be packaged' . PHP_EOL); 
    169170          continue 2; 
     
    240241 
    241242/** 
    242  * function scandirr 
     243 * function package_scandirr 
    243244 * scans a directory just like scandir(), only recursively 
    244245 * returns a hierarchical array representing the directory structure 
     
    251252 * @author Moshe Brevda mbrevda => gmail ~ com 
    252253 */ 
    253 function scandirr($dir, $absolute = false, $exclude_list=array()) { 
     254function package_scandirr($dir, $absolute = false, $exclude_list=array()) { 
    254255  $list = array(); 
    255256  if ($absolute) { 
     
    269270    } 
    270271     
    271     //if current file ($d) is a directory, call scandirr 
     272    //if current file ($d) is a directory, call package_scandirr 
    272273    if (is_dir($dir . '/' . $d)) { 
    273274      if ($absolute) { 
    274         scandirr($dir . '/' . $d, $absolute, $exclude_list); 
     275        package_scandirr($dir . '/' . $d, $absolute, $exclude_list); 
    275276      } else { 
    276         $list[$d] = scandirr($dir . '/' . $d, $absolute, $exclude_list); 
     277        $list[$d] = package_scandirr($dir . '/' . $d, $absolute, $exclude_list); 
    277278      } 
    278279