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


PHP Okapi::mail_admins方法代码示例

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


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

示例1: execute

 public function execute()
 {
     require_once $GLOBALS['rootpath'] . "okapi/locale/locales.php";
     $required = Locales::get_required_locales();
     $installed = Locales::get_installed_locales();
     $missing = array();
     foreach ($required as $locale) {
         if (!in_array($locale, $installed)) {
             $missing[] = $locale;
         }
     }
     if (count($missing) == 0) {
         return;
     }
     # okay!
     ob_start();
     print "Hi!\n\n";
     print "Your system is missing some locales required by OKAPI for proper\n";
     print "internationalization support. OKAPI comes with support for different\n";
     print "languages. This number (hopefully) will be growing.\n\n";
     print "Please take a moment to install the following missing locales:\n\n";
     $prefixes = array();
     foreach ($missing as $locale) {
         print " - " . $locale . "\n";
         $prefixes[substr($locale, 0, 2)] = true;
     }
     $prefixes = array_keys($prefixes);
     print "\n";
     if (count($missing) == 1 && $missing[0] == 'POSIX') {
         # I don't remember how to install POSIX, probably everyone has it anyway.
     } else {
         print "On Debian, try the following:\n\n";
         foreach ($prefixes as $lang) {
             if ($lang != 'PO') {
                 # Two first letters cut from POSIX.
                 print "sudo apt-get install language-pack-" . $lang . "-base\n";
             }
         }
         print "sudo service apache2 restart\n";
         print "\n";
     }
     print "Thanks!\n\n";
     print "-- \n";
     print "OKAPI Team";
     Okapi::mail_admins("Additional setup needed: Missing locales.", ob_get_clean());
 }
开发者ID:4Vs,项目名称:oc-server3,代码行数:46,代码来源:cronjobs.php

示例2: get_many

 /** Do 'get' on many keys at once. */
 public static function get_many($keys)
 {
     $dict = array();
     $rs = Db::query("\n            select `key`, value\n            from okapi_cache\n            where\n                `key` in ('" . implode("','", array_map('mysql_real_escape_string', $keys)) . "')\n                and expires > now()\n        ");
     while ($row = mysql_fetch_assoc($rs)) {
         try {
             $dict[$row['key']] = unserialize(gzinflate($row['value']));
         } catch (ErrorException $e) {
             unset($dict[$row['key']]);
             Okapi::mail_admins("Debug: Unserialize error", "Could not unserialize key '" . $row['key'] . "' from Cache.\n" . "Probably something REALLY big was put there and data has been truncated.\n" . "Consider upgrading cache table to LONGBLOB.\n\n" . "Length of data, compressed: " . strlen($row['value']));
         }
     }
     if (count($dict) < count($keys)) {
         foreach ($keys as $key) {
             if (!isset($dict[$key])) {
                 $dict[$key] = null;
             }
         }
     }
     return $dict;
 }
开发者ID:Slini11,项目名称:okapi,代码行数:22,代码来源:core.php

示例3: ver57

 private static function ver57()
 {
     ob_start();
     print "Hi!\n\n";
     print "OKAPI just added additional field (along with an index) 'okapi_syncbase'\n";
     print "on your 'cache_logs' AND 'cache_logs_archived' tables. It is required by\n";
     print "OKAPI's 'replicate' module to function properly.\n\n";
     self::print_common_db_alteration_info();
     print "-- \n";
     print "OKAPI Team";
     Okapi::mail_admins("Database modification notice: caches.okapi_syncbase", ob_get_clean());
 }
开发者ID:kojoty,项目名称:okapi,代码行数:12,代码来源:update.php


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