本文整理匯總了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();
}