Exemplo n.º 1
0
 public static function core_error($severity, $message, $filepath, $line)
 {
     if (($severity & error_reporting()) == $severity) {
         self::save_logs();
         // save logs.
         self::alog('error: ' . trim($message) . ' on line ' . $line . ' in ' . $filepath, 'BASIC');
         #
         ircd::shutdown('ERROR', true);
         // exit the program
     }
     return true;
     // don't execute php internal error handler
 }
Exemplo n.º 2
0
 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);
     }
 }