本文整理汇总了PHP中Piwik\Tracker::shouldRecordStatistics方法的典型用法代码示例。如果您正苦于以下问题:PHP Tracker::shouldRecordStatistics方法的具体用法?PHP Tracker::shouldRecordStatistics怎么用?PHP Tracker::shouldRecordStatistics使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Tracker
的用法示例。
在下文中一共展示了Tracker::shouldRecordStatistics方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: outputResponse
public function outputResponse(Tracker $tracker)
{
if (!$tracker->shouldRecordStatistics()) {
$this->outputApiResponse($tracker);
Common::printDebug("Logging disabled, display transparent logo");
} elseif (!$tracker->hasLoggedRequests()) {
if (!$this->isHttpGetRequest() || !empty($_GET) || !empty($_POST)) {
Common::sendResponseCode(400);
}
Common::printDebug("Empty request => Piwik page");
echo "<a href='/'>Piwik</a> is a free/libre web <a href='http://piwik.org'>analytics</a> that lets you keep control of your data.";
} else {
$this->outputApiResponse($tracker);
Common::printDebug("Nothing to notice => default behaviour");
}
Common::printDebug("End of the page.");
if ($tracker->isDebugModeEnabled() && $tracker->isDatabaseConnected() && TrackerDb::isProfilingEnabled()) {
$db = Tracker::getDatabase();
$db->recordProfiling();
Profiler::displayDbTrackerProfile($db);
}
if ($tracker->isDebugModeEnabled()) {
Common::printDebug($_COOKIE);
Common::printDebug((string) $this->timer);
}
}
示例2: outputResponse
public function outputResponse(Tracker $tracker)
{
if (!$tracker->shouldRecordStatistics()) {
$this->outputApiResponse($tracker);
Common::printDebug("Logging disabled, display transparent logo");
} elseif (!$tracker->hasLoggedRequests()) {
if (!$this->isHttpGetRequest() || !empty($_GET) || !empty($_POST)) {
Common::sendResponseCode(400);
}
Common::printDebug("Empty request => Piwik page");
echo "This resource is part of Piwik. Keep full control of your data with the leading free and open source <a href='https://piwik.org' target='_blank'>digital analytics platform</a> for web and mobile.";
} else {
$this->outputApiResponse($tracker);
Common::printDebug("Nothing to notice => default behaviour");
}
Common::printDebug("End of the page.");
if ($tracker->isDebugModeEnabled() && $tracker->isDatabaseConnected() && TrackerDb::isProfilingEnabled()) {
$db = Tracker::getDatabase();
$db->recordProfiling();
Profiler::displayDbTrackerProfile($db);
}
if ($tracker->isDebugModeEnabled()) {
Common::printDebug($_COOKIE);
Common::printDebug((string) $this->timer);
}
}
示例3: outputResponse
public function outputResponse(Tracker $tracker)
{
if (!$tracker->shouldRecordStatistics()) {
$this->outputApiResponse($tracker);
Common::printDebug("Logging disabled, display transparent logo");
} elseif (!$tracker->hasLoggedRequests()) {
if (!$this->isHttpGetRequest() || !empty($_GET) || !empty($_POST)) {
Common::sendResponseCode(400);
}
Common::printDebug("Empty request => Piwik page");
//echo date('Y-m-d H:i:s');
} else {
$this->outputApiResponse($tracker);
Common::printDebug("Nothing to notice => default behaviour");
}
Common::printDebug("End of the page.");
if ($tracker->isDebugModeEnabled() && $tracker->isDatabaseConnected() && TrackerDb::isProfilingEnabled()) {
$db = Tracker::getDatabase();
$db->recordProfiling();
Profiler::displayDbTrackerProfile($db);
}
if ($tracker->isDebugModeEnabled()) {
Common::printDebug($_COOKIE);
Common::printDebug((string) $this->timer);
}
}
示例4: shouldRun
public function shouldRun(Tracker $tracker)
{
if (Common::isPhpCliMode()) {
// don't run scheduled tasks in CLI mode from Tracker, this is the case
// where we bulk load logs & don't want to lose time with tasks
return false;
}
return $tracker->shouldRecordStatistics();
}
示例5: shouldRecordStatistics
public function shouldRecordStatistics()
{
if (!$this->record) {
return false;
}
return parent::shouldRecordStatistics();
}