d11270fc0c24f2370d04df85beb490ee4cdf9999

Author: AD7six

Date: 2010-03-04 23:18:37 +0100

use _exec function

diff --git a/vendors/shells/tasks/tags.php b/vendors/shells/tasks/tags.php index 087ab29..3b9fdfb 100644 --- a/vendors/shells/tasks/tags.php +++ b/vendors/shells/tasks/tags.php @@ -152,11 +152,36 @@ class TagsTask extends Shell { //$this->out("\tcorrecting helper references"); //$cmd = 'sed -i -e "s/^\(\$\)\(.\)/\l\2/" tags'; //$this->out($cmd); - //exec($cmd); + //$this->_exec($cmd); $this->out('done.'); } /** + * exec method + * + * @param mixed $cmd + * @param mixed $out null + * @return void + * @access protected + */ + protected function _exec($cmd, &$out = null) { + if (DS === '/') { + $_out = exec($cmd . ' 2>&1', $out, $return); + } else { + $_out = exec($cmd, $out, $return); + } + + if (Configure::read()) { + $source = Debugger::trace(array('depth' => 1, 'start' => 2)) . "\n"; + CakeLog::write('system_calls', "\n" . $source . Debugger::exportVar(compact('cmd','out','return'))); + } + if ($return) { + return false; + } + return $_out?$_out:true; + } + +/** * tag method * * @param mixed $file @@ -190,8 +215,8 @@ class TagsTask extends Shell { ' --regex-cake="/^\s*define\([\'\"]([^\'\"]*)/\1/d/"' . ' --regex-cake="/^\s*const ([^ ]*)/\1/d/"' . //' --regex-cake="/^\s*(public |static |abstract |protected |private |var )+.([^ ]*)/\2/v/"' . - ' ' . $file . ' 2> /dev/null'; - exec($cmd); + ' ' . $file; + $this->_exec($cmd); } /**