Index: access.php
===================================================================
--- access.php	(revision 20548)
+++ access.php	(working copy)
@@ -60,7 +60,7 @@
                      'type' => EZ_ACCESS_TYPE_DEFAULT );
 
 
-    if ( $order == 'none' )
+    if ( $order === 'none' )
         return $access;
 
     $order = $ini->variableArray( 'SiteAccessSettings', 'MatchOrder' );
@@ -101,7 +101,7 @@
                 $type = EZ_ACCESS_TYPE_URI;
                 $match_type = $ini->variable( 'SiteAccessSettings', 'URIMatchType' );
 
-                if ( $match_type == 'map' )
+                if ( $match_type === 'map' )
                 {
                     if ( $ini->hasVariable( 'SiteAccessSettings', 'URIMatchMapItems' ) )
                     {
@@ -127,7 +127,7 @@
                         }
                     }
                 }
-                else if ( $match_type == 'element' )
+                else if ( $match_type === 'element' )
                 {
                     $match_index = $ini->variable( 'SiteAccessSettings', 'URIMatchElement' );
                     $elements = $uri->elements( false );
@@ -134,7 +134,7 @@
                     $elements = array_slice( $elements, 0, $match_index );
                     $name = implode( '_', $elements );
                 }
-                else if ( $match_type == 'text' )
+                else if ( $match_type === 'text' )
                 {
                     $match_item = $uri->elements();
                     $matcher_pre = $ini->variable( 'SiteAccessSettings', 'URIMatchSubtextPre' );
@@ -140,7 +140,7 @@
                     $matcher_pre = $ini->variable( 'SiteAccessSettings', 'URIMatchSubtextPre' );
                     $matcher_post = $ini->variable( 'SiteAccessSettings', 'URIMatchSubtextPost' );
                 }
-                else if ( $match_type == 'regexp' )
+                else if ( $match_type === 'regexp' )
                 {
                     $match_item = $uri->elements();
                     $matcher = $ini->variable( 'SiteAccessSettings', 'URIMatchRegexp' );
@@ -154,7 +154,7 @@
                 $type = EZ_ACCESS_TYPE_HTTP_HOST;
                 $match_type = $ini->variable( 'SiteAccessSettings', 'HostMatchType' );
                 $match_item = $host;
-                if ( $match_type == 'map' )
+                if ( $match_type === 'map' )
                 {
                     if ( $ini->hasVariable( 'SiteAccessSettings', 'HostMatchMapItems' ) )
                     {
@@ -172,7 +172,7 @@
                         }
                     }
                 }
-                else if ( $match_type == 'element' )
+                else if ( $match_type === 'element' )
                 {
                     $match_index = $ini->variable( 'SiteAccessSettings', 'HostMatchElement' );
                     $match_arr = explode( '.', $match_item );
@@ -178,7 +178,7 @@
                     $match_arr = explode( '.', $match_item );
                     $name = $match_arr[$match_index];
                 }
-                else if ( $match_type == 'text' )
+                else if ( $match_type === 'text' )
                 {
                     $matcher_pre = $ini->variable( 'SiteAccessSettings', 'HostMatchSubtextPre' );
                     $matcher_post = $ini->variable( 'SiteAccessSettings', 'HostMatchSubtextPost' );
@@ -183,7 +183,7 @@
                     $matcher_pre = $ini->variable( 'SiteAccessSettings', 'HostMatchSubtextPre' );
                     $matcher_post = $ini->variable( 'SiteAccessSettings', 'HostMatchSubtextPost' );
                 }
-                else if ( $match_type == 'regexp' )
+                else if ( $match_type === 'regexp' )
                 {
                     $matcher = $ini->variable( 'SiteAccessSettings', 'HostMatchRegexp' );
                     $match_num = $ini->variable( 'SiteAccessSettings', 'HostMatchRegexpItem' );
@@ -196,7 +196,7 @@
                 $type = EZ_ACCESS_TYPE_INDEX_FILE;
                 $match_type = $ini->variable( 'SiteAccessSettings', 'IndexMatchType' );
                 $match_item = $file;
-                if ( $match_type == 'element' )
+                if ( $match_type === 'element' )
                 {
                     $match_index = $ini->variable( 'SiteAccessSettings', 'IndexMatchElement' );
                     $match_pos = strpos( $match_item, '.php' );
@@ -207,7 +207,7 @@
                         $name = $match_arr[$match_index];
                     }
                 }
-                else if ( $match_type == 'text' )
+                else if ( $match_type === 'text' )
                 {
                     $matcher_pre = $ini->variable( 'SiteAccessSettings', 'IndexMatchSubtextPre' );
                     $matcher_post = $ini->variable( 'SiteAccessSettings', 'IndexMatchSubtextPost' );
@@ -212,7 +212,7 @@
                     $matcher_pre = $ini->variable( 'SiteAccessSettings', 'IndexMatchSubtextPre' );
                     $matcher_post = $ini->variable( 'SiteAccessSettings', 'IndexMatchSubtextPost' );
                 }
-                else if ( $match_type == 'regexp' )
+                else if ( $match_type === 'regexp' )
                 {
                     $matcher = $ini->variable( 'SiteAccessSettings', 'IndexMatchRegexp' );
                     $match_num = $ini->variable( 'SiteAccessSettings', 'IndexMatchRegexpItem' );
@@ -226,12 +226,12 @@
             } break;
         }
 
-        if ( $match_type == 'regexp' )
+        if ( $match_type === 'regexp' )
             $name = accessMatchRegexp( $match_item, $matcher, $match_num );
-        else if ( $match_type == 'text' )
+        else if ( $match_type === 'text' )
             $name = accessMatchText( $match_item, $matcher_pre, $matcher_post );
 
-        if ( ( isset( $name ) && $name != '' ) || $type == EZ_ACCESS_TYPE_URI )
+        if ( ( isset( $name ) && $name != '' ) || $type === EZ_ACCESS_TYPE_URI )
         {
             $name = preg_replace( array( '/[^a-zA-Z0-9]+/',
                                          '/_+/',
@@ -245,9 +245,9 @@
 
             if ( in_array( $name, $siteAccessList ) )
             {
-                if ( $type == EZ_ACCESS_TYPE_URI )
+                if ( $type === EZ_ACCESS_TYPE_URI )
                 {
-                    if ( $match_type == 'element' )
+                    if ( $match_type === 'element' )
                     {
                         $uri->increase( $match_index );
                         $uri->dropBase();
@@ -252,11 +252,11 @@
                         $uri->increase( $match_index );
                         $uri->dropBase();
                     }
-                    else if ( $match_type == 'regexp' )
+                    else if ( $match_type === 'regexp' )
                     {
                         $uri->setURIString( $match_item );
                     }
-                    else if ( $match_type == 'text' )
+                    else if ( $match_type === 'text' )
                     {
                         $uri->setURIString( $match_item );
                     }
@@ -265,7 +265,7 @@
                 $access['name'] = $name;
                 return $access;
             }
-            else if ( $type == EZ_ACCESS_TYPE_URI )
+            else if ( $type === EZ_ACCESS_TYPE_URI )
             {
                 $access['type'] = $type;
                 return $access;
@@ -290,7 +290,7 @@
 
     $name = $access['name'];
     if ( isset( $access['type'] ) &&
-         $access['type'] == EZ_ACCESS_TYPE_URI )
+         $access['type'] === EZ_ACCESS_TYPE_URI )
     {
         //include_once( 'lib/ezutils/classes/ezsys.php' );
         eZSys::addAccessPath( $name );
@@ -296,9 +296,9 @@
         eZSys::addAccessPath( $name );
     }
 
-    if ( file_exists( "settings/siteaccess/$name" ) )
+    if ( file_exists( 'settings/siteaccess/'.$name ) )
     {
-        $ini->prependOverrideDir( "siteaccess/$name", false, 'siteaccess' );
+        $ini->prependOverrideDir( 'siteaccess/'.$name, false, 'siteaccess' );
     }
 
     /* Make sure extension siteaccesses are prepended */
@@ -378,7 +378,7 @@
         {
             case 'access':
             {
-                $currentAccess = ( $value == 'enable' );
+                $currentAccess = ( $value === 'enable' );
             } break;
             case 'moduleall':
             {
@@ -433,11 +433,11 @@
         {
             case 'access':
             {
-                $tmp_allow = ($value == 'enable');
+                $tmp_allow = ($value === 'enable');
             } break;
             case 'precheckall':
             {
-                if ( $value == 'true' )
+                if ( $value === 'true' )
                 {
                     foreach( $prechecks as $key => $value )
                     {
@@ -463,7 +463,7 @@
 function accessDebugEnabled()
 {
     $ini = eZINI::instance();
-    return $ini->variable( 'SiteAccessSettings', 'DebugAccess' ) == 'enabled';
+    return $ini->variable( 'SiteAccessSettings', 'DebugAccess' ) === 'enabled';
 }
 
 function accessExtraDebugEnabled()
@@ -469,7 +469,7 @@
 function accessExtraDebugEnabled()
 {
     $ini = eZINI::instance();
-    return $ini->variable( 'SiteAccessSettings', 'DebugExtraAccess' ) == 'enabled';
+    return $ini->variable( 'SiteAccessSettings', 'DebugExtraAccess' ) === 'enabled';
 }
 
 ?>
Index: autoload.php
===================================================================
--- autoload.php	(revision 20548)
+++ autoload.php	(working copy)
@@ -12,9 +12,9 @@
 // config.php can set the components path like: 
 // ini_set( 'include_path', ini_get( 'include_path' ). ':../ezcomponents/trunk' );
 
-if ( file_exists( "config.php" ) )
+if ( file_exists( 'config.php' ) )
 {
-    require "config.php";
+    require 'config.php';
 }
 
 // require 'Base/src/base.php';
Index: index.php
===================================================================
--- index.php	(revision 20548)
+++ index.php	(working copy)
@@ -24,9 +24,9 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-if ( version_compare( phpversion(), '5.1' ) < 0 )
+if ( version_compare( PHP_VERSION, '5.1' ) < 0 )
 {
-    print( "<h1>Unsupported PHP version " . phpversion() . "</h1>" );
+    print( "<h1>Unsupported PHP version " . PHP_VERSION . "</h1>" );
     print( "<p>eZ Publish 4.x does not run with PHP 4.</p>".
            "<p>For more information about supported software please visit ".
            "<a href=\"http://ez.no/download/ez_publish\" >eZ Publish download page</a></p>" );
@@ -49,7 +49,7 @@
         case 'K':
             $memLimit *= 1024;
     }
-    if ( $memLimit != -1 && $memLimit < 44040192) /* 42*1024*1024 */
+    if ( $memLimit !== -1 && $memLimit < 44040192) /* 42*1024*1024 */
     {
         @ini_set( 'memory_limit', '42M' );
     }
@@ -100,7 +100,7 @@
 error_reporting ( E_ALL | E_STRICT );
 
 // include standard libs
-require_once( "lib/ezutils/classes/ezdebug.php" );
+require_once( 'lib/ezutils/classes/ezdebug.php' );
 ////include_once( "lib/ezutils/classes/ezini.php" );
 ////include_once( "lib/ezutils/classes/ezdebugsetting.php" );
 
@@ -157,7 +157,7 @@
 $ini = eZINI::instance();
 
 // Set correct site timezone
-$timezone = $ini->variable( "TimeZoneSettings", "TimeZone");
+$timezone = $ini->variable( 'TimeZoneSettings', 'TimeZone');
 if ( $timezone )
 {
     putenv( "TZ=$timezone" );
@@ -243,16 +243,16 @@
 {
     $ini = eZINI::instance();
 
-    if ( $ini->variable( 'DebugSettings', 'DebugOutput' ) != 'enabled' )
+    if ( $ini->variable( 'DebugSettings', 'DebugOutput' ) !== 'enabled' )
         return null;
 
-    $type = $ini->variable( "DebugSettings", "Debug" );
+    $type = $ini->variable( 'DebugSettings', 'Debug' );
     //eZDebug::setHandleType( eZDebug::HANDLE_NONE );
-    if ( $type == "inline" or $type == "popup" )
+    if ( $type === 'inline' or $type === 'popup' )
     {
         $as_html = true;
 
-        if ( $ini->variable( "DebugSettings", "DebugToolbar" ) == 'enabled' && $as_html == true && !$GLOBALS['eZRedirection'] )
+        if ( $ini->variable( 'DebugSettings', 'DebugToolbar' ) === 'enabled' && $as_html === true && !$GLOBALS['eZRedirection'] )
         {
             require_once( 'kernel/common/template.php' );
             $tpl = templateInit();
@@ -263,7 +263,7 @@
         ////include_once( 'kernel/common/eztemplatesstatisticsreporter.php' );
         eZDebug::appendBottomReport( 'Template Usage Statistics', eZTemplatesStatisticsReporter::generateStatistics( $as_html ) );
 
-        return eZDebug::printReport( $type == "popup", $as_html, true );
+        return eZDebug::printReport( $type === 'popup', $as_html, true );
     }
     return null;
 }
@@ -298,8 +298,8 @@
 function fetchModule( $uri, $check, &$module, &$module_name, &$function_name, &$params )
 {
     $module_name = $uri->element();
-    if ( $check !== null and isset( $check["module"] ) )
-        $module_name = $check["module"];
+    if ( $check !== null and isset( $check['module'] ) )
+        $module_name = $check['module'];
 
     // Try to fetch the module object
     $module = eZModule::exists( $module_name );
@@ -309,7 +309,7 @@
     }
 
     $uri->increase();
-    $function_name = "";
+    $function_name = '';
     if ( !$module->singleFunction() )
     {
         $function_name = $uri->element();
@@ -316,8 +316,8 @@
         $uri->increase();
     }
     // Override it if required
-    if ( $check !== null and isset( $check["function"] ) )
-        $function_name = $check["function"];
+    if ( $check !== null and isset( $check['function'] ) )
+        $function_name = $check['function'];
 
     $params = $uri->elements( false );
     return true;
@@ -326,8 +326,8 @@
 ////include_once( 'lib/ezi18n/classes/eztextcodec.php' );
 $httpCharset = eZTextCodec::httpCharset();
 ////include_once( 'lib/ezlocale/classes/ezlocale.php' );
-$ini = eZINI::instance();
-if ( $ini->variable( 'RegionalSettings', 'Debug' ) == 'enabled' )
+//$ini = eZINI::instance();
+if ( $ini->variable( 'RegionalSettings', 'Debug' ) === 'enabled' )
     eZLocale::setIsDebugEnabled( true );
 
 ////include_once( "lib/ezutils/classes/ezsys.php" );
@@ -339,9 +339,9 @@
 
 // Initialize basic settings, such as vhless dirs and separators
 
-eZSys::init( 'index.php', $ini->variable( 'SiteAccessSettings', 'ForceVirtualHost' ) == 'true' );
+eZSys::init( 'index.php', $ini->variable( 'SiteAccessSettings', 'ForceVirtualHost' ) === 'true' );
 
-eZDebug::addTimingPoint( "Script start" );
+eZDebug::addTimingPoint( 'Script start' );
 
 ////include_once( "lib/ezutils/classes/ezuri.php" );
 
@@ -347,11 +347,11 @@
 
 $uri = eZURI::instance( eZSys::requestURI() );
 $GLOBALS['eZRequestedURI'] = $uri;
-require_once "pre_check.php";
+require_once 'pre_check.php';
 
 // Shall we start the eZ setup module?
-//if ( $ini->variable( "SiteAccessSettings", "CheckValidity" ) == "true" )
-//    //include_once( "lib/ezsetup/classes/ezsetup.php" );
+//if ( $ini->variable( 'SiteAccessSettings', 'CheckValidity' ) === 'true' )
+//    //include_once( 'lib/ezsetup/classes/ezsetup.php' );
 
 require_once 'kernel/error/errors.php';
 
@@ -364,7 +364,7 @@
 
 // include ezsession override implementation
 //Needs to be added no class definition
-require_once( "lib/ezutils/classes/ezsession.php" );
+require_once( 'lib/ezutils/classes/ezsession.php' );
 
 
 // Check for extension
@@ -373,7 +373,7 @@
 eZExtension::activateExtensions( 'default' );
 // Extension check end
 
-require_once "access.php";
+require_once 'access.php';
 
 $access = accessType( $uri,
                       eZSys::hostname(),
@@ -397,7 +397,7 @@
 // Check if this should be run in a cronjob
 // Need to be runned before eZHTTPTool::instance() because of eZSessionStart() which
 // is called from eZHandlePreChecks() below.
-$useCronjob = $ini->variable( 'Session', 'BasketCleanup' ) == 'cronjob';
+$useCronjob = $ini->variable( 'Session', 'BasketCleanup' ) === 'cronjob';
 if ( !$useCronjob )
 {
     // Functions for session to make sure baskets are cleaned up
@@ -470,7 +470,7 @@
                      'Pragma' => 'no-cache',
                      'X-Powered-By' => 'eZ Publish',
                      'Content-Type' => 'text/html; charset=' . $httpCharset,
-                     'Served-by' => $_SERVER["SERVER_NAME"],
+                     'Served-by' => $_SERVER['SERVER_NAME'],
                      'Content-language' => $languageCode );
 
 $site = array( 'title' => $ini->variable( 'SiteSettings', 'SiteName' ),
@@ -531,7 +531,7 @@
 
     // Check for URL translation
     if ( $urlTranslatorAllowed and
-         $ini->variable( 'URLTranslator', 'Translation' ) == 'enabled' and
+         $ini->variable( 'URLTranslator', 'Translation' ) === 'enabled' and
          !$uri->isEmpty() )
     {
         ////include_once( 'kernel/classes/ezurlaliasml.php' );
@@ -552,7 +552,7 @@
 
     if ( $uri->isEmpty() )
     {
-        $tmp_uri = new eZURI( $ini->variable( "SiteSettings", "IndexPage" ) );
+        $tmp_uri = new eZURI( $ini->variable( 'SiteSettings', 'IndexPage' ) );
         $moduleCheck = accessAllowed( $tmp_uri );
     }
     else
@@ -562,9 +562,9 @@
 
     if ( !$moduleCheck['result'] )
     {
-        if ( $ini->variable( "SiteSettings", "ErrorHandler" ) == "defaultpage" )
+        if ( $ini->variable( 'SiteSettings', 'ErrorHandler' ) === 'defaultpage' )
         {
-            $defaultPage = $ini->variable( "SiteSettings", "DefaultPage" );
+            $defaultPage = $ini->variable( 'SiteSettings', 'DefaultPage' );
             $uri->setURIString( $defaultPage );
             $moduleCheck['result'] = true;
         }
@@ -583,9 +583,9 @@
     }
     else if ( !fetchModule( $uri, $check, $module, $module_name, $function_name, $params ) )
     {
-        if ( $ini->variable( "SiteSettings", "ErrorHandler" ) == "defaultpage" )
+        if ( $ini->variable( 'SiteSettings', 'ErrorHandler' ) === 'defaultpage' )
         {
-            $tmp_uri = new eZURI( $ini->variable( "SiteSettings", "DefaultPage" ) );
+            $tmp_uri = new eZURI( $ini->variable( 'SiteSettings', 'DefaultPage' ) );
             if ( !fetchModule( $tmp_uri, $check, $module, $module_name, $function_name, $params ) )
                 $displayMissingModule = true;
         }
@@ -620,7 +620,7 @@
             $siteAccessResult = $currentUser->hasAccessTo( 'user', 'login' );
 
             $hasAccessToSite = false;
-            if ( $siteAccessResult[ 'accessWord' ] == 'limited' )
+            if ( $siteAccessResult[ 'accessWord' ] === 'limited' )
             {
                 $policyChecked = false;
                 foreach ( array_keys( $siteAccessResult['policies'] ) as $key )
@@ -643,12 +643,12 @@
                 if ( !$policyChecked )
                     $hasAccessToSite = true;
             }
-            else if ( $siteAccessResult[ 'accessWord' ] == 'yes' )
+            else if ( $siteAccessResult[ 'accessWord' ] === 'yes' )
             {
-                eZDebugSetting::writeDebug( 'kernel-siteaccess', "access is yes" );
+                eZDebugSetting::writeDebug( 'kernel-siteaccess', 'access is yes' );
                 $hasAccessToSite = true;
             }
-            else if ( $siteAccessResult['accessWord'] == 'no' )
+            else if ( $siteAccessResult['accessWord'] === 'no' )
             {
                 $accessList = $siteAccessResult['accessList'];
             }
@@ -666,7 +666,7 @@
             {
                 eZDebugSetting::writeDebug( 'kernel-siteaccess', $access, 'not able to get access to siteaccess' );
                 $moduleAccessAllowed = false;
-                $requireUserLogin = ( $ini->variable( "SiteAccessSettings", "RequireUserLogin" ) == "true" );
+                $requireUserLogin = ( $ini->variable( 'SiteAccessSettings', 'RequireUserLogin' ) === 'true' );
                 if ( $requireUserLogin )
                 {
                     $module = eZModule::exists( 'user' );
@@ -685,7 +685,7 @@
 
         if ( $runModuleView )
         {
-            if ( $objectHasMovedError == true )
+            if ( $objectHasMovedError === true )
             {
                 $moduleResult = $module->handleError( eZError::KERNEL_MOVED, 'kernel', array( 'new_location' => $objectHasMovedURI ) );
             }
@@ -731,7 +731,7 @@
     else if ( $moduleCheck['result'] )
     {
         eZDebug::writeError( "Undefined module: $module_name", "index" );
-        $module = new eZModule( "", "", $module_name );
+        $module = new eZModule( '', '', $module_name );
         $GLOBALS['eZRequestedModule'] = $module;
         $moduleResult = $module->handleError( eZError::KERNEL_MODULE_NOT_FOUND, 'kernel', array( 'module' => $module_name ) );
     }
@@ -740,7 +740,7 @@
         if ( $moduleCheck['view_checked'] )
             eZDebug::writeError( "View '" . $moduleCheck['view'] . "' in module '" . $moduleCheck['module'] . "' is disabled", "index" );
         else
-            eZDebug::writeError( "Module '" . $moduleCheck['module'] . "' is disabled", "index" );
+            eZDebug::writeError( "Module '" . $moduleCheck['module'] . "' is disabled", 'index' );
         $module = new eZModule( "", "", $moduleCheck['module'] );
         $GLOBALS['eZRequestedModule'] = $module;
         $moduleResult = $module->handleError( eZError::KERNEL_MODULE_DISABLED, 'kernel', array( 'check' => $moduleCheck ) );
@@ -759,13 +759,13 @@
 
     if ( is_array( $moduleResult ) )
     {
-        if ( isset( $moduleResult["pagelayout"] ) )
+        if ( isset( $moduleResult['pagelayout'] ) )
         {
-            $show_page_layout = $moduleResult["pagelayout"];
-            $GLOBALS['eZCustomPageLayout'] = $moduleResult["pagelayout"];
+            $show_page_layout = $moduleResult['pagelayout'];
+            $GLOBALS['eZCustomPageLayout'] = $moduleResult['pagelayout'];
         }
-        if ( isset( $moduleResult["external_css"] ) )
-            $use_external_css = $moduleResult["external_css"];
+        if ( isset( $moduleResult['external_css'] ) )
+            $use_external_css = $moduleResult['external_css'];
     }
 }
 
@@ -772,20 +772,20 @@
 if ( $module->exitStatus() == eZModule::STATUS_REDIRECT )
 {
     $GLOBALS['eZRedirection'] = true;
-    $ini = eZINI::instance();
+    //$ini = eZINI::instance();
     $uri = eZURI::instance( eZSys::requestURI() );
 
     list( $redirUri, $debugByIP, $debugIPList ) =
-        $ini->variableMulti( "DebugSettings", array( 'DebugRedirection', 'DebugByIP', 'DebugIPList' ) );
+        $ini->variableMulti( 'DebugSettings', array( 'DebugRedirection', 'DebugByIP', 'DebugIPList' ) );
     $automatic_redir = true;
 
-    if ( $redirUri == "enabled" )
+    if ( $redirUri === 'enabled' )
     {
         $automatic_redir = false;
     }
-    else if ( $redirUri != "disabled" )
+    else if ( $redirUri !== 'disabled' )
     {
-        $redirUris = $ini->variableArray( "DebugSettings", "DebugRedirection" );
+        $redirUris = $ini->variableArray( 'DebugSettings', 'DebugRedirection' );
         $uri->toBeginning();
         foreach ( $redirUris as $redirUri )
         {
@@ -799,7 +799,7 @@
     }
 
     $debugEnabled = false;
-    if ( $debugByIP == 'enabled' )
+    if ( $debugByIP === 'enabled' )
     {
         $ipAddress = eZSys::serverVariable( 'REMOTE_ADDR', true );
         if ( $ipAddress )
@@ -831,11 +831,11 @@
         {
             $debugEnabled = (
                 in_array( 'commandline', $debugIPList ) &&
-                ( php_sapi_name() == 'cli' )
+                ( php_sapi_name() === 'cli' )
             );
         }
     }
-    if ( !$debugEnabled && $redirUri == 'disabled' )
+    if ( !$debugEnabled && $redirUri === 'disabled' )
     {
         $automatic_redir = true;
     }
@@ -845,7 +845,7 @@
     $moduleRedirectUri = $module->redirectURI();
     $redirectStatus = $module->redirectStatus();
     $translatedModuleRedirectUri = $moduleRedirectUri;
-    if ( $ini->variable( 'URLTranslator', 'Translation' ) == 'enabled' )
+    if ( $ini->variable( 'URLTranslator', 'Translation' ) === 'enabled' )
     {
         ////include_once( 'kernel/classes/ezurlaliasml.php' );
         if ( eZURLAliasML::translate( $translatedModuleRedirectUri, true ) )
@@ -852,7 +852,7 @@
         {
             $moduleRedirectUri = $translatedModuleRedirectUri;
             if ( strlen( $moduleRedirectUri ) > 0 and
-                 $moduleRedirectUri[0] != '/' )
+                 $moduleRedirectUri[0] !== '/' )
                 $moduleRedirectUri = '/' . $moduleRedirectUri;
         }
     }
@@ -866,10 +866,10 @@
         $leftSlash = false;
         $rightSlash = false;
         if ( strlen( $redirectURI ) > 0 and
-             $redirectURI[strlen( $redirectURI ) - 1] == '/' )
+             $redirectURI[strlen( $redirectURI ) - 1] === '/' )
             $leftSlash = true;
         if ( strlen( $moduleRedirectUri ) > 0 and
-             $moduleRedirectUri[0] == '/' )
+             $moduleRedirectUri[0] === '/' )
             $rightSlash = true;
 
         if ( !$leftSlash and !$rightSlash ) // Both are without a slash, so add one
@@ -891,7 +891,7 @@
     else
     {
         // Make sure any errors or warnings are reported
-        if ( $ini->variable( 'DebugSettings', 'DisplayDebugWarnings' ) == 'enabled' )
+        if ( $ini->variable( 'DebugSettings', 'DisplayDebugWarnings' ) === 'enabled' )
         {
             if ( isset( $GLOBALS['eZDebugError'] ) and
                  $GLOBALS['eZDebugError'] )
@@ -913,9 +913,9 @@
                                             'text' => ezi18n( 'index.php', 'Some general warnings occured, see debug for more information.' ) ) );
             }
         }
-        require_once( "kernel/common/template.php" );
+        require_once( 'kernel/common/template.php' );
         $tpl = templateInit();
-        if ( count( $warningList ) == 0 )
+        if ( count( $warningList ) === 0 )
             $warningList = false;
         $tpl->setVariable( 'site', $site );
         $tpl->setVariable( 'warning_list', $warningList );
@@ -936,7 +936,7 @@
      $module->exitStatus() == eZModule::STATUS_OK )
 {
     $currentURI = $completeRequestedURI;
-    if ( strlen( $currentURI ) > 0 and $currentURI[0] != '/' )
+    if ( strlen( $currentURI ) > 0 and $currentURI[0] !== '/' )
         $currentURI = '/' . $currentURI;
 
     $lastAccessedURI = "";
@@ -945,13 +945,13 @@
     $http = eZHTTPTool::instance();
 
     // Fetched stored session variables
-    if ( $http->hasSessionVariable( "LastAccessesURI" ) )
+    if ( $http->hasSessionVariable( 'LastAccessesURI' ) )
     {
-        $lastAccessedViewURI = $http->sessionVariable( "LastAccessesURI" );
+        $lastAccessedViewURI = $http->sessionVariable( 'LastAccessesURI' );
     }
-    if ( $http->hasSessionVariable( "LastAccessedModifyingURI" ) )
+    if ( $http->hasSessionVariable( 'LastAccessedModifyingURI' ) )
     {
-        $lastAccessedURI = $http->sessionVariable( "LastAccessedModifyingURI" );
+        $lastAccessedURI = $http->sessionVariable( 'LastAccessedModifyingURI' );
     }
 
     // Update last accessed view page
@@ -958,7 +958,7 @@
     if ( $currentURI != $lastAccessedViewURI and
          !in_array( $module->uiContextName(), array( 'edit', 'administration', 'browse', 'authentication' ) ) )
     {
-        $http->setSessionVariable( "LastAccessesURI", $currentURI );
+        $http->setSessionVariable( 'LastAccessesURI', $currentURI );
     }
 
     // Update last accessed non-view page
@@ -964,7 +964,7 @@
     // Update last accessed non-view page
     if ( $currentURI != $lastAccessedURI )
     {
-        $http->setSessionVariable( "LastAccessedModifyingURI", $currentURI );
+        $http->setSessionVariable( 'LastAccessedModifyingURI', $currentURI );
     }
 }
 
@@ -988,7 +988,7 @@
 eZDebug::setUseExternalCSS( $use_external_css );
 if ( $show_page_layout )
 {
-    require_once( "kernel/common/template.php" );
+    require_once( 'kernel/common/template.php' );
     $tpl = templateInit();
     if ( $tpl->hasVariable( 'node' ) )
         $tpl->unsetVariable( 'node' );
@@ -997,7 +997,7 @@
         $moduleResult['path'] = false;
     $moduleResult['uri'] = eZSys::requestURI();
 
-    $tpl->setVariable( "module_result", $moduleResult );
+    $tpl->setVariable( 'module_result', $moduleResult );
 
     $meta = $ini->variable( 'SiteSettings', 'MetaDataArray' );
 
@@ -1003,7 +1003,7 @@
 
     if ( !isset( $meta['description'] ) )
     {
-        $metaDescription = "";
+        $metaDescription = '';
         if ( isset( $moduleResult['path'] ) and
              is_array( $moduleResult['path'] ) )
         {
@@ -1010,7 +1010,7 @@
             foreach ( $moduleResult['path'] as $pathPart )
             {
                 if ( isset( $pathPart['text'] ) )
-                    $metaDescription .= $pathPart['text'] . " ";
+                    $metaDescription .= $pathPart['text'] . ' ';
             }
         }
         $meta['description'] = $metaDescription;
@@ -1023,7 +1023,7 @@
     $site['version'] = eZPublishSDK::version();
     $site['page_title'] = $module->title();
 
-    $tpl->setVariable( "site", $site );
+    $tpl->setVariable( 'site', $site );
 
     ////include_once( 'lib/version.php' );
     $ezinfo = array( 'version' => eZPublishSDK::version( true ),
@@ -1030,7 +1030,7 @@
                      'version_alias' => eZPublishSDK::version( true, true ),
                      'revision' => eZPublishSDK::revision() );
 
-    $tpl->setVariable( "ezinfo", $ezinfo );
+    $tpl->setVariable( 'ezinfo', $ezinfo );
     if ( isset( $tpl_vars ) and is_array( $tpl_vars ) )
     {
         foreach( $tpl_vars as $tpl_var_name => $tpl_var_value )
@@ -1041,7 +1041,7 @@
 
     if ( $show_page_layout )
     {
-        if ( $ini->variable( 'DebugSettings', 'DisplayDebugWarnings' ) == 'enabled' )
+        if ( $ini->variable( 'DebugSettings', 'DisplayDebugWarnings' ) === 'enabled' )
         {
             // Make sure any errors or warnings are reported
             if ( isset( $GLOBALS['eZDebugError'] ) and
@@ -1071,13 +1071,13 @@
             // if( //include_once( "kernel/classes/datatypes/ezuser/ezuser.php" ) )
             $currentUser = eZUser::currentUser();
 
-            $tpl->setVariable( "current_user", $currentUser );
-            $tpl->setVariable( "anonymous_user_id", $ini->variable( 'UserSettings', 'AnonymousUserID' ) );
+            $tpl->setVariable( 'current_user', $currentUser );
+            $tpl->setVariable( 'anonymous_user_id', $ini->variable( 'UserSettings', 'AnonymousUserID' ) );
         }
         else
         {
-            $tpl->setVariable( "current_user", false );
-            $tpl->setVariable( "anonymous_user_id", false );
+            $tpl->setVariable( 'current_user', false );
+            $tpl->setVariable( 'anonymous_user_id', false );
         }
 
 //         ////include_once( "lib/ezutils/classes/ezexecutionstack.php" );
@@ -1084,18 +1084,18 @@
 //         $execStack = eZExecutionStack::instance();
 //         $tpl->setVariable( "execution_entries", $execStack->entries() );
 
-        $tpl->setVariable( "access_type", $access );
+        $tpl->setVariable( 'access_type', $access );
 
-        if ( count( $warningList ) == 0 )
+        if ( count( $warningList ) === 0 )
             $warningList = false;
         $tpl->setVariable( 'warning_list', $warningList );
 
-        $resource = "design:";
+        $resource = 'design:';
         if ( is_string( $show_page_layout ) )
         {
-            if ( strpos( $show_page_layout, ":" ) !== false )
+            if ( strpos( $show_page_layout, ':' ) !== false )
             {
-                $resource = "";
+                $resource = '';
             }
         }
         else
@@ -1100,7 +1100,7 @@
         }
         else
         {
-            $show_page_layout = "pagelayout.tpl";
+            $show_page_layout = 'pagelayout.tpl';
         }
 
         // Set the navigation part
@@ -1138,7 +1138,7 @@
 }
 
 
-eZDebug::addTimingPoint( "End" );
+eZDebug::addTimingPoint( 'End' );
 
 $out = ob_get_clean();
 echo trim( $out );
Index: index_treemenu.php
===================================================================
--- index_treemenu.php	(revision 20548)
+++ index_treemenu.php	(working copy)
@@ -29,7 +29,7 @@
 if ( isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) )
 {
     header( $_SERVER['SERVER_PROTOCOL'] . ' 304 Not Modified' );
-    header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + MAX_AGE ) . ' GMT' );
+    header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', $_SERVER['REQUEST_TIME'] + MAX_AGE ) . ' GMT' );
     header( 'Cache-Control: max-age=' . MAX_AGE );
     header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s', strtotime( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) . ' GMT' );
     exit();
Index: kernel/common/ezmoduleoperator.php
===================================================================
--- kernel/common/ezmoduleoperator.php	(revision 20548)
+++ kernel/common/ezmoduleoperator.php	(working copy)
@@ -37,7 +37,7 @@
   \brief The class eZModuleOperator does
 
 */
-require_once( 'kernel/common/i18n.php' );
+//require_once( 'kernel/common/i18n.php' );
 
 class eZModuleOperator
 {
Index: kernel/common/ezoverride.php
===================================================================
--- kernel/common/ezoverride.php	(revision 20548)
+++ kernel/common/ezoverride.php	(working copy)
@@ -44,9 +44,9 @@
         $match = null;
         foreach ( $matches as $templateMatch )
         {
-            $templatePath = $templateMatch["file"];
-            $templateType = $templateMatch["type"];
-            if ( $templateType == "normal" )
+            $templatePath = $templateMatch['file'];
+            $templateType = $templateMatch['type'];
+            if ( $templateType === 'normal' )
             {
                 if ( file_exists( $templatePath ) )
                 {
@@ -54,7 +54,7 @@
                     break;
                 }
             }
-            else if ( $templateType == "override" )
+            else if ( $templateType === 'override' )
             {
                 $foundOverrideFile = false;
                 if ( file_exists( $templatePath ) )
@@ -60,11 +60,11 @@
                 if ( file_exists( $templatePath ) )
                 {
                     $match = $templateMatch;
-                    $match["file"] = $templatePath;
+                    $match['file'] = $templatePath;
                     $foundOverrideFile = true;
                 }
                 if ( !$foundOverrideFile and
-                     count( $matchKeys ) == 0 )
+                     count( $matchKeys ) === 0 )
                     continue;
                 if ( !$foundOverrideFile and
                      preg_match( $regexpMatch, $templatePath, $regs ) )// Check for dir/filebase_keyname_keyid.tpl, eg. content/view_section_1.tpl
@@ -71,11 +71,11 @@
                 {
                     foreach ( $matchKeys as $matchKeyName => $matchKeyValue )
                     {
-                        $file = $regs[1] . "/" . $regs[2] . "_$matchKeyName" . "_$matchKeyValue" . $regs[3];
+                        $file = $regs[1] . '/' . $regs[2] . "_$matchKeyName" . "_$matchKeyValue" . $regs[3];
                         if ( file_exists( $file ) )
                         {
                             $match = $templateMatch;
-                            $match["file"] = $file;
+                            $match['file'] = $file;
                             $foundOverrideFile = true;
                             $matchedKeys[$matchKeyName] = $matchKeyValue;
                             break;
Index: kernel/common/template.php
===================================================================
--- kernel/common/template.php	(revision 20548)
+++ kernel/common/template.php	(working copy)
@@ -46,7 +46,7 @@
 
     //include_once( 'lib/ezutils/classes/ezini.php' );
     $ini = eZINI::instance();
-    if ( $ini->variable( 'TemplateSettings', 'Debug' ) == 'enabled' )
+    if ( $ini->variable( 'TemplateSettings', 'Debug' ) === 'enabled' )
         eZTemplate::setIsDebugEnabled( true );
 
     $compatAutoLoadPath = $ini->variableArray( 'TemplateSettings', 'AutoloadPath' );
Index: lib/ezdb/classes/ezdb.php
===================================================================
--- lib/ezdb/classes/ezdb.php	(revision 20548)
+++ lib/ezdb/classes/ezdb.php	(working copy)
@@ -108,6 +108,7 @@
 
 class eZDB
 {
+    protected static $dbInstance = null;
     /*!
       Constructor.
       NOTE: Should not be used.
@@ -119,11 +120,11 @@
 
     /*!
       \static
-      Returns an instance of the database object.
+      Returns true if we have a instance of the database object.
     */
     static function hasInstance()
     {
-        return isset( $GLOBALS['eZDBGlobalInstance'] ) && $GLOBALS['eZDBGlobalInstance'] instanceof eZDBInterface;
+        return ( self::$dbInstance !== null );
     }
 
     /*!
@@ -132,7 +133,7 @@
     */
     static function setInstance( $instance )
     {
-        $GLOBALS['eZDBGlobalInstance'] = $instance;
+        self::$dbInstance = $instance;
     }
 
     /*!
@@ -142,16 +143,14 @@
     */
     static function instance( $databaseImplementation = false, $databaseParameters = false, $forceNewInstance = false )
     {
-        $impl =& $GLOBALS['eZDBGlobalInstance'];
-
         $fetchInstance = false;
-        if ( !( $impl instanceof eZDBInterface ) )
+        if ( $forceNewInstance  )
+        {
+            self::$dbInstance = null;
             $fetchInstance = true;
-
-        if ( $forceNewInstance  )
+        }
+        else if ( self::$dbInstance === null )
         {
-            unset($impl);
-            $impl = false;
             $fetchInstance = true;
         }
 
@@ -175,7 +174,7 @@
             if ( $useDefaults )
             {
                 $socket = $ini->variable( 'DatabaseSettings', 'Socket' );
-                if ( trim( $socket != "" ) and $socket != "disabled" )
+                if ( trim( $socket != '' ) and $socket !== 'disabled' )
                 {
                     $socketPath = $socket;
                 }
@@ -187,7 +186,7 @@
             $slaveServerPassword = null;
             $slaveServerDatabase = null;
             $useSlave = $ini->variable( 'DatabaseSettings', 'UseSlaveServer' );
-            if ( $useSlave == "enabled" )
+            if ( $useSlave === 'enabled' )
             {
                 $slaveServers = $ini->variable( 'DatabaseSettings', 'SlaveServerArray' );
                 $slaveServerUsers = $ini->variable( 'DatabaseSettings', 'SlaverServerUser' );
@@ -220,11 +219,10 @@
             $extraPluginPathArray = $ini->variableArray( 'DatabaseSettings', 'DatabasePluginPath' );
             $pluginPathArray = array_merge( array( 'lib/ezdb/classes/' ),
                                             $extraPluginPathArray );
-            $impl = null;
+            self::$dbInstance = null;
 
-            $useSlaveServer = false;
-            if ( $useSlave == "enabled" )
-                $useSlaveServer = true;
+            $useSlaveServer = ( $useSlave === 'enabled' );
+
             $defaultDatabaseParameters = array( 'server' => $server,
                                                 'user' => $user,
                                                 'password' => $pwd,
@@ -306,16 +304,16 @@
                 {
                     include_once( $dbFile );
                     $className = $databaseImplementation . 'db';
-                    $impl = new $className( $databaseParameters );
+                    self::$dbInstance = new $className( $databaseParameters );
                     break;
                 }
             }
-            if ( $impl === null )
+            if ( self::$dbInstance === null )
             {
                 //include_once( 'lib/ezdb/classes/eznulldb.php' );
-                $impl = new eZNullDB( $databaseParameters );
-                $impl->ErrorMessage = "No database handler was found for '$databaseImplementation'";
-                $impl->ErrorNumber = -1;
+                self::$dbInstance = new eZNullDB( $databaseParameters );
+                self::$dbInstance->ErrorMessage = "No database handler was found for '$databaseImplementation'";
+                self::$dbInstance->ErrorNumber = -1;
                 if ( $databaseParameters['show_errors'] )
                 {
                     eZDebug::writeError( 'Database implementation not supported: ' . $databaseImplementation, 'eZDB::instance' );
@@ -323,7 +321,7 @@
             }
 
         }
-        return $impl;
+        return self::$dbInstance;
     }
 
     /*!
Index: lib/ezutils/classes/ezdebugsetting.php
===================================================================
--- lib/ezutils/classes/ezdebugsetting.php	(revision 20548)
+++ lib/ezutils/classes/ezdebugsetting.php	(working copy)
@@ -67,10 +67,11 @@
 
 class eZDebugSetting
 {
+    private static $iniInstance = null;
     /*!
      Constructor
     */
-    function eZDebugSetting()
+    private function eZDebugSetting()
     {
     }
 
@@ -80,13 +81,11 @@
     */
     static function isConditionTrue( $conditionName, $messageType )
     {
-        global $eZDebugSettingINIObject;
+        $ini = self::$iniInstance;
 
-        $ini = $eZDebugSettingINIObject;
-
-        if ( isset( $eZDebugSettingINIObject ) and $ini instanceof eZINI )
+        if ( $ini instanceof eZINI )
         {
-            if ( $ini->variable( 'DebugSettings', 'ConditionDebug' ) != 'enabled' )
+            if ( $ini->variable( 'DebugSettings', 'ConditionDebug' ) !== 'enabled' )
                 return false;
             $generalSetting = 'GeneralCondition';
             $debug = eZDebug::instance();
@@ -93,9 +92,9 @@
             $debugName = $debug->messageName( $messageType );
             $specificSetting = $debugName . 'Condition';
             if ( $ini->hasVariable( $generalSetting, $conditionName ) )
-                return $ini->variable( $generalSetting, $conditionName ) == 'enabled';
+                return $ini->variable( $generalSetting, $conditionName ) === 'enabled';
             if ( $ini->hasVariable( $specificSetting, $conditionName ) )
-                return $ini->variable( $specificSetting, $conditionName ) == 'enabled';
+                return $ini->variable( $specificSetting, $conditionName ) === 'enabled';
         }
         return false;
     }
@@ -106,7 +105,7 @@
     */
     static function changeLabel( $conditionName, $label )
     {
-        if ( $label == "" )
+        if ( $label == '' )
             return '<' . $conditionName . '>';
         else
             return $label . ' <' . $conditionName . '>';
@@ -173,8 +172,7 @@
     */
     static function setDebugINI( $ini )
     {
-        global $eZDebugSettingINIObject;
-        $eZDebugSettingINIObject = $ini;
+        self::$iniInstance = $ini;
     }
 
 }
Index: lib/ezutils/classes/ezextension.php
===================================================================
--- lib/ezutils/classes/ezextension.php	(revision 20548)
+++ lib/ezutils/classes/ezextension.php	(working copy)
@@ -41,6 +41,7 @@
 
 class eZExtension
 {
+    protected static $globalActiveExtensions = null;
     /*!
      Constructor
     */
@@ -75,18 +76,18 @@
         $ini = eZINI::instance();
         $activeExtensions = array();
         if ( !$extensionType or
-             $extensionType == 'default' )
+             $extensionType === 'default' )
             $activeExtensions = array_merge( $activeExtensions,
                                              $ini->variable( 'ExtensionSettings', 'ActiveExtensions' ) );
         if ( !$extensionType or
-             $extensionType == 'access' )
+             $extensionType === 'access' )
             $activeExtensions = array_merge( $activeExtensions,
                                              $ini->variable( 'ExtensionSettings', 'ActiveAccessExtensions' ) );
-        $globalActiveExtensions =& $GLOBALS['eZActiveExtensions'];
-        if ( isset( $globalActiveExtensions ) )
+        //$globalActiveExtensions =& $GLOBALS['eZActiveExtensions'];
+        if ( self::$globalActiveExtensions !== null )
         {
             $activeExtensions = array_merge( $activeExtensions,
-                                             $globalActiveExtensions );
+                                             self::$globalActiveExtensions );
         }
         $activeExtensions = array_unique( $activeExtensions );
         return $activeExtensions;
Index: lib/ezutils/classes/ezini.php
===================================================================
--- lib/ezutils/classes/ezini.php	(revision 20548)
+++ lib/ezutils/classes/ezini.php	(working copy)
@@ -77,7 +77,10 @@
 class eZINI
 {
     const CACHE_CODE_DATE = 1043407542;
-    const DEBUG_INTERNALS = false;
+    private static $cacheEnabled = true;
+    private static $instanceList = array();
+    private static $textCodecEnabled = true;
+    private static $debugInternalsEnabled = false;
 
     /*!
       Initialization of object;
@@ -82,15 +85,13 @@
     /*!
       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 !== false && $rootDir == '' )
+            $rootDir = 'settings';
         if ( $useCache === null )
-            $useCache = eZINI::isCacheEnabled();
+            $useCache = self::$cacheEnabled;
         if ( eZINI::isNoCacheAdviced() )
         {
             $useCache = false;
@@ -96,7 +97,7 @@
             $useCache = false;
         }
         if ( $useTextCodec === null )
-            $useTextCodec = eZINI::isTextCodecEnabled();
+            $useTextCodec = self::$textCodecEnabled;
 
         $this->UseTextCodec = $useTextCodec;
         $this->Codec = null;
@@ -109,7 +110,7 @@
 
         if ( $this->UseLocalOverrides == true )
         {
-            $this->LocalOverrideDirArray = $GLOBALS["eZINIOverrideDirList"];
+            $this->LocalOverrideDirArray = $GLOBALS['eZINIOverrideDirList'];
         }
 
         $this->load();
@@ -130,9 +131,7 @@
     */
     static function isCacheEnabled()
     {
-        if ( !isset( $GLOBALS['eZINICacheEnabled'] ) )
-             $GLOBALS['eZINICacheEnabled'] = true;
-         return $GLOBALS['eZINICacheEnabled'];
+         return self::$cacheEnabled;
     }
 
     /*!
@@ -139,7 +138,7 @@
      \return true if cache is not adviced to be used.
      \note The no-cache-adviced flag might not be modified in time for site.ini and some other important files to be affected.
     */
-    function isNoCacheAdviced()
+    static function isNoCacheAdviced()
     {
         if ( !isset( $GLOBALS['eZSiteBasics'] ) )
             return false;
@@ -156,7 +155,7 @@
     */
     static function setIsCacheEnabled( $cache )
     {
-        $GLOBALS['eZINICacheEnabled'] = $cache;
+        self::$cacheEnabled = $cache;
     }
 
     /*!
@@ -167,9 +166,7 @@
     */
     static function isDebugEnabled()
     {
-        if ( !isset( $GLOBALS['eZINIDebugInternalsEnabled'] ) )
-             $GLOBALS['eZINIDebugInternalsEnabled'] = eZINI::DEBUG_INTERNALS;
-        return $GLOBALS['eZINIDebugInternalsEnabled'];
+        return self::$debugInternalsEnabled;
     }
 
     /*!
@@ -178,7 +175,7 @@
     */
     static function setIsDebugEnabled( $debug )
     {
-        $GLOBALS['eZINIDebugInternalsEnabled'] = $debug;
+        self::$debugInternalsEnabled = $debug;
     }
 
     /*!
@@ -189,9 +186,7 @@
     */
     static function isTextCodecEnabled()
     {
-        if ( !isset( $GLOBALS['eZINITextCodecEnabled'] ) )
-             $GLOBALS['eZINITextCodecEnabled'] = true;
-        return $GLOBALS['eZINITextCodecEnabled'];
+        return self::$textCodecEnabled;
     }
 
     /*!
@@ -200,7 +195,7 @@
     */
     static function setIsTextCodecEnabled( $codec )
     {
-        $GLOBALS['eZINITextCodecEnabled'] = $codec;
+        self::$textCodecEnabled = $codec;
     }
 
     /*!
@@ -226,12 +221,12 @@
      \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' ) )
@@ -290,7 +285,7 @@
 
         $inputFiles = array();
 
-        if ( $this->FileName == 'override.ini' )
+        if ( $this->FileName === 'override.ini' )
         {
             eZExtension::prependExtensionSiteAccesses( false, $this, true, false, false );
         }
@@ -299,10 +294,10 @@
             $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] ) )
+        if ( strpos($iniFile, '.append.php') && preg_match('/^(.+.append).php$/i', $iniFile, $matches ) && file_exists( $matches[1] ) )
             $inputFiles[] = $matches[1];
 
-        if ( file_exists ( $iniFile . '.php' ) )
+        if ( !strpos($iniFile, '.php') && file_exists ( $iniFile . '.php' ) )
             $inputFiles[] = $iniFile . '.php';
 
         if ( $this->DirectAccess )
@@ -316,6 +311,8 @@
         else
         {
             $overrideDirs = $this->overrideDirs();
+            $fileName = $this->FileName;
+            $rootDir = $this->RootDir;
             foreach ( $overrideDirs as $overrideDirItem )
             {
                 $overrideDir = $overrideDirItem[0];
@@ -320,10 +317,12 @@
             {
                 $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 ) );
+                    $overrideFile = eZDir::path( array( $overrideDir, $fileName ) );
+                 else
+                    $overrideFile = eZDir::path( array( $rootDir, $overrideDir, $fileName ) );
+
                 if ( file_exists( $overrideFile . '.php' ) )
                 {
                     $inputFiles[] = $overrideFile . '.php';
@@ -328,19 +327,21 @@
                 {
                     $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 . '.append.php';
+                }
+
+                if ( file_exists( $overrideFile . '.append' ) )
                 {
-                    $inputFiles[] = $overrideFile . '.php';
+                    $inputFiles[] = $overrideFile . '.append';
                 }
-                if ( file_exists( $overrideFile ) )
-                    $inputFiles[] = $overrideFile;
             }
         }
     }
@@ -354,8 +355,9 @@
     {
         eZDebug::accumulatorStart( 'ini', 'ini_load', 'Load cache' );
         if ( $reset )
-            $this->reset();
-        $cachedDir = "var/cache/ini/";
+            $this->reset();           
+                
+        $cachedDir = 'var/cache/ini/';
 
         eZDebug::accumulatorStart( 'ini_find_files', 'ini_load', 'FindInputFiles' );
         $this->findInputFiles( $inputFiles, $iniFile );
@@ -360,7 +362,7 @@
         eZDebug::accumulatorStart( 'ini_find_files', 'ini_load', 'FindInputFiles' );
         $this->findInputFiles( $inputFiles, $iniFile );
         eZDebug::accumulatorStop( 'ini_find_files' );
-        if ( count( $inputFiles ) == 0 )
+        if ( count( $inputFiles ) === 0 )
         {
             eZDebug::accumulatorStop( 'ini' );
             return false;
@@ -385,7 +387,7 @@
         {
             $md5_input .= '-placement';
         }
-        $fileName = md5( $md5_input ) . ".php";
+        $fileName = md5( $md5_input ) . '.php';
         $cachedFile = $cachedDir . $fileName;
         if ( $placement )
         {
@@ -426,7 +428,7 @@
         if ( $loadCache )
         {
             $useCache = true;
-            if ( eZINI::isDebugEnabled() )
+            if ( self::$debugInternalsEnabled )
                 eZDebug::writeNotice( "Loading cache '$cachedFile' for file '" . $this->FileName . "'", "eZINI" );
             $charset = null;
             $blockValues = array();
@@ -433,9 +435,9 @@
             include( $cachedFile );
             if ( !isset( $val ) or
                  !isset( $eZIniCacheCodeDate ) or
-                 $eZIniCacheCodeDate != eZINI::CACHE_CODE_DATE )
+                 $eZIniCacheCodeDate !== eZINI::CACHE_CODE_DATE )
             {
-                if ( eZINI::isDebugEnabled() )
+            if ( self::$debugInternalsEnabled )
                     eZDebug::writeNotice( "Old structure in cache file used, recreating '$cachedFile' to new structure", "eZINI" );
                 $this->reset();
                 $useCache = false;
@@ -511,7 +513,7 @@
         //include_once( 'lib/ezfile/classes/ezfile.php' );
         eZFile::rename( $tmpCacheFile, $cachedFile );
 
-        if ( eZINI::isDebugEnabled() )
+        if ( self::$debugInternalsEnabled )
             eZDebug::writeNotice( "Wrote cache file '$cachedFile'", "eZINI" );
 
         return true;
@@ -545,7 +547,7 @@
      */
     function parseFile( $file, $placement = false )
     {
-        if ( eZINI::isDebugEnabled() )
+        if ( self::$debugInternalsEnabled )
             eZDebug::writeNotice( "Parsing file '$file'", 'eZINI' );
 
         //include_once( "lib/ezfile/classes/ezfile.php" );
@@ -552,7 +554,7 @@
         $contents = eZFile::getContents( $file );
         if ( $contents === false )
         {
-            eZDebug::writeError( "Failed opening file '$file' for reading", "eZINI" );
+            eZDebug::writeError( "Failed opening file '$file' for reading", 'eZINI' );
             return false;
         }
 
@@ -560,7 +562,7 @@
         $endOfLine = strpos( $contents, "\n" );
         $line = substr( $contents, 0, $endOfLine );
 
-        $currentBlock = "";
+        $currentBlock = '';
         if ( $line )
         {
             // check for charset
@@ -566,16 +568,16 @@
             // check for charset
             if ( preg_match( "/#\?ini(.+)\?/", $line, $ini_arr ) )
             {
-                $args = explode( " ", trim( $ini_arr[1] ) );
+                $args = explode( ' ', trim( $ini_arr[1] ) );
                 foreach ( $args as $arg )
                 {
                     $vars = explode( '=', trim( $arg ) );
-                    if ( $vars[0] == "charset" )
+                    if ( $vars[0] === 'charset' )
                     {
                         $val = $vars[1];
-                        if ( $val[0] == '"' and
+                        if ( $val[0] === '"' and
                              strlen( $val ) > 0 and
-                             $val[strlen($val)-1] == '"' )
+                             $val[strlen($val)-1] === '"' )
                             $val = substr( $val, 1, strlen($val) - 2 );
                         $this->Charset = $val;
                     }
@@ -601,7 +603,7 @@
 
         foreach ( explode( "\n", $contents ) as $line )
         {
-            if ( $line == '' or $line[0] == '#' )
+            if ( $line == '' or $line[0] === '#' )
                 continue;
             if ( preg_match( "/^(.+)##.*/", $line, $regs ) )
                 $line = $regs[1];
@@ -640,7 +642,7 @@
                     // will be created as well.
                     if ( $this->AddArrayDefinition )
                     {
-                        $this->BlockValues[$currentBlock][$varName][] = "";
+                        $this->BlockValues[$currentBlock][$varName][] = '';
                     }
                 }
             }
@@ -732,9 +734,8 @@
             $pathArray[] = 'override';
             $dirArray[] = 'override';
         }
-        if ( is_string( $useOverride ) and
-             $useOverride == "append" )
-            $fileName .= ".append";
+        if ( $useOverride === 'append' )
+            $fileName .= '.append';
         if ( $suffix !== false )
             $fileName .= $suffix;
 
@@ -768,7 +769,7 @@
         $fp = @fopen( $filePath, "w+");
         if ( !$fp )
         {
-            eZDebug::writeError( "Failed opening file '$filePath' for writing", "eZINI" );
+            eZDebug::writeError( "Failed opening file '$filePath' for writing", 'eZINI' );
             return false;
         }
         $writeOK = true;
@@ -828,7 +829,7 @@
                         if ( count( $varValue ) > 0 )
                         {
                             $customResetArray = ( isset( $this->BlockValues[$blockName]['ResetArrays'] ) and
-                                                  $this->BlockValues[$blockName]['ResetArrays'] == 'false' )
+                                                  $this->BlockValues[$blockName]['ResetArrays'] === 'false' )
                                                 ? true
                                                 : false;
                             if ( $resetArrays and !$customResetArray )
@@ -934,10 +935,10 @@
         if ( $this->UseLocalOverrides == true )
             $dirs =& $this->LocalOverrideDirArray;
         else
-            $dirs =& $GLOBALS["eZINIOverrideDirList"];
+            $dirs =& $GLOBALS['eZINIOverrideDirList'];
 
         if ( !isset( $dirs ) or !is_array( $dirs ) )
-            $dirs = array( array( "override", false, false ) );
+            $dirs = array( array( 'override', false, false ) );
         return $dirs;
     }
 
@@ -947,8 +948,8 @@
     */
     function prependOverrideDir( $dir, $globalDir = false, $identifier = false )
     {
-        if ( eZINI::isDebugEnabled() )
-            eZDebug::writeNotice( "Changing override dir to '$dir'", "eZINI" );
+        if ( self::$debugInternalsEnabled )
+            eZDebug::writeNotice( "Changing override dir to '$dir'", 'eZINI' );
 
         if ( $this->UseLocalOverrides == true )
             $dirs =& $this->LocalOverrideDirArray;
@@ -953,7 +954,7 @@
         if ( $this->UseLocalOverrides == true )
             $dirs =& $this->LocalOverrideDirArray;
         else
-            $dirs =& $GLOBALS["eZINIOverrideDirList"];
+            $dirs =& $GLOBALS['eZINIOverrideDirList'];
 
         if ( !isset( $dirs ) or !is_array( $dirs ) )
             $dirs = array( array( 'override', false, false ) );
@@ -984,7 +985,7 @@
     */
     function appendOverrideDir( $dir, $globalDir = false, $identifier = false )
     {
-        if ( eZINI::isDebugEnabled() )
+        if ( self::$debugInternalsEnabled )
             eZDebug::writeNotice( "Changing override dir to '$dir'", "eZINI" );
 
         if ( $this->UseLocalOverrides == true )
@@ -990,7 +991,7 @@
         if ( $this->UseLocalOverrides == true )
             $dirs =& $this->LocalOverrideDirArray;
         else
-            $dirs =& $GLOBALS["eZINIOverrideDirList"];
+            $dirs =& $GLOBALS['eZINIOverrideDirList'];
 
         if ( !isset( $dirs ) or !is_array( $dirs ) )
             $dirs = array( 'override', false, false );
@@ -1036,7 +1037,7 @@
     {
         $ret = false;
         if ( !isset( $this->BlockValues[$blockName] ) )
-            eZDebug::writeError( "Undefined group: '$blockName' in " . $this->FileName, "eZINI" );
+            eZDebug::writeError( "Undefined group: '$blockName' in " . $this->FileName, 'eZINI' );
         else if ( isset( $this->BlockValues[$blockName][$varName] ) )
             $ret = $this->BlockValues[$blockName][$varName];
         else
@@ -1069,7 +1070,7 @@
                     switch ( $signatures[$key] )
                     {
                         case 'enabled':
-                            $ret[$key] = $this->BlockValues[$blockName][$varName] == 'enabled';
+                            $ret[$key] = $this->BlockValues[$blockName][$varName] === 'enabled';
                             break;
                     }
                 }
@@ -1120,7 +1121,7 @@
             $arr = array();
             foreach ( $ret as $retItem )
             {
-                $arr[] = explode( ";", $retItem );
+                $arr[] = explode( ';', $retItem );
             }
             $ret = $arr;
         }
@@ -1125,7 +1126,7 @@
             $ret = $arr;
         }
         else if ( $ret !== false )
-            $ret = explode( ";", $ret );
+            $ret = explode( ';', $ret );
 
         return $ret;
     }
@@ -1233,7 +1234,7 @@
             case 4:
             {
                 $placement = 'siteaccess';
-                if ( $exploded[0] == 'extension' )
+                if ( $exploded[0] === 'extension' )
                     $placement = 'extension:' . $exploded[1];
             }
             break;
@@ -1252,11 +1253,11 @@
         if ( is_numeric( $settingValue ) )
             return 'numeric';
 
-        if ( $settingValue == 'true' or $settingValue == 'false' )
+        if ( $settingValue === 'true' or $settingValue === 'false' )
         {
             return 'true/false';
         }
-        if ( $settingValue == 'enabled' or $settingValue == 'disabled' )
+        if ( $settingValue === 'enabled' or $settingValue === 'disabled' )
         {
             return 'enable/disable';
         }
@@ -1332,12 +1333,9 @@
      \static
      \return true if the ini file \a $fileName has been loaded yet.
     */
-    static function isLoaded( $fileName = "site.ini", $rootDir = "settings", $useLocalOverrides = null )
+    static function isLoaded( $fileName = 'site.ini', $rootDir = 'settings', $useLocalOverrides = null )
     {
-        $isLoaded =& $GLOBALS["eZINIGlobalIsLoaded-$rootDir-$fileName-$useLocalOverrides"];
-        if ( !isset( $isLoaded ) )
-            return false;
-        return $isLoaded;
+        return isset( self::$instanceList[$fileName][$rootDir][$useLocalOverrides] );
     }
 
     /*!
@@ -1348,21 +1346,13 @@
       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 )
+    public 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";
-
-        if ( !isset( $GLOBALS[$globalsKey] ) ||
-             !( $GLOBALS[$globalsKey] instanceof eZINI ) )
+        if ( !isset( self::$instanceList[$fileName][$rootDir][$useLocalOverrides] ) )
         {
-            $GLOBALS[$globalsIsLoadedKey] = false;
-
-            $GLOBALS[$globalsKey] = new eZINI( $fileName, $rootDir, $useTextCodec, $useCache, $useLocalOverrides, $directAccess, $addArrayDefinition );
-
-            $GLOBALS[$globalsIsLoadedKey] = true;
+            self::$instanceList[$fileName][$rootDir][$useLocalOverrides] = new eZINI( $fileName, $rootDir, $useTextCodec, $useCache, $useLocalOverrides, $directAccess, $addArrayDefinition );
         }
-        return $GLOBALS[$globalsKey];
+        return self::$instanceList[$fileName][$rootDir][$useLocalOverrides];
     }
 
     /*!
@@ -1379,7 +1369,7 @@
       \static
       Similar to instance() but will always create a new copy.
     */
-    static function create( $fileName = "site.ini", $rootDir = "settings", $useTextCodec = null, $useCache = null, $useLocalOverrides = null )
+    static function create( $fileName = 'site.ini', $rootDir = 'settings', $useTextCodec = null, $useCache = null, $useLocalOverrides = null )
     {
         $impl = new eZINI( $fileName, $rootDir, $useTextCodec, $useCache, $useLocalOverrides );
         return $impl;
@@ -1404,10 +1394,9 @@
     /*!
      \static
     */
-    static function resetGlobals(  $fileName = "site.ini", $rootDir = "settings", $useLocalOverrides = null )
+    static function resetGlobals(  $fileName = 'site.ini', $rootDir = 'settings', $useLocalOverrides = null )
     {
-        unset( $GLOBALS["eZINIGlobalInstance-$rootDir-$fileName-$useLocalOverrides"] );
-        unset( $GLOBALS["eZINIGlobalIsLoaded-$rootDir-$fileName-$useLocalOverrides"] );
+        unset( self::$instanceList[$fileName][$rootDir][$useLocalOverrides] );
     }
 
     /// \privatesection
Index: lib/ezutils/classes/ezsys.php
===================================================================
--- lib/ezutils/classes/ezsys.php	(revision 20548)
+++ lib/ezutils/classes/ezsys.php	(working copy)
@@ -62,29 +62,28 @@
     */
     function eZSys()
     {
-        $this->Attributes = array( "magickQuotes" => true,
-                                   "hostname" => true );
+        $this->Attributes = array( 'magickQuotes' => true,
+                                   'hostname' => true );
         // Determine OS specific settings
-        $uname = php_uname();
-        if ( substr( $uname, 0, 7 ) == "Windows" )
+        if (!strncasecmp(PHP_OS, 'WIN', 3))
         {
-            $this->OSType = "win32";
-            $this->OS = "windows";
-            $this->FileSystemType = "win32";
+            $this->OSType = 'win32';
+            $this->OS = 'windows';
+            $this->FileSystemType = 'win32';
             $this->FileSeparator = "\\";
             $this->LineSeparator= "\r\n";
-            $this->EnvSeparator = ";";
+            $this->EnvSeparator = ';';
             $this->ShellEscapeCharacter = '"';
             $this->BackupFilename = '.bak';
         }
-        else if ( substr( $uname, 0, 3 ) == "Mac" )
+        else if (!strncasecmp(PHP_OS, 'MAC', 3))
         {
-            $this->OSType = "mac";
-            $this->OS = "mac";
-            $this->FileSystemType = "unix";
-            $this->FileSeparator = "/";
+            $this->OSType = 'mac';
+            $this->OS = 'mac';
+            $this->FileSystemType = 'unix';
+            $this->FileSeparator = '/';
             $this->LineSeparator= "\r";
-            $this->EnvSeparator = ":";
+            $this->EnvSeparator = ':';
             $this->ShellEscapeCharacter = "'";
             $this->BackupFilename = '~';
         }
@@ -90,12 +89,12 @@
         }
         else
         {
-            $this->OSType = "unix";
-            if ( strtolower( substr( $uname, 0, 5 ) ) == 'linux' )
+            $this->OSType = 'unix';
+            if (!strncasecmp(PHP_OS, 'LINUX', 5))
             {
                 $this->OS = 'linux';
             }
-            else if ( strtolower( substr( $uname, 0, 0 ) ) == 'freebsd' )
+            else if (!strncasecmp(PHP_OS, 'FREEBSD', 7))
             {
                 $this->OS = 'freebsd';
             }
@@ -103,10 +102,10 @@
             {
                 $this->OS = false;
             }
-            $this->FileSystemType = "unix";
-            $this->FileSeparator = "/";
+            $this->FileSystemType = 'unix';
+            $this->FileSeparator = '/';
             $this->LineSeparator= "\n";
-            $this->EnvSeparator = ":";
+            $this->EnvSeparator = ':';
             $this->ShellEscapeCharacter = "'";
             $this->BackupFilename = '~';
         }
@@ -184,7 +183,7 @@
     */
     static function phpVersionText()
     {
-        return phpversion();
+        return PHP_VERSION;
     }
 
     /*!
@@ -233,7 +232,7 @@
     {
         $sapiType = php_sapi_name();
 
-        if ( $sapiType == 'cli' )
+        if ( $sapiType === 'cli' )
             return true;
 
         // For CGI we have to check, if the script has been executed over shell.
@@ -238,7 +237,7 @@
 
         // For CGI we have to check, if the script has been executed over shell.
         // Currently it looks like the HTTP_HOST variable is the most reasonable to check.
-        if ( substr( $sapiType, 0, 3 ) == 'cgi' )
+        if ( substr( $sapiType, 0, 3 ) === 'cgi' )
         {
             if ( !eZSys::serverVariable( 'HTTP_HOST', true ) )
                 return true;
@@ -329,7 +328,7 @@
                 $argumentElements[] = substr( $argumentText, $quoteStartPos, $quoteEndPos - $quoteStartPos );
                 $pos = $quoteEndPos + 1;
             }
-            else if ( $argumentText[$pos] == ' ' )
+            else if ( $argumentText[$pos] === ' ' )
             {
                 $spacePos = $pos;
                 $spaceEndPos = $pos;
@@ -335,7 +334,7 @@
                 $spaceEndPos = $pos;
                 while ( $spaceEndPos < strlen( $argumentText ) )
                 {
-                    if ( $argumentText[$spaceEndPos] != ' ' )
+                    if ( $argumentText[$spaceEndPos] !== ' ' )
                         break;
                     ++$spaceEndPos;
                 }
@@ -354,7 +353,7 @@
                     $spaceEndPos = $spacePos + 1;
                     while ( $spaceEndPos < strlen( $argumentText ) )
                     {
-                        if ( $argumentText[$spaceEndPos] != ' ' )
+                        if ( $argumentText[$spaceEndPos] !== ' ' )
                             break;
                         ++$spaceEndPos;
                     }
@@ -463,7 +462,7 @@
         $cacheDir = $ini->variable( 'FileSettings', 'CacheDir' );
 
         //include_once( 'lib/ezfile/classes/ezdir.php' );
-        if ( $cacheDir[0] == "/" )
+        if ( $cacheDir[0] === '/' )
         {
             return eZDir::path( array( $cacheDir ) );
         }
@@ -503,7 +502,7 @@
     */
     static function siteDir()
     {
-        if ( isset( $this ) and strtolower( get_class( $this ) ) == "ezsys" )
+        if ( isset( $this ) and strtolower( get_class( $this ) ) === 'ezsys' )
             $instance = $this;
         else
             $instance = eZSys::instance();
@@ -516,7 +515,7 @@
     */
     static function wwwDir()
     {
-        if ( isset( $this ) and strtolower( get_class( $this ) ) == "ezsys" )
+        if ( isset( $this ) and strtolower( get_class( $this ) ) === 'ezsys' )
             $instance = $this;
         else
             $instance = eZSys::instance();
@@ -529,7 +528,7 @@
     */
     static function indexDir( $withAccessList = true )
     {
-        if ( isset( $this ) and strtolower( get_class( $this ) ) == "ezsys" )
+        if ( isset( $this ) and strtolower( get_class( $this ) ) === 'ezsys' )
             $instance = $this;
         else
             $instance = eZSys::instance();
@@ -549,7 +548,7 @@
         $text = $instance->IndexFile;
 
         $ini = eZINI::instance();
-        if ( $ini->variable( 'SiteAccessSettings', 'RemoveSiteAccessIfDefaultAccess' ) == 'enabled' )
+        if ( $ini->variable( 'SiteAccessSettings', 'RemoveSiteAccessIfDefaultAccess' ) === 'enabled' )
         {
             $defaultAccess = $ini->variable( 'SiteSettings', 'DefaultAccess' );
             if ( count( $instance->AccessPath ) > 0 and $instance->AccessPath[0] == $defaultAccess ){
@@ -785,19 +784,19 @@
         {
             return $this->$attr();
         }
-        else if ( $attr == 'wwwdir' )
+        else if ( $attr === 'wwwdir' )
         {
             return $this->wwwDir();
         }
-        else if ( $attr == 'sitedir' )
+        else if ( $attr === 'sitedir' )
         {
             return $this->siteDir();
         }
-        else if ( $attr == 'indexfile' )
+        else if ( $attr === 'indexfile' )
         {
             return $this->indexFile();
         }
-        else if ( $attr == 'indexdir' )
+        else if ( $attr === 'indexdir' )
         {
             return $this->indexDir();
         }
@@ -856,9 +855,9 @@
      stated in the parameter list.
      \static
     */
-    static function init( $def_index = "index.php", $force_VirtualHost = false )
+    static function init( $def_index = 'index.php', $force_VirtualHost = false )
     {
-        $isCGI = ( substr( php_sapi_name(), 0, 3 ) == 'cgi' );
+        $isCGI = ( substr( php_sapi_name(), 0, 3 ) === 'cgi' );
 
         $instance = eZSys::instance();
 
@@ -898,8 +897,8 @@
         }
 
         // Setting the right include_path
-        $includePath = ini_get( "include_path" );
-        if ( trim( $includePath ) != "" )
+        $includePath = ini_get( 'include_path' );
+        if ( trim( $includePath ) != '' )
         {
             $includePath = $includePath . $instance->envSeparator() . $siteDir;
         }
@@ -907,7 +906,7 @@
         {
             $includePath = $siteDir;
         }
-        ini_set( "include_path", $includePath );
+        ini_set( 'include_path', $includePath );
 
         $scriptName = eZSys::serverVariable( 'SCRIPT_NAME' );
         // Get the webdir.
@@ -912,11 +911,11 @@
         $scriptName = eZSys::serverVariable( 'SCRIPT_NAME' );
         // Get the webdir.
 
-        $wwwDir = "";
+        $wwwDir = '';
 
         if ( $force_VirtualHost )
         {
-            $wwwDir = "";
+            $wwwDir = '';
         }
         else
         {
Index: pre_check.php
===================================================================
--- pre_check.php	(revision 20548)
+++ pre_check.php	(working copy)
@@ -34,11 +34,11 @@
 function eZCheckValidity( &$siteBasics, &$uri )
 {
     $ini = eZINI::instance();
-    $checkValidity = ( $ini->variable( "SiteAccessSettings", "CheckValidity" ) == "true" );
+    $checkValidity = ( $ini->variable( 'SiteAccessSettings', 'CheckValidity' ) === 'true' );
     $check = null;
     if ( $checkValidity )
     {
-        $check = array( "module" => "setup",
+        $check = array( 'module' => 'setup',
                         'function' => 'init' );
         // Turn off some features that won't bee needed yet
 //        $siteBasics['policy-check-required'] = false;
@@ -69,8 +69,8 @@
 function eZCheckList()
 {
     $checks = array();
-    $checks["validity"] = array( "function" => "eZCheckValidity" );
-    $checks["user"] = array( "function" => "eZCheckUser" );
+    $checks['validity'] = array( 'function' => 'eZCheckValidity' );
+    $checks['user'] = array( 'function' => 'eZCheckUser' );
     return $checks;
 }
 
@@ -123,9 +123,9 @@
         if ( !isset( $checks[$checkItem] ) )
             continue;
         $check = $checks[$checkItem];
-        if ( !isset( $check["allow"] ) or $check["allow"] )
+        if ( !isset( $check['allow'] ) or $check['allow'] )
         {
-            $func = $check["function"];
+            $func = $check['function'];
             $check = $func( $siteBasics, $uri );
             if ( $check !== null )
                 return $check;
