本文整理汇总了PHP中Daemon::useSockets方法的典型用法代码示例。如果您正苦于以下问题:PHP Daemon::useSockets方法的具体用法?PHP Daemon::useSockets怎么用?PHP Daemon::useSockets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Daemon
的用法示例。
在下文中一共展示了Daemon::useSockets方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initSettings
public static function initSettings()
{
Daemon::$version = file_get_contents(Daemon::$dir . '/VERSION');
Daemon::$settings = array('maxrequests' => '1k', 'maxmemoryusage' => '0b', 'maxidle' => '0s', 'expose' => 1, 'pidfile' => '/var/run/phpdaemon.pid', 'defaultpidfile' => '/var/run/phpdaemon.pid', 'configfile' => Daemon::$dir . '/conf/phpdaemon.conf.php', 'chroot' => '/', 'cwd' => '.', 'path' => NULL, 'startworkers' => 20, 'minworkers' => 20, 'maxworkers' => 80, 'minspareworkers' => 20, 'maxspareworkers' => 50, 'obfilterauto' => 1, 'logstorage' => '/var/log/phpdaemon-%DATE=d.m.Y%.log', 'logging' => 1, 'user' => NULL, 'group' => NULL, 'keepalive' => '0s', 'autoreadbodyfile' => 1, 'ipcwstate' => '/var/run/phpdaemon-wstate.ipc', 'autogc' => '1', 'mpmdelay' => '1s', 'logsignals' => 0, 'chunksize' => '8k', 'maxconcurrentrequestsperworker' => 1000, 'logreads' => 0, 'autoreload' => '0s', 'logworkersetstatus' => 0, 'logevents' => 0, 'logqueue' => 0, 'microsleep' => 100000, 'logsendrecordmiss' => 0, 'workerpriority' => 4, 'masterpriority' => 100, 'throwexceptiononshutdown' => 0, 'locale' => '', 'logerrors' => 1);
Daemon::loadSettings(Daemon::$settings);
Daemon::$useSockets = version_compare(PHP_VERSION, '5.3.1', '>=');
Daemon::$dummyRequest = new stdClass();
Daemon::$dummyRequest->attrs = new stdClass();
Daemon::$dummyRequest->attrs->stdin_done = TRUE;
Daemon::$dummyRequest->attrs->params_done = TRUE;
Daemon::$dummyRequest->attrs->chunked = FALSE;
}
示例2: initSettings
/**
* 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
}