本文整理汇总了PHP中Daemon::parseTime方法的典型用法代码示例。如果您正苦于以下问题:PHP Daemon::parseTime方法的具体用法?PHP Daemon::parseTime怎么用?PHP Daemon::parseTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Daemon
的用法示例。
在下文中一共展示了Daemon::parseTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
Daemon::addDefaultSettings(array('mod' . $this->modname . 'listen' => 'tcp://0.0.0.0', 'mod' . $this->modname . 'listen-port' => 80, 'mod' . $this->modname . 'log-events' => 0, 'mod' . $this->modname . 'log-queue' => 0, 'mod' . $this->modname . 'send-file' => 0, 'mod' . $this->modname . 'send-file-dir' => '/dev/shm', 'mod' . $this->modname . 'send-file-prefix' => 'http-', 'mod' . $this->modname . 'send-file-onlybycommand' => 0, 'mod' . $this->modname . 'keepalive' => '0s', 'mod' . $this->modname . 'enable' => 0));
Daemon::$parsedSettings['mod' . $this->modname . 'keepalive'] = Daemon::parseTime(Daemon::$settings['mod' . $this->modname . 'keepalive']);
if (Daemon::$settings['mod' . $this->modname . 'enable']) {
Daemon::log(__CLASS__ . ' up.');
$this->bindSockets(Daemon::$settings['mod' . $this->modname . 'listen'], Daemon::$settings['mod' . $this->modname . 'listenport']);
}
}
示例2: init
public function init()
{
Daemon::addDefaultSettings(array('mod' . $this->modname . 'listen' => 'tcp://127.0.0.1,unix:/tmp/phpdaemon.fcgi.sock', 'mod' . $this->modname . 'listen-port' => 9000, 'mod' . $this->modname . 'allowed-clients' => '127.0.0.1', 'mod' . $this->modname . 'log-records' => 0, 'mod' . $this->modname . 'log-records-miss' => 0, 'mod' . $this->modname . 'log-events' => 0, 'mod' . $this->modname . 'log-queue' => 0, 'mod' . $this->modname . 'send-file' => 0, 'mod' . $this->modname . 'send-file-dir' => '/dev/shm', 'mod' . $this->modname . 'send-file-prefix' => 'fcgi-', 'mod' . $this->modname . 'send-file-onlybycommand' => 0, 'mod' . $this->modname . 'keepalive' => '0s', 'mod' . $this->modname . 'enable' => 0));
Daemon::$parsedSettings['mod' . $this->modname . 'keepalive'] = Daemon::parseTime(Daemon::$settings['mod' . $this->modname . 'keepalive']);
if (Daemon::$settings['mod' . $this->modname . 'enable']) {
Daemon::log(__CLASS__ . ' up.');
$this->allowedClients = explode(',', Daemon::$settings['mod' . $this->modname . 'allowedclients']);
$this->bindSockets(Daemon::$settings['mod' . $this->modname . 'listen'], Daemon::$settings['mod' . $this->modname . 'listenport']);
}
}
示例3: loadSettings
public static function loadSettings($settings)
{
$error = FALSE;
static $ktr = array('-' => '');
foreach ($settings as $k => $v) {
$k = strtolower(strtr($k, $ktr));
if ($k === 'config') {
$k = 'configfile';
}
if ($k === 'user' || $k === 'group') {
if ($v === '') {
$v = NULL;
}
}
if (array_key_exists($k, Daemon::$settings)) {
if ($k === 'maxmemoryusage') {
Daemon::$parsedSettings[$k] = Daemon::parseSize($v);
} elseif ($k === 'maxrequests') {
Daemon::$parsedSettings[$k] = Daemon::parseNum($v);
} elseif ($k === 'autogc') {
Daemon::$parsedSettings[$k] = Daemon::parseNum($v);
} elseif ($k === 'maxidle') {
Daemon::$parsedSettings[$k] = Daemon::parseTime($v);
} elseif ($k === 'autoreload') {
Daemon::$parsedSettings[$k] = Daemon::parseTime($v);
} elseif ($k === 'maxconcurrentrequestsperworker') {
Daemon::$parsedSettings[$k] = Daemon::parseNum($v);
} elseif ($k === 'keepalive') {
Daemon::$parsedSettings[$k] = Daemon::parseTime($v);
} elseif ($k === 'mpmdelay') {
Daemon::$parsedSettings[$k] = Daemon::parseTime($v);
} elseif ($k === 'chunksize') {
Daemon::$parsedSettings[$k] = Daemon::parseSize($v);
}
if (is_int(Daemon::$settings[$k])) {
Daemon::$settings[$k] = (int) $v;
} else {
Daemon::$settings[$k] = $v;
}
} elseif (strpos($k, 'mod') === 0) {
Daemon::$settings[$k] = $v;
} else {
Daemon::log('Unrecognized parameter \'' . $k . '\'');
$error = TRUE;
}
}
if (isset($settings['path'])) {
if (isset(Daemon::$settings['chroot'])) {
Daemon::$pathReal = realpath(Daemon::$settings['chroot'] . (substr(Daemon::$settings['chroot'], -1) != '/' ? '/' : '') . Daemon::$settings['path']);
} else {
Daemon::$pathReal = realpath(Daemon::$settings['path']);
}
}
return !$error;
}