From 9fc391d83bad2e00b3a72c48e70d169362a5f54f Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Sat, 10 Apr 2010 19:27:52 -0600 Subject: [PATCH] Do app pushing entirely within Registry. This reverts commit 2b647b8ef7bb3be67b3b63616b9988de697744f6. --- framework/Core/lib/Horde/Registry.php | 7 +++++++ horde/lib/Api.php | 14 ++------------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index 26634e3e4..6efa5b72b 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -1235,6 +1235,9 @@ class Horde_Registry { if (is_null($app)) { $app = $this->getApp(); + $pushed = false; + } else { + $pushed = $this->pushApp($app); } /* If there is no logged in user, return an empty Horde_Prefs:: @@ -1249,6 +1252,10 @@ class Horde_Registry $GLOBALS['prefs']->retrieve($app); } } + + if ($pushed) { + $this->popApp(); + } } /** diff --git a/horde/lib/Api.php b/horde/lib/Api.php index 0204a417c..7e3ab5df6 100644 --- a/horde/lib/Api.php +++ b/horde/lib/Api.php @@ -155,14 +155,8 @@ class Horde_Api extends Horde_Registry_Api */ public function getPreference($app, $pref) { - $pushed = $GLOBALS['registry']->pushApp($app); $GLOBALS['registry']->loadPrefs($app); - $value = $GLOBALS['prefs']->getValue($pref); - if ($pushed) { - $GLOBALS['registry']->popApp(); - } - - return $value; + return $GLOBALS['prefs']->getValue($pref); } /** @@ -175,12 +169,8 @@ class Horde_Api extends Horde_Registry_Api */ public function setPreference($app, $pref, $value) { - $pushed = $GLOBALS['registry']->pushApp($app); $GLOBALS['registry']->loadPrefs($app); - $value = $GLOBALS['prefs']->setValue($pref, $value); - if ($pushed) { - $GLOBALS['registry']->popApp(); - } + return $GLOBALS['prefs']->setValue($pref, $value); } /** -- 2.11.0