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


PHP Statistics类代码示例

本文整理汇总了PHP中Statistics的典型用法代码示例。如果您正苦于以下问题:PHP Statistics类的具体用法?PHP Statistics怎么用?PHP Statistics使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Statistics类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: statistics

 /**
  * to increase the count for different keywords
  * @param string $keyword - keyword of different function
  */
 protected function statistics($keyword)
 {
     if ($keyword == null) {
         return;
     }
     $statistics = new Statistics();
     $statistics->add($keyword);
 }
开发者ID:jianhua1982,项目名称:wlight,代码行数:12,代码来源:wx_response.php

示例2: process

 public function process($parameters)
 {
     $statistics = new Statistics();
     $this->head['title'] = 'Štatistiky webu';
     $this->data['usersByArticles'] = $statistics->returnUsersByArticles();
     $this->data['usersByComments'] = $statistics->returnUsersByComments();
     $this->data['articlesByVisits'] = $statistics->returnArticlesByVisits();
     $this->view = 'statistics';
 }
开发者ID:tomas3093,项目名称:MVC,代码行数:9,代码来源:StatistikyController.php

示例3: process

 public function process($parameters)
 {
     $statistics = new Statistics();
     $validation = new Validation();
     $this->head['title'] = 'Štatistiky webu';
     $this->data['articlesByVisits'] = array();
     $articles = $statistics->returnArticlesByVisits();
     //skratenie titulkov jednotlivych clankov na 35 znakov
     foreach ($articles as $article) {
         $article['title'] = $validation->stringLimitLenght($article['title'], 35);
         $this->data['articlesByVisits'][] = $article;
     }
     $this->view = 'statistics';
 }
开发者ID:tomas3093,项目名称:cms-blog,代码行数:14,代码来源:StatistikyController.php

示例4: postInsert

 public function postInsert($event)
 {
     $oStatistics = new Statistics();
     $oStatistics->setCategoryId($this->getId());
     try {
         $iPeriod = Period::getCurrentPeriod();
     } catch (sfException $e) {
         return;
     }
     if (false !== $iPeriod) {
         $oStatistics->setPeriodId($iPeriod);
         $oStatistics->save();
     }
 }
开发者ID:rollmax,项目名称:read2read,代码行数:14,代码来源:Category.class.php

示例5: extractPage

 public function extractPage($pageID, $pageTitle, $pageSource)
 {
     $this->extractor->setPageURI($pageID);
     if (!$this->extractor->isActive()) {
         return $result = new ExtractionResult($pageID, $this->extractor->getLanguage(), $this->getExtractorID());
     }
     Timer::start($this->extractor->getExtractorID());
     $result = $this->extractor->extractPage($pageID, $pageTitle, $pageSource);
     Timer::stop($this->extractor->getExtractorID());
     Timer::start('validation');
     //$this->extractor->check();
     if (Options::getOption('validateExtractors')) {
         ValidateExtractionResult::validate($result, $this->extractor);
     }
     Timer::stop('validation');
     Statistics::increaseCount($this->extractor->getExtractorID(), 'created_Triples', count($result->getTriples()));
     Statistics::increaseCount('Total', 'created_Triples', count($result->getTriples()));
     if ($this->extractor->isGenerateOWLAxiomAnnotations()) {
         $triples = $result->getTriples();
         if (count($triples) > 0) {
             foreach ($triples as $triple) {
                 $triple->addDCModifiedAnnotation();
                 $triple->addExtractedByAnnotation($this->extractor->getExtractorID());
             }
         }
     }
     return $result;
 }
开发者ID:nsystem1,项目名称:ZeeJong,代码行数:28,代码来源:ExtractorContainer.php

示例6: get

 public static function get($series)
 {
     $total = $GLOBALS['PW_DB']->executeRaw(Statistics::getSQL($series));
     $week = $GLOBALS['PW_DB']->executeRaw(Statistics::getSQL($series, ' AND `key`>' . (time() - 7 * 60 * 60 * 24)));
     $day = $GLOBALS['PW_DB']->executeRaw(Statistics::getSQL($series, ' AND `key`>' . (time() - 60 * 60 * 24)));
     return array($total[0], $week[0], $day[0]);
 }
开发者ID:ryanaverill,项目名称:phpwatch,代码行数:7,代码来源:Statistics.php

示例7: getInstance

 public static function getInstance()
 {
     if (!isset(self::$instace)) {
         self::$instace = new Statistics();
     }
     return self::$instace;
 }
开发者ID:ecuation,项目名称:Control-de-stock,代码行数:7,代码来源:Statistics.php

示例8: __construct

 public function __construct(array $samples, array $stats = [])
 {
     if (count($samples) < 1) {
         throw new \LogicException('Cannot create a distribution with zero samples.');
     }
     $this->samples = $samples;
     $this->closures = ['min' => function () {
         return min($this->samples);
     }, 'max' => function () {
         return max($this->samples);
     }, 'sum' => function () {
         return array_sum($this->samples);
     }, 'stdev' => function () {
         return Statistics::stdev($this->samples);
     }, 'mean' => function () {
         return Statistics::mean($this->samples);
     }, 'mode' => function () {
         return Statistics::kdeMode($this->samples);
     }, 'variance' => function () {
         return Statistics::variance($this->samples);
     }, 'rstdev' => function () {
         $mean = $this->getMean();
         return $mean ? $this->getStdev() / $mean * 100 : 0;
     }];
     if ($diff = array_diff(array_keys($stats), array_keys($this->closures))) {
         throw new \RuntimeException(sprintf('Unknown pre-computed stat(s) encountered: "%s"', implode('", "', $diff)));
     }
     $this->stats = $stats;
 }
开发者ID:dantleech,项目名称:phpbench,代码行数:29,代码来源:Distribution.php

示例9: skate

 public function skate()
 {
     parent::isAllowedToAccess();
     parent::setLayout('defaultLayout');
     parent::setView('skate');
     $this->data['parameters'] = $this->parameters;
     $this->data['orders'] = Statistics::getOrdersOverview(1, '2015-12-02', '2015-12-15');
     parent::renderLayout();
 }
开发者ID:jezekl,项目名称:logger,代码行数:9,代码来源:Dashboard.class.php

示例10: getStat

 /**
  * This method returns Statistics object to create the pie graph or the status list
  * @return Statistics
  */
 public function getStat()
 {
     $count = array();
     $size = array();
     $blks = array();
     $db_result = $this->db_request->select(null, ACCT_TABLE, array(STATUS), null);
     $stat = new Statistics();
     foreach ($db_result as $line) {
         $stname = $this->db_request->statusName($line[STATUS]);
         $count[$stname] = $line['SUM(' . COUNT . ')'];
         $size[$stname] = $line['SUM(' . SIZE . ')'];
         $blks[$stname] = $line['SUM(' . BLOCKS . ')'];
     }
     $stat->setSize($size);
     $stat->setBlocks($blks);
     $stat->setCount($count);
     return $stat;
 }
开发者ID:rootfs,项目名称:robinhood,代码行数:22,代码来源:StatusManager.class.php

示例11: setSmarty

 public function setSmarty()
 {
     $statistics = Statistics::getInstance();
     $month_info = $statistics->getCurrentMonthSalesInformation();
     $this->context->smarty->assign("operations", $month_info['operations']);
     $this->context->smarty->assign("month_sales", $month_info['total']);
     $this->context->smarty->assign("page_title", "Shop page");
     $this->context->smarty->display("shop.tpl");
 }
开发者ID:ecuation,项目名称:Control-de-stock,代码行数:9,代码来源:ShopController.php

示例12: getFullStatistics

 /**
  * Returns row by input data
  *
  * @param integer $iPeriodId
  * @param integer $iCategoryId: null
  * @return Statistics
  */
 public function getFullStatistics($iPeriodId, $iCategoryId = null)
 {
     $q = Doctrine_Query::create()->select('s.*')->from('Statistics s')->where('s.period_id=?', $iPeriodId)->limit(1);
     if (null !== $iCategoryId) {
         $q->andWhere('s.category_id=?', $iCategoryId);
     } else {
         $q->andWhere('s.category_id IS NULL');
     }
     $stat = $q->fetchOne();
     if (!is_object($stat)) {
         $stat = new Statistics();
         $stat->setPeriodId($iPeriodId);
         if (null !== $iCategoryId) {
             $stat->setCategoryId($iCategoryId);
         }
         $stat->save();
     }
     return $stat;
 }
开发者ID:rollmax,项目名称:read2read,代码行数:26,代码来源:StatisticsTable.class.php

示例13: getDashboard

 /**
  * Displays the administration dashboard
  *
  * @access public
  * @return \Illuminate\Support\Facades\View
  */
 public function getDashboard()
 {
     // Get all stats for the last 1 month
     $duration = Site::config('general')->statsDisplay;
     $date = date('Y-m-d', strtotime($duration));
     $stats = Statistics::where('date', '>', $date)->orderBy('date')->get()->toArray();
     // Build the view data
     $data = array('users' => User::count(), 'pastes' => Paste::count(), 'php_version' => phpversion(), 'sn_version' => Config::get('app.version'), 'db_driver' => Config::get('database.default'), 'stats' => $stats);
     return View::make('admin/dashboard', $data);
 }
开发者ID:carriercomm,项目名称:sticky-notes,代码行数:16,代码来源:AdminController.php

示例14: getStat

 /**
  * This method returns Statistics object to create the pie graph or the user list
  * @return Statistics
  */
 public function getStat()
 {
     $count = array();
     $size = array();
     $blks = array();
     $db_result = $this->db_request->select(null, ACCT_TABLE, array(GROUP), null);
     $stat = new Statistics();
     foreach ($db_result as $line) {
         if ($line[GROUP] && $line['SUM(' . COUNT . ')'] && $line['SUM(' . SIZE . ')']) {
             $count[$line[GROUP]] = $line['SUM(' . COUNT . ')'];
             $size[$line[GROUP]] = $line['SUM(' . SIZE . ')'];
             $blks[$line[GROUP]] = $line['SUM(' . BLOCKS . ')'];
         }
     }
     $stat->setSize($size);
     $stat->setBlocks($blks);
     $stat->setCount($count);
     return $stat;
 }
开发者ID:rootfs,项目名称:robinhood,代码行数:23,代码来源:GroupManager.class.php

示例15: defaultView

 public function defaultView()
 {
     parent::isAllowedToAccess();
     parent::setLayout('defaultLayout');
     parent::setView('default');
     $this->data['parameters'] = $this->parameters;
     $this->data['clicks'] = Statistics::getClicksOverview(1, '1920x1080', 'www.skate-praha.cz/');
     $this->data['clicks2'] = Statistics::getClicksOverview(1, '1366x768', 'www.skate-praha.cz/');
     $this->data['clicks3'] = Statistics::getClicksOverview(1, '1920x1080', 'www.skate-praha.cz/kosik/');
     $this->data['clicks4'] = Statistics::getClicksOverview(1, '1920x1080', 'www.skate-praha.cz/pokladna/');
     $this->data['clicks5'] = Statistics::getClicksOverview(1, '1920x1080', 'www.skate-praha.cz/rekapitulace/');
     parent::renderLayout();
 }
开发者ID:jezekl,项目名称:logger,代码行数:13,代码来源:Click.class.php


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