本文整理汇总了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.
}
示例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);
}
}
示例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.
}
示例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
}