public static function init($mode = self::MODE_NORMAL, array $updScripts = []) { self::$defaultExecTime = ini_get('max_execution_time'); $doScripts = null; if (getopt(self::$shortOpts, self::$longOpts) || $mode == self::MODE_FIRSTRUN) { self::handleCLIOpts($doScripts); } else { if ($mode != self::MODE_UPDATE) { self::printCLIHelp(); exit; } } // check passed subscript names; limit to real scriptNames self::$subScripts = array_keys(self::$tables); if ($doScripts || $updScripts) { self::$subScripts = array_intersect($doScripts ?: $updScripts, self::$subScripts); } else { if ($doScripts === null) { self::$subScripts = []; } } if (!CLISetup::$localeIds) { CLISetup::log('No valid locale specified. Check your config or --locales parameter, if used', CLISetup::LOG_ERROR); exit; } }
public static function init($firstrun = false) { self::$defaultExecTime = ini_get('max_execution_time'); $doScripts = []; if (getopt(self::$shortOpts, self::$longOpts) || $firstrun) { self::handleCLIOpts($doScripts); } else { self::printCLIHelp(); exit; } // check passed subscript names; limit to real scriptNames self::$subScripts = array_keys(self::$tables); if ($doScripts) { self::$subScripts = array_intersect($doScripts, self::$subScripts); } if (!CLISetup::$localeIds) { CLISetup::log('No valid locale specified. Check your config or --locales parameter, if used', CLISetup::LOG_ERROR); exit; } }