Show
Ignore:
Timestamp:
04/14/07 20:47:38 (2 years ago)
Author:
mikey
Message:

added remove(), removeConfig(), getKeys(), getConfigKeys()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/util/stubRegistry.php

    r358 r525  
    6060 
    6161    /** 
     62     * removes a value from the registry 
     63     * 
     64     * @param  string  $key  key where the value is stored under 
     65     */ 
     66    public function remove($key) 
     67    { 
     68        if (isset(self::$registry[$key]) == true) { 
     69            unset(self::$registry[$key]); 
     70        } 
     71    } 
     72 
     73    /** 
     74     * removes a value from the config 
     75     * 
     76     * @param  string  $key  key where the value is stored under 
     77     */ 
     78    public function removeConfig($key) 
     79    { 
     80        if (isset(self::$config[$key]) == true) { 
     81            unset(self::$config[$key]); 
     82        } 
     83    } 
     84 
     85    /** 
    6286     * check if a value exists under the given key 
    6387     * 
     
    116140        return $default; 
    117141    } 
     142 
     143    /** 
     144     * returns all registry values 
     145     * 
     146     * @return  array<string,mixed> 
     147     */ 
     148    public static function getKeys() 
     149    { 
     150        return array_keys(self::$registry); 
     151    } 
     152 
     153    /** 
     154     * returns all configuration values 
     155     * 
     156     * @return  array<string,mixed> 
     157     */ 
     158    public static function getConfigKeys() 
     159    { 
     160        return array_keys(self::$config); 
     161    } 
    118162} 
    119163?>