From 866ee5bd10bebcc69b939926e0f6c11d942acd01 Mon Sep 17 00:00:00 2001 From: Benaka Moorthi <benaka.moorthi@gmail.com> Date: Sun, 7 Jul 2013 00:13:03 -0400 Subject: [PATCH] Fix build & remove Piwik::createAccessObject function. --- core/FrontController.php | 2 +- core/Piwik.php | 13 ------------- plugins/Installation/Controller.php | 2 +- tests/PHPUnit/IntegrationTestCase.php | 7 +++---- 4 files changed, 5 insertions(+), 19 deletions(-) diff --git a/core/FrontController.php b/core/FrontController.php index 74348d0568..6fb08f158d 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -199,7 +199,7 @@ class Piwik_FrontController protected function createAccessObject() { - Piwik::createAccessObject(); + Piwik_Access::getInstance(); } /** diff --git a/core/Piwik.php b/core/Piwik.php index a64999891a..84ba32449c 100644 --- a/core/Piwik.php +++ b/core/Piwik.php @@ -2007,19 +2007,6 @@ class Piwik } } - /* - * Global access object - */ - - /** - * Create access object - */ - static public function createAccessObject() - { - Piwik_Access::getInstance(); - //Zend_Registry::set('access', new Piwik_Access()); - } - /* * User input validation */ diff --git a/plugins/Installation/Controller.php b/plugins/Installation/Controller.php index ba556775bc..443baaaa12 100644 --- a/plugins/Installation/Controller.php +++ b/plugins/Installation/Controller.php @@ -262,7 +262,7 @@ class Piwik_Installation_Controller extends Piwik_Controller_Admin $baseTablesInstalled = count($tablesInstalled) - count($archiveTables); $minimumCountPiwikTables = 17; - Piwik::createAccessObject(); + Piwik_Access::getInstance(); Piwik::setUserIsSuperUser(); if ($baseTablesInstalled >= $minimumCountPiwikTables && count(Piwik_SitesManager_API::getInstance()->getAllSitesId()) > 0 && diff --git a/tests/PHPUnit/IntegrationTestCase.php b/tests/PHPUnit/IntegrationTestCase.php index 6772f84820..58f75dd5be 100755 --- a/tests/PHPUnit/IntegrationTestCase.php +++ b/tests/PHPUnit/IntegrationTestCase.php @@ -150,8 +150,9 @@ abstract class IntegrationTestCase extends PHPUnit_Framework_TestCase include "DataFiles/Currencies.php"; include "DataFiles/LanguageToCountry.php"; include "DataFiles/Providers.php"; - - Piwik::createAccessObject(); + + Piwik_Access::setSingletonInstance(null); + Piwik_Access::getInstance(); Piwik_PostEvent('FrontController.initAuthenticationObject'); // We need to be SU to create websites for tests @@ -225,8 +226,6 @@ abstract class IntegrationTestCase extends PHPUnit_Framework_TestCase $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'en'; $this->changeLanguage('en'); - - Piwik::$cachedKnownSegmentsToArchive = null; } protected static $apiToCall = array(); -- GitLab