]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions.php
Unsupported extensions removed, several rewrites to extension handling, 'yoomedia...
[mailer.git] / inc / extensions.php
index cfe82ae48efecd04076eb52701b78d3633ef19c8..dd6cfa4b7d573be69f3d8dc06c9794321c212dca 100644 (file)
@@ -38,17 +38,19 @@ if (!defined('__SECURITY')) {
 }
 
 //
-function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false)
-{
+function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false) {
        global $NOTES, $_CONFIG, $INC_POOL, $cacheInstance;
 
+       // This shall never do a non-admin user!
+       if (!IS_ADMIN()) return false;
+
+       // Is this extension already installed?
+       if (EXT_IS_ACTIVE($ext_name)) return false;
+
        // We want to register an extension and registration status is by default "failed" (= false)
        $EXT_LOAD_MODE = "register"; $ret = false; $SQLs = array();
        $INC_POOL = array();
 
-       // This shall never do a non-admin user!
-       if (!IS_ADMIN()) return false;
-
        // By default the language prefix is the extension's name
        // @TODO: Do we really need this one anymore? Can't we just take $ext_name and done?
        $EXT_LANG_PREFIX = $ext_name;
@@ -56,9 +58,6 @@ function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false)
        // By default we have no failtures
        $EXT_REPORTS_FAILURE = false;
 
-       // Is this extension already installed?
-       if (EXT_IS_ACTIVE($ext_name)) return false;
-
        // Generate file name
        $file = sprintf("%sinc/extensions/ext-%s.php", PATH, $ext_name);
 
@@ -120,7 +119,7 @@ function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false)
                                // If versions mismatch update extension first
                                $ext_ver = GET_EXT_VERSION($EXT_UPDATE_DEPENDS);
 
-                               // Extension version set?
+                               // Extension version set? If empty the extension is not registered
                                if (empty($ext_ver)) {
                                        // Extension not registered so far so first load task's ID...
                                        $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE task_type='EXTENSION' AND subject LIKE '[%s:]%%' LIMIT 1",