コード例 #1
0
ファイル: server.php プロジェクト: soldair/solumWebSocket
 public static function init(&$sockets, &$clients)
 {
     if (self::$initalized) {
         return;
     }
     $sockets =& self::$sockets;
     $clients =& self::$clients;
     self::$initalized = 1;
     // Allow the script to hang around waiting for connections.
     set_time_limit(0);
     // Turn on implicit output flushing so output gets sent imediately
     ob_implicit_flush();
     $DEBUG = true;
     define('DEBUG', $DEBUG);
     self::require_libs();
     self::load_config();
     if (issetArg('help') || issetArg('?')) {
         self::show_help();
         exit;
     }
     if (!($modules = self::config('modules'))) {
         exit("[FATAL ERROR] no modules loaded in the config.\n");
     }
     foreach ($modules as $m) {
         module::load($m);
     }
 }