function action_runscript() { header('Content-type: text/html;charset=utf-8'); set_time_limit(0); if (!($file = $_POST['file']) || !file_exists(CORE_DIR . '/updatescripts/' . $file)) { echo 'missing file' . $_POST['file']; return; } if (!file_exists(HOME_DIR . '/logs/upgrade_' . substr($_POST['file'], 0, -4) . '_' . $_POST['timeline'] . '.log.php')) { error_log('#<?php exit()?>' . " \n \n", 3, HOME_DIR . '/logs/upgrade_' . substr($_POST['file'], 0, -4) . '_' . $_POST['timeline'] . '.log.php'); } switch (ext_name($file)) { case '.php': include CORE_DIR . '/updatescripts/' . $file; if (class_exists('UpgradeScript')) { $oUpgrade = new UpgradeScript(); $oUpgrade->step = $_POST['step'] ? $_POST['step'] : '1'; $oUpgrade->runFunc = $_POST['runFunc'] ? $_POST['runFunc'] : 'first'; $oUpgrade->status = $_POST['runStatus'] ? $_POST['runStatus'] : 'all-finish'; $oUpgrade->version = substr($file, 0, -4); // $oUpgrade->runFunc = $runFunc; $oUpgrade->__Upgrade(); } break; case '.sql': $this->run_update_sql($file); break; } $this->setDbver(substr($file, 0, -4)); }