/** * Loads default setting. * @return void */ public static function initSettings() { Daemon::$version = file_get_contents('VERSION', true); Daemon::$config = new Daemon_Config(); Daemon::$useSockets = version_compare(PHP_VERSION, '5.3.1', '>='); // currently re-using listener ports across multiple processes is available // only in BSD flavour operating systems via SO_REUSEPORT socket option Daemon::$reusePort = (bool) preg_match("~BSD~i", php_uname('s')); if (Daemon::$reusePort) { if (!defined("SO_REUSEPORT")) { define("SO_REUSEPORT", 0x200); } } // FIXME: this is a BSD-only hack }