本文整理汇总了PHP中Visitor::store方法的典型用法代码示例。如果您正苦于以下问题:PHP Visitor::store方法的具体用法?PHP Visitor::store怎么用?PHP Visitor::store使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Visitor
的用法示例。
在下文中一共展示了Visitor::store方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render($arr)
{
$this->dispatch($arr);
// if the path contains three elements and more, then the second one from the end
// is a tracking code
if (isset($this->_trackCode)) {
$visitor = new Visitor();
$visitor->trackCode = $this->_trackCode;
$visitor->resource = $this->_resource;
$visitor->ip = $_SERVER['REMOTE_ADDR'];
$visitor->userAgent = $_SERVER['HTTP_USER_AGENT'];
$visitor->time = date('Y-m-d H:i:s', $_SERVER['REQUEST_TIME']);
$visitor->redirectTo = null;
$visitor->store();
}
$this->renderJPG($this->_resource);
}
示例2: render
/**
* Renders a page based on input array.
*
* Stores all the requests.
* @param Array $arr array of strings corresponding to requested resourses
*/
public function render($arr)
{
$this->dispatch($arr);
$visitor = new Visitor();
$visitor->trackCode = isset($this->_trackCode) ? $this->_trackCode : null;
$visitor->resource = $this->_resource;
$visitor->ip = $_SERVER['REMOTE_ADDR'];
$visitor->userAgent = $_SERVER['HTTP_USER_AGENT'];
$visitor->time = date('Y-m-d H:i:s', $_SERVER['REQUEST_TIME']);
$visitor->redirectTo = $this->_redirectTo;
$visitor->store();
if (isset($this->_redirectTo)) {
header('location: ' . $this->_redirectTo);
} else {
$this->_logger->logInfo(__METHOD__, "there is no mapping for {$this->_resource}.");
}
}