/** * Instructions to execute to handle the action to perform. * * @access public * @author Jerome Bogaerts, <*****@*****.**> * @return void */ public function run() { if (file_exists($this->parameters['previous'])) { $oldManifest = new common_ext_Manifest($this->parameters['previous']); } else { $this->err('Manifest ' . $this->parameters['previous'] . ' not found', true); } if (file_exists($this->parameters['current'])) { $newManifest = new common_ext_Manifest($this->parameters['current']); } else { $this->err('Manifest ' . $this->parameters['current'] . ' not found', true); } $out = $this->parameters['output']; $diff = new taoDevTools_models_ExtDiff($oldManifest, $newManifest); file_put_contents($out, $diff->exportDiffToPhp()); }
/** * Instructions to execute to handle the action to perform. * * @access public * @author Jerome Bogaerts, <*****@*****.**> * @return void */ public function run() { // from install folder if (!file_exists($this->parameters['previous'])) { $this->err('Previous tao directory "' . $this->parameters['previous'] . '" found', true); } $outDir = $this->parameters['output']; if (!file_exists($outDir)) { if (!mkdir($outDir)) { $this->err('Could not create directory "' . $outDir, true); } } $oldExts = $this->getAllExtensionManifests($this->parameters['previous']); $newExts = $this->getAllExtensionManifests(ROOT_PATH); foreach ($oldExts as $extId => $manifest) { $extDiff = new taoDevTools_models_ExtDiff($manifest, isset($newExts[$extId]) ? $newExts[$extId] : null); file_put_contents($outDir . DIRECTORY_SEPARATOR . 'diff' . ucfirst($extId) . '.php', $extDiff->exportDiffToPhp()); file_put_contents($outDir . DIRECTORY_SEPARATOR . 'diff' . ucfirst($extId) . '.sql', $extDiff->exportDiffToSql()); if (!isset($newExts[$extId])) { $this->out('Extension ' . $extId . ' no longer exists.'); } } }