• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Statistics类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: show

 public function show($statType = null)
 {
     $this->view->title = 'Перегляд статистики';
     if ($statType == null) {
         $this->view->countByDay = $this->model->getCountByDay();
         $this->view->getCountMainPageUpdate = $this->model->getCountMainPageUpdate();
         $this->view->data = Statistics::getStatistics();
     } else {
         $this->view->countByDay = $this->model->getCountByDay();
         $this->view->getCountMainPageUpdate = $this->model->getCountMainPageUpdate();
         $this->view->data = Statistics::getStatistics($statType);
     }
     $this->view->render('statistics/show');
 }
开发者ID:olehpitsun,项目名称:duplom.comv2.2.1,代码行数:14,代码来源:statisticsController.php


示例17: viewUncached

 /**
  * Return a freshly built block.
  *
  * By default, stats are computed for the preceding month. See how to swap
  * the default interpretation by changing which block is commented out.
  *
  * @return array
  *   A subject/content hash.
  */
 public function viewUncached()
 {
     $count = $this->getCount();
     $display = variable_get(static::VARDISPLAY, static::DEFDISPLAY);
     $separator = variable_get(static::VARSEP, static::DEFSEP);
     // Return Zeitgeist for the previous month.
     $ar_date = getdate();
     // Mktime() wraps months cleanly, no worry.
     $start = mktime(0, 0, 0, $ar_date['mon'] - 1, 1, $ar_date['year']);
     unset($ar_date);
     // Return Zeitgeist for the current month.
     $start = NULL;
     $statistics = Statistics::getStatistics(Span::MONTH, $start, 'node', $count);
     $ret = array('subject' => t('Top @count searches', array('@count' => $this->count)), 'content' => array('#theme' => 'zeitgeist_block_top', '#count' => $this->count, '#items' => $statistics->scores, '#nofollow' => static::isNoFollowEnabled(), '#display' => $display, '#separator' => $separator));
     return $ret;
 }
开发者ID:agroknow,项目名称:agreri,代码行数:25,代码来源:BlockTop.php


示例18: actionUpdate

 public function actionUpdate()
 {
     $competitions = Competition::model()->findAllByAttributes(array('type' => Competition::TYPE_WCA), array('condition' => 'date < unix_timestamp() AND date > unix_timestamp() - 86400 * 20', 'order' => 'date ASC'));
     $wcaDb = intval(file_get_contents(dirname(__DIR__) . '/config/wcaDb'));
     $sql = "UPDATE `user` `u`\r\n\t\t\t\tINNER JOIN `registration` `r` ON `u`.`id`=`r`.`user_id`\r\n\t\t\t\tLEFT JOIN `competition` `c` ON `r`.`competition_id`=`c`.`id`\r\n\t\t\t\tLEFT JOIN `wca_{$wcaDb}`.`Results` `rs`\r\n\t\t\t\t\tON `c`.`wca_competition_id`=`rs`.`competitionId`\r\n\t\t\t\t\tAND `rs`.`personName`=CASE WHEN `u`.`name_zh`='' THEN `u`.`name` ELSE CONCAT(`u`.`name`, ' (', `u`.`name_zh`, ')') END\r\n\t\t\t\tSET `u`.`wcaid`=`rs`.`personId`\r\n\t\t\t\tWHERE `u`.`wcaid`='' and `r`.`competition_id`=%id%";
     $db = Yii::app()->db;
     $num = [];
     foreach ($competitions as $competition) {
         $num[$competition->id] = $db->createCommand(str_replace('%id%', $competition->id, $sql))->execute();
     }
     echo 'updated wcaid: ', array_sum($num), PHP_EOL;
     Yii::import('application.statistics.*');
     Yii::app()->cache->flush();
     $data = Statistics::getData(true);
     echo 'set results_statistics_data: ', $data ? 1 : 0, PHP_EOL;
 }
开发者ID:sunshy360,项目名称:cubingchina,代码行数:16,代码来源:WcaCommand.php


示例19: init

 public function init()
 {
     parent::init();
     //Log page views
     Statistics::collect();
     // If we've accessed the homepage as /home/, then we should redirect to /.
     if ($this->dataRecord && $this->dataRecord instanceof SiteTree && RootURLController::should_be_on_root($this->dataRecord) && !$this->urlParams['Action'] && !$_POST && !$_FILES && !Director::redirected_to()) {
         $getVars = $_GET;
         unset($getVars['url']);
         if ($getVars) {
             $url = "?" . http_build_query($getVars);
         } else {
             $url = "";
         }
         Director::redirect($url);
         return;
     }
     if ($this->dataRecord) {
         $this->dataRecord->extend('contentcontrollerInit', $this);
     } else {
         singleton('SiteTree')->extend('contentcontrollerInit', $this);
     }
     if (Director::redirected_to()) {
         return;
     }
     Director::set_site_mode('site');
     // Check page permissions
     if ($this->dataRecord && $this->URLSegment != 'Security' && !$this->dataRecord->can('View')) {
         Security::permissionFailure($this);
     }
     // Draft/Archive security check - only CMS users should be able to look at stage/archived content
     if ($this->URLSegment != 'Security' && (Versioned::current_archived_date() || Versioned::current_stage() && Versioned::current_stage() != 'Live')) {
         if (!Permission::check('CMS_ACCESS_CMSMain')) {
             $link = $this->Link();
             $message = _t("ContentController.DRAFT_SITE_ACCESS_RESTRICTION", "You must log in with your CMS password in order to view the draft or archived content.  <a href=\"%s\">Click here to go back to the published site.</a>");
             Security::permissionFailure($this, sprintf($message, "{$link}?stage=Live"));
             return;
         }
     }
 }
开发者ID:ramziammar,项目名称:websites,代码行数:40,代码来源:ContentController.php


示例20: view

 function view()
 {
     COMFilter::$_jump = false;
     $clientmac = $_COOKIE['CLIENTMAC'];
     if (!$clientmac) {
         $boxmac = new COMGetmac();
         // print 'getmac';
         $clientmac = 'M' . $boxmac->getmac();
         setcookie("CLIENTMAC", $clientmac);
     }
     // print $clientmac;
     $clientboxid = intval($_COOKIE['CLIENTBOXID']);
     if (!$clientboxid) {
         $clientbox = new Boxs();
         $one = $clientbox->getOne("mac=?", $clientmac);
         if ($one) {
             $clientboxid = $one->id;
             setcookie("CLIENTMAC", $clientmac);
         }
     }
     // print 'id:'.$clientboxid;
     //实例化模板
     $tp = PHP_Templates::factory();
     $LOGGEDUSER = $_COOKIE['LOGGEDUSER'];
     if ($LOGGEDUSER) {
         $tp->title = "后台";
         //设置模板文件
         $tp->setFiles('default_back');
     } else {
         $tp->title = "测试";
         //设置模板文件
         $tp->setFiles('default');
         //统计
         Statistics::hitscounter(intval($clientboxid), "login", "login");
     }
     //输出页面
     $tp->execute();
     //释放模板变量
     unset($tp, $dataFilter);
 }
开发者ID:infi000,项目名称:geek,代码行数:40,代码来源:module.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Stats类代码示例发布时间:2022-05-23
下一篇:
PHP StatementBuilder类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap