+ addFatalMessage(__METHOD__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".getMessage('CACHE_PROBLEMS_DETECTED'));
+ }
+ }
+
+ // Writes the version of given extension to the cache file
+ function storeExtensionVersion ($ext_name) {
+ // Valid cache pointer?
+ if (is_resource($this->pointer)) {
+ // Get extension version
+ $ext_ver = GET_EXT_VERSION($ext_name);
+
+ // Write cache line to file
+ fwrite($this->pointer, "\$cache_version['".$ext_name."'] = \"".$ext_ver."\";\n");
+
+ // Add the extension version to object (DO NOT REMOVE IT! Endless loop...)
+ $this->version[$this->name][$ext_name] = $ext_ver;
+ //* DEBUG: */ print __METHOD__."(<font color=\"#0000aa\">".__LINE__."</font>): {$this->name} - {$ext_name}={$ext_ver}<br />\n";
+ } else {
+ // Cannot create file
+ addFatalMessage(__METHOD__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".getMessage('CACHE_PROBLEMS_DETECTED'));
+ }
+ }
+
+ // Checks wether versions from cache and extension matches
+ function extensionVersionMatches ($ext_name) {
+ // Load cache (dummy)
+ $this->getArrayFromCache();
+
+ // Get extension version
+ $ext_ver = GET_EXT_VERSION($ext_name);
+
+ // Debug messages
+ if (isset($this->version[$this->name][$ext_name])) {
+ //* DEBUG: */ print __METHOD__."(<font color=\"#0000aa\">".__LINE__."</font>): cache={$this->name},ext_name={$ext_name} - {$ext_ver}/{$this->version[$this->name][$ext_name]}<br />\n";
+ } else {
+ // No cache version found!
+ DEBUG_LOG(__METHOD__, __LINE__, "Cache {$this->name} has missing version entry for extension {$ext_name}!");
+ }
+
+ // Compare both
+ return ((isset($this->version[$this->name][$ext_name])) && ($this->version[$this->name][$ext_name] == $ext_ver));
+ }
+
+ // Rewrit the entry so it can be stored in cache file
+ // @TODO Add support for more types which break in last else-block
+ function rewriteEntry ($key, $value) {
+ // Init line
+ $line = '';
+
+ // String or non-string? ;-)
+ if (is_string($value)) {
+ // String...
+ $line = "\$data['".$key."'][] = \"".$value."\";\n";
+ } elseif (is_null($value)) {
+ // Null
+ $line = "\$data['".$key."'][] = null;\n";
+ } elseif (is_bool($value)) {
+ // Boolean value
+ if ($value === true) {
+ // True
+ $line = "\$data['".$key."'][] = true;\n";
+ } else {
+ // False
+ $line = "\$data['".$key."'][] = false;\n";
+ }
+ } else {
+ // Non-string
+ $line = "\$data['".$key."'][] = ".$value.";\n";