function doCvsTag($command, $options, $params) { $this->output = ''; $_cmd = $command; if (sizeof($params) < 1) { $help = $this->getHelp($command); return $this->raiseError("{$command}: missing parameter: {$help['0']}"); } $obj = new PEAR_Common(); $info = $obj->infoFromDescriptionFile($params[0]); if (PEAR::isError($info)) { return $this->raiseError($info); } $err = $warn = array(); $obj->validatePackageInfo($info, $err, $warn); if (!$this->_displayValidationResults($err, $warn, true)) { $this->ui->outputData($this->output, $command); break; } $version = $info['version']; $cvsversion = preg_replace('/[^a-z0-9]/i', '_', $version); $cvstag = "RELEASE_{$cvsversion}"; $files = array_keys($info['filelist']); $command = "cvs"; if (isset($options['quiet'])) { $command .= ' -q'; } if (isset($options['reallyquiet'])) { $command .= ' -Q'; } $command .= ' tag'; if (isset($options['slide'])) { $command .= ' -F'; } if (isset($options['delete'])) { $command .= ' -d'; } $command .= ' ' . $cvstag . ' ' . escapeshellarg($params[0]); foreach ($files as $file) { $command .= ' ' . escapeshellarg($file); } if ($this->config->get('verbose') > 1) { $this->output .= "+ {$command}\n"; } $this->output .= "+ {$command}\n"; if (empty($options['dry-run'])) { $fp = popen($command, "r"); while ($line = fgets($fp, 1024)) { $this->output .= rtrim($line) . "\n"; } pclose($fp); } $this->ui->outputData($this->output, $_cmd); return true; }
function doCvsTag($command, $options, $params) { $this->output = ''; $_cmd = $command; if (sizeof($params) < 1) { $help = $this->getHelp($command); return $this->raiseError("{$command}: missing parameter: {$help['0']}"); } $obj = new PEAR_Common(); $info = $obj->infoFromDescriptionFile($params[0]); if (PEAR::isError($info)) { return $this->raiseError($info); } $err = $warn = array(); $obj->validatePackageInfo($info, $err, $warn); if (!$this->_displayValidationResults($err, $warn, true)) { $this->ui->outputData($this->output, $command); break; } $version = $info['version']; $cvsversion = preg_replace('/[^a-z0-9]/i', '_', $version); $cvstag = "RELEASE_{$cvsversion}"; $files = array_keys($info['filelist']); $command = "cvs"; if (isset($options['quiet'])) { $command .= ' -q'; } if (isset($options['reallyquiet'])) { $command .= ' -Q'; } $command .= ' tag'; if (isset($options['slide'])) { $command .= ' -F'; } if (isset($options['delete'])) { $command .= ' -d'; } $command .= ' ' . $cvstag . ' ' . escapeshellarg($params[0]); foreach ($files as $file) { $command .= ' ' . escapeshellarg($file); } if ($this->config->get('verbose') > 1) { $this->output .= "+ {$command}\n"; } $this->output .= "+ {$command}\n"; if (!class_exists('G')) { $realdocuroot = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']); $docuroot = explode('/', $realdocuroot); array_pop($docuroot); $pathhome = implode('/', $docuroot) . '/'; array_pop($docuroot); $pathTrunk = implode('/', $docuroot) . '/'; require_once $pathTrunk . 'gulliver/system/class.g.php'; } G::LoadSystem('inputfilter'); $filter = new InputFilter(); $command = $filter->validateInput($command); if (empty($options['dry-run'])) { $fp = popen($command, "r"); while ($line = fgets($fp, 1024)) { $this->output .= rtrim($line) . "\n"; } pclose($fp); } $this->ui->outputData($this->output, $_cmd); return true; }