Follow-up to feature #13428: Extended generation of the caching hash
authorOliver Hader <oliver.hader@typo3.org>
Sat, 20 Feb 2010 14:23:09 +0000 (14:23 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Sat, 20 Feb 2010 14:23:09 +0000 (14:23 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6921 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/extjs/class.t3lib_extjs_extdirectapi.php

index 43d5145..deb084e 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
 2010-02-20  Oliver Hader  <oliver@typo3.org>
 
        * Added feature #13428: Caching of the ExtDirect API configuration (Thanks to Stefan Galinski)
+       * Follow-up to feature #13428: Extended generation of the caching hash
 
 2010-02-19  Benjamin Mack  <benni@typo3.org>
 
index 7d4dd5d..dcf925a 100644 (file)
  */
 class t3lib_extjs_ExtDirectApi {
        /**
+        * @var array
+        */
+       protected $settings = array();
+
+       /**
+        * Constructs this object.
+        */
+       public function __construct() {
+               if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'])) {
+                       $this->settings = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'];
+               }
+       }
+
+       /**
         * Parses the ExtDirect configuration array "$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect']"
         * and feeds the given typo3ajax instance with the resulting information. The get parameter
         * "namespace" will be used to filter the configuration.
@@ -52,7 +66,7 @@ class t3lib_extjs_ExtDirectApi {
 
                // look up into the cache
                $cacheIdentifier = 'ExtDirectApi';
-               $cacheHash = md5($cacheIdentifier . $filterNamespace);
+               $cacheHash = md5($cacheIdentifier . $filterNamespace . serialize($this->settings));
                $cacheContent = t3lib_pageSelect::getHash($cacheHash);
 
                // generate the javascript content if it wasn't found inside the cache and cache it!
@@ -101,8 +115,8 @@ class t3lib_extjs_ExtDirectApi {
         */
        protected function generateAPI($filterNamespace) {
                $javascriptNamespaces = array();
-               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'])) {
-                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'] as $javascriptName => $className) {
+               if (is_array($this->settings)) {
+                       foreach ($this->settings as $javascriptName => $className) {
                                $splittedJavascriptName = explode('.', $javascriptName);
                                $javascriptObjectName = array_pop($splittedJavascriptName);
                                $javascriptNamespace = implode('.', $splittedJavascriptName);