本文整理汇总了PHP中Piwik_Common::runScheduledTasks方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik_Common::runScheduledTasks方法的具体用法?PHP Piwik_Common::runScheduledTasks怎么用?PHP Piwik_Common::runScheduledTasks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik_Common
的用法示例。
在下文中一共展示了Piwik_Common::runScheduledTasks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
/**
* Main
*/
public function main()
{
$this->init();
try {
if ($this->isVisitValid()) {
self::connectDatabase();
$visit = $this->getNewVisitObject();
$visit->setRequest($this->request);
$visit->handle();
unset($visit);
}
Piwik_Common::runScheduledTasks($now = $this->getCurrentTimestamp());
} catch (Piwik_Tracker_Db_Exception $e) {
printDebug("<b>" . $e->getMessage() . "</b>");
} catch (Piwik_Tracker_Visit_Excluded $e) {
} catch (Exception $e) {
Piwik_Tracker_ExitWithException($e);
}
$this->end();
}
示例2: main
/**
* Main - tracks the visit/action
*
* @param array $args Optional Request Array
*/
public function main($args = null)
{
$displayedGIF = false;
$this->initRequests($args);
if (!empty($this->requests)) {
// handle all visits
foreach ($this->requests as $request) {
$this->init($request);
if (!$displayedGIF && !$this->authenticated) {
$this->outputTransparentGif();
$displayedGIF = true;
}
try {
if ($this->isVisitValid()) {
self::connectDatabaseIfNotConnected();
$visit = $this->getNewVisitObject();
$visit->setRequest($request);
$visit->handle();
unset($visit);
} else {
printDebug("The request is invalid: empty request, or maybe tracking is disabled in the config.ini.php via record_statistics=0");
}
} catch (Piwik_Tracker_Db_Exception $e) {
printDebug("<b>" . $e->getMessage() . "</b>");
$this->exitWithException($e, $this->authenticated);
} catch (Piwik_Tracker_Visit_Excluded $e) {
} catch (Exception $e) {
$this->exitWithException($e, $this->authenticated);
}
$this->clear();
// increment successfully logged request count. make sure to do this after try-catch,
// since an excluded visit is considered 'successfully logged'
++$this->countOfLoggedRequests;
}
if (!$displayedGIF) {
$this->outputTransparentGif();
$displayedGIF = true;
}
} else {
$this->handleEmptyRequest($_GET + $_POST);
}
// run scheduled task
try {
// 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
if (!Piwik_Common::isPhpCliMode() && !$this->authenticated) {
Piwik_Common::runScheduledTasks($now = $this->getCurrentTimestamp());
}
} catch (Exception $e) {
$this->exitWithException($e, $this->authenticated);
}
$this->end();
}
示例3: main
/**
* Main
*/
public function main()
{
$this->init();
try {
if( $this->isVisitValid() )
{
self::connectDatabase();
$visit = $this->getNewVisitObject();
$visit->setRequest($this->request);
$visit->handle();
unset($visit);
}
// 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
if(!Piwik_Common::isPhpCliMode()
&& !$this->authenticated)
{
Piwik_Common::runScheduledTasks($now = $this->getCurrentTimestamp());
}
} catch (Piwik_Tracker_Db_Exception $e) {
printDebug("<b>".$e->getMessage()."</b>");
} catch(Piwik_Tracker_Visit_Excluded $e) {
} catch(Exception $e) {
Piwik_Tracker_ExitWithException($e);
}
$this->end();
}