From 45e6a9bdc5c06fd5d57401b8842c2d46265e0b9e Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 5 Feb 2015 15:10:59 -0700 Subject: [PATCH] HHVM support --- classes/popularity.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/classes/popularity.php b/classes/popularity.php index ab840317..996c8743 100644 --- a/classes/popularity.php +++ b/classes/popularity.php @@ -36,9 +36,9 @@ class Popularity public function __construct() { - $this->config = self::$grav['config']; + $this->config = self::getGrav()['config']; - $this->data_path = self::$grav['locator']->findResource('log://') . 'popularity'; + $this->data_path = self::getGrav()['locator']->findResource('log://') . 'popularity'; $this->daily_file = $this->data_path.'/'.self::DAILY_FILE; $this->monthly_file = $this->data_path.'/'.self::MONTHLY_FILE; $this->totals_file = $this->data_path.'/'.self::TOTALS_FILE; @@ -49,8 +49,8 @@ class Popularity public function trackHit() { /** @var Page $page */ - $page = self::$grav['page']; - $relative_url = str_replace(self::$grav['base_url_relative'], '', $page->url()); + $page = self::getGrav()['page']; + $relative_url = str_replace(self::getGrav()['base_url_relative'], '', $page->url()); // Don't track error pages or pages that have no route if ($page->template() == 'error' || !$page->route()) { @@ -74,7 +74,7 @@ class Popularity $this->updateDaily(); $this->updateMonthly(); $this->updateTotals($page->route()); - $this->updateVisitors(self::$grav['uri']->ip()); + $this->updateVisitors(self::getGrav()['uri']->ip()); }