cvs: pear /LiveUser_Admin/Perm Simple.php
| From: | Lukas Smith | Date: | Sun, 20 Feb 2005 22:55:17 +0000 |
| Subject: | cvs: pear /LiveUser_Admin/Perm Simple.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-29577@lists.php.net to get a copy of this message | ||
lsmith Sun Feb 20 17:55:17 2005 EDT
Modified files:
/pear/LiveUser_Admin/Perm Simple.php
Log:
- added error stack calls that were missing
- updated constructor/init() API to be inline with the client factory methods
http://cvs.php.net/diff.php/pear/LiveUser_Admin/Perm/Simple.php?r1=1.49&r2=1.50&ty=u
Index: pear/LiveUser_Admin/Perm/Simple.php
diff -u pear/LiveUser_Admin/Perm/Simple.php:1.49 pear/LiveUser_Admin/Perm/Simple.php:1.50
--- pear/LiveUser_Admin/Perm/Simple.php:1.49 Sun Feb 20 09:50:03 2005
+++ pear/LiveUser_Admin/Perm/Simple.php Sun Feb 20 17:55:17 2005
@@ -57,7 +57,7 @@
* @author Bjoern Kraus <krausbn@php.net>
* @copyright 2002-2005 Markus Wolff
* @license http://www.gnu.org/licenses/lgpl.txt
- * @version CVS: $Id: Simple.php,v 1.49 2005/02/20 14:50:03 dufuz Exp $
+ * @version CVS: $Id: Simple.php,v 1.50 2005/02/20 22:55:17 lsmith Exp $
* @link http://pear.php.net/LiveUser_Admin
*/
@@ -109,39 +109,39 @@
/**
* Class constructor. Feel free to override in backend subclasses.
*/
- function LiveUser_Admin_Perm_Simple(&$confArray)
+ function LiveUser_Admin_Perm_Simple()
{
$this->_stack = &PEAR_ErrorStack::singleton('LiveUser_Admin');
- if (is_array($confArray)) {
- foreach ($confArray as $key => $value) {
- if (isset($this->$key)) {
- if (empty($this->$key) || !is_array($this->$key)) {
- $this->$key =& $confArray[$key];
- } else {
- $this->$key = array_merge($this->$key, $value);
- }
- }
- }
- }
}
/**
* Load the storage container
*
- *
+ * @access public
* @param mixed Name of array containing the configuration.
* @return boolean true on success or false on failure
- *
- * @access public
*/
function init(&$conf)
{
if (!isset($conf['storage'])) {
+ $this->_stack->push(LIVEUSER_ADMIN_ERROR, 'exception',
+ array('msg' => 'Missing storage configuration array'));
return false;
}
+ if (is_array($conf)) {
+ $keys = array_keys($conf);
+ foreach ($keys as $key) {
+ if (isset($this->$key)) {
+ $this->$key =& $conf[$key];
+ }
+ }
+ }
+
$this->_storage = LiveUser::storageFactory($conf['storage'],
'LiveUser_Admin_');
if ($this->_storage === false) {
+ $this->_stack->push(LIVEUSER_ADMIN_ERROR, 'exception',
+ array('msg' => 'Could not instanciate storage container'));
return false;
}