コード例 #1
0
ファイル: sqlGen.class.php プロジェクト: saqar/aowow
 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;
     }
 }
コード例 #2
0
ファイル: sqlGen.class.php プロジェクト: Carbenium/aowow
 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;
     }
 }