Changeset 153 for trunk/lib/Prefs.inc.php
- Timestamp:
- Jun 7, 2006 8:41:19 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Prefs.inc.php
r152 r153 14 14 // Load preferences for the user's session. 15 15 require_once 'codebase/lib/Prefs.inc.php'; 16 $prefs = & Prefs::getInstance('my-namespace');16 $prefs = new Prefs('my-namespace'); 17 17 $prefs->setParam(array( 18 18 'persistent' => $auth->isLoggedIn(), … … 74 74 $this->setParam(array('create_table' => $app->getParam('db_create_tables'))); 75 75 } 76 }77 78 /**79 * This method enforces the singleton pattern for this class.80 *81 * @return object Reference to the global Prefs object.82 * @access public83 * @static84 */85 function &getInstance($namespace='')86 {87 static $instances = array();88 89 if (!array_key_exists($namespace, $instances)) {90 $instances[$namespace] = new Prefs($namespace);91 }92 93 return $instances[$namespace];94 76 } 95 77
Note: See TracChangeset
for help on using the changeset viewer.