Changeset 199488 for sideposts/trunk/framework/lib/objects.php
- Timestamp:
- 01/29/2010 02:34:53 PM (16 years ago)
- File:
-
- 1 edited
-
sideposts/trunk/framework/lib/objects.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sideposts/trunk/framework/lib/objects.php
r196960 r199488 34 34 35 35 /** 36 * Creates and stores an object in the $_akv global. 37 * Can be called at the same time we create the object: ak_store_object( 'obj_name', new objectName() ); 38 * 39 * @param string $name Internal object name. 40 * @param object $object The object reference to store in the global. 41 * @return object The newly stored object reference. 42 */ 43 function & ak_create_object ( $name, $object ) 44 { 45 $GLOBALS['_akv'][$name] =& $object; 46 return $object; 47 } 48 49 /** 36 50 * Gets an object stored in the $_akv global. 37 51 * … … 46 60 return false; 47 61 } 48 }49 50 /**51 * Creates and stores an object in the $_akv global.52 * Can be called at the same time we create the object: ak_store_object( 'obj_name', new objectName() );53 *54 * @param string $name Internal object name.55 * @param object $object The object reference to store in the global.56 * @return object The newly stored object reference.57 */58 function & ak_create_object ( $name, $object )59 {60 $GLOBALS['_akv'][$name] =& $object;61 return $object;62 62 } 63 63 … … 86 86 function & ak_settings_object () 87 87 { 88 return ak_get_object('settings'); 88 if ( ak_object_exists('settings') ) { 89 return ak_get_object('settings'); 90 } else { 91 return ak_create_object('settings', new akSettings()); 92 } 89 93 } 90 94
Note: See TracChangeset
for help on using the changeset viewer.