]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions-functions.php
Template cache introduced to shortcut expensive compileCode() calls:
[mailer.git] / inc / extensions-functions.php
index f89233a146abd1604cbb8917b369c0b84e87bb73..f531cb40e88894a34561b725c8e9c6c695c09cdf 100644 (file)
@@ -450,11 +450,10 @@ function isExtensionInstalled ($ext_name) {
                // Extensions are all inactive/not installed during installation
        } else {
                // Look in database
-               $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1",
-                       array($ext_name), __FILE__, __LINE__);
+               $ext_id = getExtensionId($ext_name);
 
                // Do we have a record?
-               $isInstalled = (SQL_NUMROWS($result) == 1);
+               $isInstalled = ($ext_id > 0);
 
                // Is it installed, then cache the entry
                if ($isInstalled === true) {
@@ -462,9 +461,6 @@ function isExtensionInstalled ($ext_name) {
                        getExtensionId($ext_name, true);
                } // END - if
 
-               // Free result
-               SQL_FREERESULT($result);
-
                // Remember the status
                $GLOBALS['ext_is_installed'][$ext_name] = $isInstalled;
        }
@@ -795,11 +791,9 @@ function getExtensionId ($ext_name, $forceDb = false) {
 
                // Cache it
                $GLOBALS['cache_array']['extension']['ext_id'][$ext_name] = $ret;
-       }
-
-       if ($ret == 0) {
-               // We should fix these all!
-               debug_report_bug(__FUNCTION__ . ': Invalid extension name found. ext_name=' . $ext_name);
+       } else {
+               // Caching enabled but no cache found is bad
+               debug_report_bug(__FUNCTION__ . ': Cache not found but ext-cache is active. ext_name=' . $ext_name);
        } // END - if
 
        // Return value