public function action() { $success = true; ini_set('display_errors', true); set_time_limit(0); switch ($this->get_step()) { case 1: $this->_patches_ran = PatchUtil::apply_new(); $this->set_next_step(2); break; case 2: ModuleManager::create_common_cache(); Base_ThemeCommon::themeup(); Base_LangCommon::update_translations(); Cache::clear(); break; } return $success; }
protected function perform_update_patches($browser = true) { $this->turn_on_maintenance_mode(); $patches = PatchUtil::apply_new(true); if ($browser) { $success = PatchUtil::all_successful($patches); if (!$success) { $msg = self::format_patches_msg($patches); $this->body($msg); } return $success; } }
<?php define('CID', false); require_once '../../../include.php'; ModuleManager::load_modules(); if (!Acl::i_am_admin()) { die("Access forbidden"); } function ret($val) { print $val; exit; } try { $patches = PatchUtil::apply_new(); } catch (ErrorException $e) { ret($e->getMessage()); } ModuleManager::create_common_cache(); Base_ThemeCommon::themeup(); Base_LangCommon::update_translations(); foreach ($patches as $patch) { if ($patch->get_apply_status() !== Patch::STATUS_SUCCESS) { ret(0); } } ret(1);