Index: autoload.php
===================================================================
--- autoload.php	(revision 21407)
+++ autoload.php	(working copy)
@@ -12,6 +12,45 @@
 // config.php can set the components path like:
 // ini_set( 'include_path', ini_get( 'include_path' ). ':../ezcomponents/trunk' );
 
+
+
+class eZRunTimeSettings
+{
+    // array of settings
+    static protected $_settings = array();
+    
+    // Disallow creating objects of this class
+    final protected function __construct(){}
+    final protected function __clone(){}
+    
+    // set a setting, namespace is optional
+    static public function set( $key, $value, $nameSpace = 'global' )
+    {
+        if ( !isset( self::$_settings[$nameSpace] ) )
+            self::$_settings[$nameSpace] = array();
+            
+        self::$_settings[$nameSpace][$key] = $value;
+    }
+    
+    /*
+     * returns null if not set, namespace is optional
+     */
+    static public function get( $key, $nameSpace = 'global' )
+    {
+        if ( isset( self::$_settings[$nameSpace] ) )
+        {
+            if ( isset( self::$_settings[$nameSpace][$key] ) )
+            {
+                return self::$_settings[$nameSpace][$key];
+            }
+        }
+        return null;
+    }
+}
+
+
+//eZRunTimeSettings::set( 'developmentMode', true, 'INI' );
+
 if ( file_exists( "config.php" ) )
 {
     require "config.php";
@@ -17,6 +56,7 @@
     require "config.php";
 }
 
+
 // require 'Base/src/base.php';
 $baseEnabled = @include( 'ezc/Base/base.php' );
 if ( !$baseEnabled )
@@ -29,7 +69,7 @@
 function __autoload( $className )
 {
     static $ezpClasses = null;
-    if ( is_null( $ezpClasses ) )
+    if ( $ezpClasses === null )
     {
         $ezpKernelClasses = require 'autoload/ezp_kernel.php';
         $ezpExtensionClasses = require 'autoload/ezp_extension.php';
Index: lib/ezutils/classes/ezini.php
===================================================================
--- lib/ezutils/classes/ezini.php	(revision 21407)
+++ lib/ezutils/classes/ezini.php	(working copy)
@@ -82,13 +82,11 @@
     /*!
       Initialization of object;
     */
-    function eZINI( $fileName, $rootDir = "", $useTextCodec = null, $useCache = null, $useLocalOverrides = null, $directAccess = false, $addArrayDefinition = false )
+    function eZINI( $fileName = 'site.ini', $rootDir = '', $useTextCodec = null, $useCache = null, $useLocalOverrides = null, $directAccess = false, $addArrayDefinition = false )
     {
-        $this->Charset = "utf8";
-        if ( $fileName == "" )
-            $fileName = "site.ini";
-        if ( $rootDir !== false && $rootDir == "" )
-            $rootDir = "settings";
+        $this->Charset = 'utf8';
+        if ( $rootDir === '' )
+            $rootDir = 'settings';
         if ( $useCache === null )
             $useCache = eZINI::isCacheEnabled();
         if ( eZINI::isNoCacheAdviced() )
@@ -106,6 +104,7 @@
         $this->DirectAccess = $directAccess;
         $this->UseLocalOverrides = $useLocalOverrides;
         $this->AddArrayDefinition = $addArrayDefinition;
+        $this->DevelopmentMode = eZRunTimeSettings::get( 'developmentMode', 'INI' );
 
         if ( $this->UseLocalOverrides == true )
         {
@@ -226,18 +225,18 @@
      \return true if the INI file \a $fileName exists in the root dir \a $rootDir.
      $fileName defaults to site.ini and rootDir to settings.
     */
-    static function exists( $fileName = "site.ini", $rootDir = "settings" )
+    static function exists( $fileName = 'site.ini', $rootDir = 'settings' )
     {
-        if ( $fileName == "" )
-            $fileName = "site.ini";
-        if ( $rootDir == "" )
-            $rootDir = "settings";
+        if ( $fileName == '' )
+            $fileName = 'site.ini';
+        if ( $rootDir == '' )
+            $rootDir = 'settings';
         if ( file_exists( $rootDir . '/' . $fileName ) )
             return true;
-        else if ( file_exists( $rootDir . '/' . $fileName . '.append' ) )
-            return true;
         else if ( file_exists( $rootDir . '/' . $fileName . '.append.php' ) )
             return true;
+        //else if ( file_exists( $rootDir . '/' . $fileName . '.append' ) )
+        //    return true;
         return false;
     }
 
@@ -290,7 +289,7 @@
 
         $inputFiles = array();
 
-        if ( $this->FileName == 'override.ini' )
+        if ( $this->FileName === 'override.ini' )
         {
             eZExtension::prependExtensionSiteAccesses( false, $this, true, false, false );
         }
@@ -299,16 +298,16 @@
             $inputFiles[] = $iniFile;
 
         // try the same file name with '.append.php' replace with '.append'
-        if ( preg_match('/^(.+.append).php$/i', $iniFile, $matches ) && file_exists( $matches[1] ) )
-            $inputFiles[] = $matches[1];
+        //if ( strpos($iniFile, '.append.php') !== false && preg_match('/^(.+.append).php$/i', $iniFile, $matches ) && file_exists( $matches[1] ) )
+            //$inputFiles[] = $matches[1];
 
-        if ( file_exists ( $iniFile . '.php' ) )
-            $inputFiles[] = $iniFile . '.php';
+        //if ( strpos($iniFile, '.php') === false && file_exists ( $iniFile . '.php' ) )
+            //$inputFiles[] = $iniFile . '.php';
 
         if ( $this->DirectAccess )
         {
-            if ( file_exists ( $iniFile . '.append' ) )
-                $inputFiles[] = $iniFile . '.append';
+            //if ( file_exists ( $iniFile . '.append' ) )
+                //$inputFiles[] = $iniFile . '.append';
 
             if ( file_exists ( $iniFile . '.append.php' ) )
                 $inputFiles[] = $iniFile . '.append.php';
@@ -316,6 +315,8 @@
         else
         {
             $overrideDirs = $this->overrideDirs();
+            $fileName = $this->FileName;
+            $rootDir = $this->RootDir;
             foreach ( $overrideDirs as $overrideDirItem )
             {
                 $overrideDir = $overrideDirItem[0];
@@ -321,26 +322,29 @@
                 $overrideDir = $overrideDirItem[0];
                 $isGlobal = $overrideDirItem[1];
                 if ( $isGlobal )
-                    $overrideFile = eZDir::path( array( $overrideDir, $this->FileName ) );
-                else
-                    $overrideFile = eZDir::path( array( $this->RootDir, $overrideDir, $this->FileName ) );
-                if ( file_exists( $overrideFile . '.php' ) )
+                    $overrideFile = eZDir::path( array( $overrideDir, $fileName ) );
+                 else
+                    $overrideFile = eZDir::path( array( $rootDir, $overrideDir, $fileName ) );
+
+                /*if ( file_exists( $overrideFile . '.php' ) )
                 {
                     $inputFiles[] = $overrideFile . '.php';
-                }
+                }*/
+
                 if ( file_exists( $overrideFile ) )
+                {
                     $inputFiles[] = $overrideFile;
+                }
 
-                if ( $isGlobal )
-                    $overrideFile = eZDir::path( array( $overrideDir, $this->FileName . '.append' ) );
-                else
-                    $overrideFile = eZDir::path( array( $this->RootDir, $overrideDir, $this->FileName . '.append' ) );
-                if ( file_exists( $overrideFile . '.php' ) )
+                if ( file_exists( $overrideFile . '.append.php' ) )
                 {
-                    $inputFiles[] = $overrideFile . '.php';
+                    $inputFiles[] = $overrideFile . '.append.php';
                 }
-                if ( file_exists( $overrideFile ) )
-                    $inputFiles[] = $overrideFile;
+
+                /*if ( file_exists( $overrideFile . '.append' ) )
+                {
+                    $inputFiles[] = $overrideFile . '.append';
+                }*/
             }
         }
     }
@@ -355,27 +359,13 @@
         eZDebug::accumulatorStart( 'ini', 'ini_load', 'Load cache' );
         if ( $reset )
             $this->reset();
-        $cachedDir = "var/cache/ini/";
+        $cachedDir = 'var/cache/ini/';
 
-        eZDebug::accumulatorStart( 'ini_find_files', 'ini_load', 'FindInputFiles' );
-        $this->findInputFiles( $inputFiles, $iniFile );
-        eZDebug::accumulatorStop( 'ini_find_files' );
-        if ( count( $inputFiles ) == 0 )
-        {
-            eZDebug::accumulatorStop( 'ini' );
-            return false;
-        }
+        $md5_input = $this->FileName . $this->RootDir;
 
-/*        if ( strstr( end( $inputFiles ), 'settings/override/' ) )
-        {
-            $overrideINIFile = array_pop( $inputFiles );
-        }*/
+        if ( isset( $GLOBALS['eZCurrentAccess'] ) )
+            $md5_input .= $GLOBALS['eZCurrentAccess']['name'];
 
-        $md5_input = '';
-        foreach ( $inputFiles as $inputFile )
-        {
-            $md5_input .= $inputFile. "\n";
-        }
         if ( $this->UseTextCodec )
         {
             //include_once( "lib/ezi18n/classes/eztextcodec.php" );
@@ -385,7 +375,7 @@
         {
             $md5_input .= '-placement';
         }
-        $fileName = md5( $md5_input ) . ".php";
+        $fileName = md5( $md5_input ) . '.php';
         $cachedFile = $cachedDir . $fileName;
         if ( $placement )
         {
@@ -396,16 +386,28 @@
             $this->CacheFile = $cachedFile;
         }
 
-        $inputTime = false;
-        // check for modifications
-        foreach ( $inputFiles as $inputFile )
+        if ( $this->DevelopmentMode )
         {
-            $fileTime = filemtime( $inputFile );
-            if ( $inputTime === false or
-                 $fileTime > $inputTime )
-                $inputTime = $fileTime;
+            eZDebug::accumulatorStart( 'ini_find_files', 'ini_load', 'FindInputFiles' );
+            $this->findInputFiles( $inputFiles, $iniFile );
+            eZDebug::accumulatorStop( 'ini_find_files' );
+            if ( count( $inputFiles ) === 0 )
+            {
+                eZDebug::accumulatorStop( 'ini' );
+                return false;
+            }
+            // check for modifications
+            $inputTime = false;
+            foreach ( $inputFiles as $inputFile )
+            {
+                $fileTime = filemtime( $inputFile );
+                if ( $inputTime === false or
+                     $fileTime > $inputTime )
+                    $inputTime = $fileTime;
+            }
         }
 
+
         $loadCache = false;
         $cacheTime = false;
         if ( file_exists( $cachedFile ) )
@@ -410,14 +412,17 @@
         $cacheTime = false;
         if ( file_exists( $cachedFile ) )
         {
-            $fileInfo = @stat( $cachedFile );
-            if ( $fileInfo )
+            $loadCache = true;
+            if ( $this->DevelopmentMode )
             {
-                $cacheTime = $fileInfo['mtime'];
-                $loadCache = true;
-                if ( $cacheTime < $inputTime )
+                $fileInfo = @stat( $cachedFile );
+                if ( $fileInfo )
                 {
-                    $loadCache = false;
+                    $cacheTime = $fileInfo['mtime'];
+                    if ( $cacheTime < $inputTime )
+                    {
+                        $loadCache = false;
+                    }
                 }
             }
         }
@@ -433,7 +438,7 @@
             include( $cachedFile );
             if ( !isset( $val ) or
                  !isset( $eZIniCacheCodeDate ) or
-                 $eZIniCacheCodeDate != eZINI::CACHE_CODE_DATE )
+                 $eZIniCacheCodeDate !== eZINI::CACHE_CODE_DATE )
             {
                 if ( eZINI::isDebugEnabled() )
                     eZDebug::writeNotice( "Old structure in cache file used, recreating '$cachedFile' to new structure", "eZINI" );
@@ -457,6 +462,18 @@
         }
         if ( !$useCache )
         {
+            if ( !isset( $inputFiles ) )
+            {
+                eZDebug::accumulatorStart( 'ini_find_files', 'ini_load', 'FindInputFiles' );
+                $this->findInputFiles( $inputFiles, $iniFile );
+                eZDebug::accumulatorStop( 'ini_find_files' );
+                if ( count( $inputFiles ) === 0 )
+                {
+                    eZDebug::accumulatorStop( 'ini' );
+                    return false;
+                }
+            }
+        
             eZDebug::accumulatorStart( 'ini_files_1', 'ini_load', 'Parse' );
             $this->parse( $inputFiles, $iniFile, false, $placement );
             eZDebug::accumulatorStop( 'ini_files_1' );
@@ -733,9 +750,8 @@
             $pathArray[] = 'override';
             $dirArray[] = 'override';
         }
-        if ( is_string( $useOverride ) and
-             $useOverride == "append" )
-            $fileName .= ".append";
+        if ( $useOverride === 'append' )
+            $fileName .= '.append';
         if ( $suffix !== false )
             $fileName .= $suffix;
 
@@ -1361,7 +1377,7 @@
       Direct access is for accessing the filename directly in the specified path. .append and .append.php is automaticly added to filename
       \note Use create() if you need to get a unique copy which you can alter.
     */
-    static function instance( $fileName = "site.ini", $rootDir = "settings", $useTextCodec = null, $useCache = null, $useLocalOverrides = null, $directAccess = false, $addArrayDefinition = false )
+    static function instance( $fileName = 'site.ini', $rootDir = 'settings', $useTextCodec = null, $useCache = null, $useLocalOverrides = null, $directAccess = false, $addArrayDefinition = false )
     {
         $globalsKey = "eZINIGlobalInstance-$rootDir-$fileName-$useLocalOverrides";
         $globalsIsLoadedKey = "eZINIGlobalIsLoaded-$rootDir-$fileName-$useLocalOverrides";
@@ -1471,6 +1487,8 @@
 
     /// If \c true eZINI will check each setting (before saving) for correspondence of settings in site.ini[eZINISetting].ReadonlySettingList
     public $ReadOnlySettingsCheck = true;
+    
+    protected $DevelopmentMode = false;
 
 }
 
