当前位置: 首页>>代码示例>>PHP>>正文


PHP Piwik_Common::runScheduledTasks方法代码示例

本文整理汇总了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();
 }
开发者ID:Gninety,项目名称:Microweber,代码行数:23,代码来源:Tracker.php

示例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();
 }
开发者ID:nomoto-ubicast,项目名称:piwik,代码行数:58,代码来源:Tracker.php

示例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();
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:34,代码来源:Tracker.php


注:本文中的Piwik_Common::runScheduledTasks方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。