本文整理汇总了PHP中Trace::info方法的典型用法代码示例。如果您正苦于以下问题:PHP Trace::info方法的具体用法?PHP Trace::info怎么用?PHP Trace::info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Trace
的用法示例。
在下文中一共展示了Trace::info方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: start
public function start($setting = array())
{
Trace::info(str_repeat('-', 100));
Trace::info(str_pad('[ ShadowSocks Swoole PHP ]', 100, ' ', STR_PAD_BOTH));
Trace::info(str_pad("IP:" . self::$conf['ip'] . " PORT:" . self::$conf['port'], 100, ' ', STR_PAD_BOTH));
Trace::info(str_pad("PassWord : " . self::$conf['passwd'], 100, ' ', STR_PAD_BOTH));
Trace::info(str_pad("Encode :" . self::$conf['method'], 100, ' ', STR_PAD_BOTH));
Trace::info(str_repeat('-', 100));
$default = ['timeout' => 1, 'poll_thread_num' => 1, 'worker_num' => 4, 'backlog' => 128, 'dispatch_mode' => 2];
$setting = array_merge($default, $setting);
$this->serv->set($setting);
$this->serv->start();
}
示例2: send
public function send($data = null)
{
//锁定状态写入队列
if (!empty($data)) {
$this->queue->push($data);
}
if ($this->reconn) {
Trace::debug("*********cli {$this->fd} reconn \n");
$this->cli->connect($this->conf['ip'], $this->conf['port']);
$this->reconn = false;
$this->lock = true;
}
if ($this->queue->isEmpty()) {
$this->lock = false;
} elseif (!$this->lock) {
$this->lock = true;
$data = $this->queue->shift();
Trace::debug("*********cli {$this->fd} send " . strlen($data) . "\n==================\n" . substr($data, 0, 50) . "...\n==============");
Trace::info(sprintf("Host: %-25s %s", $this->conf['host'], strstr($data, "\n", true)));
//;'Host:' . $this->conf['host'] . strstr($data, "\n", true)
$this->cli->send($data);
}
}