public function run() { if (version_compare($this->from_version, '7.0', '>=')) { // right now there's no need to run this on 7 return; } if (!file_exists('modules/UpgradeWizard/SidecarUpdate/SidecarMetaDataUpgrader.php')) { return; } // TODO: fix uw_utils references in SidecarMetaDataUpgrader $smdUpgrader = new SidecarMetaDataUpgrader2($this); $smdUpgrader->upgrade(); // Log failures if any $failures = $smdUpgrader->getFailures(); if (!empty($failures)) { $this->log('Sidecar Upgrade: ' . count($failures) . ' metadata files failed to upgrade through the silent upgrader:'); $this->log(print_r($failures, true)); } else { $this->log('Sidecar Upgrade: Mobile/portal metadata upgrade ran with no failures:'); $this->log($smdUpgrader->getCountOfFilesForUpgrade() . ' files were upgraded.'); } $this->fileToDelete(SidecarMetaDataUpgrader::getFilesForRemoval()); }
public function logUpgradeStatus($msg) { $GLOBALS['log']->info($msg); } } $GLOBALS['app_list_strings'] = return_app_list_strings_language($GLOBALS['current_language']); $smdUpgrader = new SidecarMetaDataUpgrader2(); $module = $argv[2]; $smdUpgrader->setModule($module); if (($bwcPos = array_search($module, $GLOBALS['bwcModules'])) !== false) { // remove it from BWC modules for now // if we succeed, it becomes permanent unset($GLOBALS['bwcModules'][$bwcPos]); } set_error_handler('scriptErrorHandler', E_ALL & ~E_STRICT & ~E_DEPRECATED); $smdUpgrader->upgrade(); $fail = $smdUpgrader->getFailures(); if (!empty($fail)) { echo "***FAILURE***\n" . var_export($fail, true) . "\n"; exit(1); } else { if (count($smdUpgrader->getFilesForUpgrade()) > 0) { echo "\nSUCCESS!\nPlease check the result, and if you are satisfied, please delete these files:\n" . join("\n", $smdUpgrader->getFilesForRemoval()); echo "\n"; } else { echo "\nNo files needed upgrade.\n"; } // take module out of BWC if (file_exists("custom/Extension/application/Ext/Include/upgrade_bwc.php")) { $bwcModules = array(); include 'custom/Extension/application/Ext/Include/upgrade_bwc.php';