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