Exemplo n.º 1
0
 function &_get($type, $environment = AK_ENVIRONMENT, $uncached = false, $set = null, $var_export = false)
 {
     $false = false;
     if (AkDbSchemaCache::doRefresh() && $set === null) return $false;
     $null = null;
     static $configs = array();
     if ($set !== null) {
         if (!isset($configs[$environment])) {
             $configs[$environment] = array();
         }
         if ($set === false) {
             unset($configs[$environment][$type]);
         } else {
             $configs[$environment][$type] = $set;
         }
         return $null;
     }
     
     if ($type === true) {
         return isset($configs[$environment]) ? $configs[$environment] : array();
     }
     if (!$uncached && isset($configs[$environment]) && isset($configs[$environment][$type])) {
         return $configs[$environment][$type];
     }
     if ($uncached || !($config = AkDbSchemaCache::_readCache($type, $environment, false, $var_export))) {
         return $false;
     }
     if (!isset($configs[$environment])) {
         $configs[$environment] = array($type=>$config);
     } else {
         $configs[$environment][$type] = $config;
     }
     return $configs[$environment][$type];
 }