Show
Ignore:
Timestamp:
10/04/11 09:37:08 (2 years ago)
Author:
mbrevda
Message:

re #5394 - add hooks

Files:

Legend:

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

    r12749 r12750  
    6868foreach ($vars['modules'] as $mod) { 
    6969  $mod    = trim($mod, '/'); 
     70  $tar_dir  = $mod; 
    7071  $files    = 
    7172  $filename = 
     
    8283  $parser = new xml2ModuleArray($xml); 
    8384  $xmlarray = $parser->parseAdvanced($xml); 
     85   
    8486  //TODO: not sure how to detect a broken xml --MB 
    8587  if (!true) { 
     
    104106  } 
    105107   
    106   //check php files for syntaxt errors 
     108  //check php files for syntax errors 
    107109  if ($vars['checkphp']) { 
    108110    $files = scandirr($mod, true); 
     
    116118    } 
    117119  } 
    118  
     120   
     121  //include module specifc hook, if present 
     122  if (file_exists($mod . '/' . 'package_hook.php')) { 
     123    include($mod . '/' . 'package_hook.php'); 
     124  } 
     125   
     126  //include any global hooks, if present 
     127  if (file_exists('package_hook.php')) { 
     128    include('package_hook.php'); 
     129  } 
     130   
    119131  //check in out standing files 
    120132  if (run_cmd('svn st ' . $mod . '|wc -l') > 0) { 
    121     run_cmd('svn ci -m "Auto Check-in of any outstanding patches in ' . $mod . '" ' . $mod); 
    122   } 
    123    
     133    run_cmd('svn ci -m "Auto Check-in of any outstanding changes in ' . $mod . '" ' . $mod); 
     134  } 
    124135   
    125136  //set tarball name var 
     
    127138   
    128139  //build tarball 
    129   run_cmd('tar zcf ' . $filename . ' ' . $mod . ' --exclude ".*" -C ' . $mod ); 
     140  run_cmd('tar zcf ' . $filename . ' ' . $tar_dir . ' --exclude ".*" -C ' . $tar_dir); 
    130141   
    131142  //update md5 sum