예제 #1
0
 public function _updateCacheFileAfterExecution($environment = null)
 {
     static $called = false, $_environment;
     if ($called == false && !AkDbSchemaCache::shouldRefresh()) {
         register_shutdown_function(array('AkDbSchemaCache', '_updateCacheFileAfterExecution'));
         $called = !empty($environment) ? $environment : AK_ENVIRONMENT;
     } elseif (empty($environment)) {
         $config = AkDbSchemaCache::_config(null, null, $called);
         $file_name = AkDbSchemaCache::getCacheFileName($called);
         /**
          * @todo On PHP5 var_export requires objects that implement the __set_state magic method.
          *       As see on stangelanda at arrowquick dot benchmarks at comhttp://php.net/var_export
          *       serialize works faster without opcode caches. We should do our benchmarks with
          *       var_export VS serialize using APC once we fix the __set_state magic on phpAdoDB
          */
         if (AK_LOG_EVENTS) {
             $Logger =& Ak::getLogger();
         }
         if (!AK_CLI) {
             if (AK_LOG_EVENTS) {
                 $Logger->message('Updating database settings on ' . $file_name);
             }
             Ak::file_put_contents($file_name, serialize($config));
         } else {
             if (AK_LOG_EVENTS) {
                 $Logger->message('Skipping writing of cache file: ' . $file_name);
             }
         }
     }
 }