From: Michael M Slusarz Date: Thu, 28 Jan 2010 18:21:37 +0000 (-0700) Subject: Remove unneded require; add _permsCache var X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e006114fdaff19a9bd94635b8d5875a403c906a0;p=horde.git Remove unneded require; add _permsCache var --- diff --git a/gollem/lib/Application.php b/gollem/lib/Application.php index be71518ad..de1574c80 100644 --- a/gollem/lib/Application.php +++ b/gollem/lib/Application.php @@ -43,6 +43,13 @@ class Gollem_Application extends Horde_Registry_Application public $version = 'H4 (2.0-git)'; /** + * Perms cache. + * + * @var array + */ + protected $_permsCache = array(); + + /** * Gollem initialization. * * Global variables defined: @@ -69,23 +76,22 @@ class Gollem_Application extends Horde_Registry_Application */ public function perms() { - static $perms = array(); - if (!empty($perms)) { - return $perms; + if (!empty($this->_permsCache)) { + return $this->_permsCache; } - require_once dirname(__FILE__) . '/base.load.php'; - require GOLLEM_BASE . '/config/backends.php'; - $perms['tree']['gollem']['backends'] = false; $perms['title']['gollem:backends'] = _("Backends"); // Run through every backend. - foreach ($backends as $backend => $curBackend) { - $perms['tree']['gollem']['backends'][$backend] = false; - $perms['title']['gollem:backends:' . $backend] = $curBackend['name']; + require GOLLEM_BASE . '/config/backends.php'; + foreach ($backends as $key => $val) { + $perms['tree']['gollem']['backends'][$key] = false; + $perms['title']['gollem:backends:' . $key] = $val['name']; } + $this->_permsCache = $perms; + return $perms; }