Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2013-11-19 13:50:52 +0400
committermattab <matthieu.aubry@gmail.com>2013-11-19 13:50:52 +0400
commit426a49b1cc19d54b96a6abf41e5a7dbaa4ce83c0 (patch)
tree79d4897f7bb87f5d08584c49d3980ecb37dbd2f0 /core/Site.php
parent0878b9fce15d9c6a717cf476c4e047de39c35ab0 (diff)
Site::$infoSites should be private not public
Diffstat (limited to 'core/Site.php')
-rw-r--r--core/Site.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/core/Site.php b/core/Site.php
index bcbf0572ff..7c95cfcde5 100644
--- a/core/Site.php
+++ b/core/Site.php
@@ -41,7 +41,7 @@ class Site
/**
* @var array
*/
- public static $infoSites = array();
+ protected static $infoSites = array();
/**
* Constructor.
@@ -52,7 +52,8 @@ class Site
{
$this->id = (int)$idsite;
if (!isset(self::$infoSites[$this->id])) {
- self::$infoSites[$this->id] = API::getInstance()->getSiteFromId($this->id);
+ $site = API::getInstance()->getSiteFromId($this->id);
+ self::setSite($this->id, $site);
}
}
@@ -68,7 +69,9 @@ class Site
*/
public static function setSites($sites)
{
- self::$infoSites = $sites;
+ foreach($sites as $idsite => $site) {
+ self::setSite($idsite, $site);
+ }
}
/**
@@ -331,6 +334,16 @@ class Site
}
/**
+ * Returns all websites pre-cached
+ *
+ * @ignore
+ */
+ static public function getSites()
+ {
+ return self::$infoSites;
+ }
+
+ /**
* Returns the name of the site with the specified ID.
*
* @param int $idsite The site ID.