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


PHP core::save_logs方法代码示例

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


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

示例1: factory

 public static function factory($driver)
 {
     if (require BASEPATH . '/core/drivers/' . $driver . '.php') {
         core::alog('factory(): using ' . $driver . ' database driver', 'BASIC');
         self::$driver = new $driver();
         // store the instance here
     } else {
         core::alog('factory(): failed to open ' . $driver . ' database driver', 'BASIC');
         core::save_logs();
         // force a log save
     }
     // see if we can require the file
     // if so initiate the class
     // if not, bail.
 }
开发者ID:rickihastings,项目名称:acorairc,代码行数:15,代码来源:database.php

示例2: restart_command

 public static function restart_command($nick, $ircdata = array())
 {
     // we don't even need to listen for any
     // parameters, because its just a straight command
     if (services::is_root($nick)) {
         if (isset(core::$config->settings->shutdown_message) || core::$config->settings->shutdown_message != null) {
             ircd::global_notice(core::$config->global->nick, '*!*@*', core::$config->settings->shutdown_message);
         }
         // is there a shutdown message?
         core::save_logs();
         // save logs.
         ircd::shutdown('shutdown command from ' . $nick, false);
         // exit the server
         fclose(core::$socket);
         // close the socket first.
         if (substr(php_uname(), 0, 7) != 'Windows') {
             if (core::$debug) {
                 system('php ' . BASEPATH . '/services.php debug');
             } else {
                 exec('php ' . BASEPATH . '/services.php > /dev/null &');
             }
             // reboot if we're running anything but windows
             // if debug we send the output back to the screen, else we send it to /dev/null
         } else {
             if (!isset(core::$config->settings->php_dir) || core::$config->settings->php_dir == '') {
                 define('PHPDIR', 'C:\\php\\php.exe');
             } else {
                 define('PHPDIR', core::$config->settings->php_dir);
             }
             // define where the php binary is located.
             exec('@cd ' . BASEPATH);
             // cd to the basedir
             if (core::$debug) {
                 system('@' . PHPDIR . ' services.php debug');
             } else {
                 exec('@' . PHPDIR . ' services.php');
             }
             // if we run windows we do a different method of reboot
             // again if we debug we send it to the screen, if not.. we don't
         }
         exit;
         // exit the program
     } else {
         services::communicate(core::$config->operserv->nick, $nick, &operserv::$help->OS_ACCESS_DENIED);
     }
 }
开发者ID:rickihastings,项目名称:acorairc,代码行数:46,代码来源:shutdown.os.php

示例3: __construct

 public function __construct()
 {
     modules::init_module('mysql_driver', self::MOD_VERSION, self::MOD_AUTHOR, 'driver', 'static');
     // these are standard in module constructors
     if (!(self::$link = @mysql_connect(core::$config->database->server, core::$config->database->user, core::$config->database->pass))) {
         core::alog('database(): failed to connect to ' . core::$config->database->server . ' ' . core::$config->database->user . ':' . core::$config->database->pass, 'BASIC');
         core::save_logs();
         // force a log save
     }
     // can we connect to sql?
     if (!@mysql_select_db(core::$config->database->name, self::$link)) {
         core::alog('database(): failed to select database ' . core::$config->database->name, 'BASIC');
         core::save_logs();
         // force a log save
     }
     // can we select the database?
     core::alog('database(): connection to database sucessful', 'BASIC');
     // log the sucessful connection
     if (core::$config->database->optimize) {
         timer::add(array('database', 'optimize', array()), 86399, 0);
     }
     // add a timer to optimize the db every day.
 }
开发者ID:rickihastings,项目名称:acorairc,代码行数:23,代码来源:mysql.php

示例4: check

 public static function check()
 {
     foreach (self::$required as $var => $value) {
         if (!isset(self::$config[$value])) {
             core::alog('ERROR: ' . $value . ' is REQUIRED, startup halted', 'BASIC');
             core::save_logs();
             // force a log save.
         }
     }
     // check for required vars
     if (is_array(self::$config['chanserv_exception_modules']) && !in_array('cs_fantasy', self::$config['chanserv_exception_modules'])) {
         if (!isset(self::$config['fantasy_prefix'])) {
             self::$config['fantasy_prefix'] = '!';
         }
     }
     // check for undefined vars.
     foreach (self::$config as $var => $value) {
         if ($value == 'yes' || $value == 'true' || $value == '1') {
             self::$config[$var] = true;
         }
         if ($value == 'no' || $value == 'false' || $value == '0') {
             self::$config[$var] = false;
         }
     }
     // convert 'yes', 'true', '1' and their opposites to booleans
 }
开发者ID:rickihastings,项目名称:acorairc,代码行数:26,代码来源:parser.php


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