Add ability to disable theme caching
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 23 Nov 2010 18:35:37 +0000 (11:35 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 23 Nov 2010 18:45:56 +0000 (11:45 -0700)
framework/Core/lib/Horde/Core/Factory/ThemesBuild.php
horde/config/conf.xml

index c57135f..f184d28 100644 (file)
@@ -74,8 +74,11 @@ class Horde_Core_Factory_ThemesBuild
             return $this->_instances[$sig];
         }
 
-        $cache = $this->_injector->getInstance('Horde_Cache');
-        if ($cache instanceof Horde_Cache_Null) {
+        if (!empty($GLOBALS['conf']['cachethemes'])) {
+            $cache = $this->_injector->getInstance('Horde_Cache');
+        }
+
+        if (!$cache || ($cache instanceof Horde_Cache_Null)) {
             $instance = new Horde_Themes_Build($app, $theme);
         } else {
             $id = $sig . '|' . $GLOBALS['registry']->getVersion($app);
index 3af806d..ade0b17 100644 (file)
     </configsection>
    </case>
   </configswitch>
+
+  <configheader>Theme Caching</configheader>
+  <configdescription>
+   Theme caching optimizes display of themed elements. Caching reduces
+   server load (specifically by dramatically reducing filesystem access), and
+   is HIGHLY RECOMMENDED. &lt;strong&gt;Requires a configured Horde caching
+   backend.&lt;/strong&gt;
+  </configdescription>
+  <configenum name="cachethemes" desc="Cache themes?">false
+   <values>
+    <value desc="No">false</value>
+    <value desc="Yes">true</value>
+   </values>
+  </configenum>
  </configtab>
 
  <configtab name="lock" desc="Lock System">