Plugin Directory


Ignore:
Timestamp:
01/29/2010 02:34:53 PM (16 years ago)
Author:
Txanny
Message:

Released SidePosts 3.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sideposts/trunk/framework/lib/objects.php

    r196960 r199488  
    3434
    3535/**
     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 */
     43function & ak_create_object ( $name, $object )
     44{
     45    $GLOBALS['_akv'][$name] =& $object;
     46    return $object;
     47}
     48
     49/**
    3650 * Gets an object stored in the $_akv global.
    3751 *
     
    4660        return false;
    4761    }
    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;
    6262}
    6363
     
    8686function & ak_settings_object ()
    8787{
    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    }
    8993}
    9094
Note: See TracChangeset for help on using the changeset viewer.