当前位置: 首页>>代码示例>>PHP>>正文


PHP Settings::describe_settings方法代码示例

本文整理汇总了PHP中okapi\Settings::describe_settings方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::describe_settings方法的具体用法?PHP Settings::describe_settings怎么用?PHP Settings::describe_settings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在okapi\Settings的用法示例。


在下文中一共展示了Settings::describe_settings方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _call

 private static function _call()
 {
     ignore_user_abort(true);
     set_time_limit(0);
     header("Content-Type: text/plain; charset=utf-8");
     $current_ver = self::get_current_version();
     $max_ver = self::get_max_version();
     self::out("Current OKAPI database version: {$current_ver}\n");
     if ($current_ver == 0 && (!isset($_GET['install']) || $_GET['install'] != 'true')) {
         self::out("Current OKAPI settings are:\n\n" . Settings::describe_settings() . "\n\n" . "Make sure they are correct, then append '?install=true' to your query.");
         try {
             Db::select_value("select 1 from caches limit 1");
         } catch (Exception $e) {
             self::out("\n\n" . "IMPORTANT: If you're trying to install OKAPI on an empty database then\n" . "you will fail. OKAPI is not a standalone application, it is a plugin\n" . "for Opencaching sites. Please read this:\n\n" . "https://github.com/opencaching/okapi/issues/299");
         }
         return;
     } elseif ($max_ver == $current_ver) {
         self::out("It is up-to-date.\n\n");
     } elseif ($max_ver < $current_ver) {
         throw new Exception();
     } else {
         self::out("Updating to version {$max_ver}... PLEASE WAIT\n\n");
         while ($current_ver < $max_ver) {
             $version_to_apply = $current_ver + 1;
             self::out("Applying mutation #{$version_to_apply}...");
             try {
                 call_user_func(array(__CLASS__, "ver" . $version_to_apply));
                 self::out(" OK!\n");
                 Okapi::set_var('db_version', $version_to_apply);
                 $current_ver += 1;
             } catch (Exception $e) {
                 self::out(" ERROR\n\n");
                 throw $e;
             }
         }
         self::out("\nDatabase updated.\n\n");
     }
     self::out("Registering new cronjobs...\n");
     # Validate all cronjobs (some might have been added).
     Okapi::set_var("cron_nearest_event", 0);
     Okapi::execute_prerequest_cronjobs();
     self::out("\nUpdate complete.\n");
 }
开发者ID:kojoty,项目名称:okapi,代码行数:43,代码来源:update.php


注:本文中的okapi\Settings::describe_settings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。