All non-productive extensions marked as 'non-productive', a warning will be issued...
[mailer.git] / inc / extensions-functions.php
index 990c04ce79cd15c7387c2c5ba1cb1310db39d433..710d154398739c4a7650de14256415e063ae11fd 100644 (file)
@@ -150,6 +150,9 @@ function registerExtension ($ext_name, $task_id, $dry_run = false, $logout = tru
        // Enable dry-run
        enableExtensionDryRun($dry_run);
 
+       // By default all extensions are in productive phase
+       enableExtensionProductive();
+
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "currName=".getCurrentExtensionName()." - ENTERED!");
        // This shall never do a non-admin user or if the extension is active (already installed)
        if ((!isAdmin()) || (isExtensionInstalled($ext_name))) {
@@ -1708,5 +1711,17 @@ function addSponsorMenuSql ($action, $what, $title, $active, $sort) {
        }
 }
 
+// Enables/disables productive mode for current extension (used only while
+// registration).
+function enableExtensionProductive ($isProductive = true) {
+       $GLOBALS['ext_productive'][getCurrentExtensionName()] = (bool) $isProductive;
+}
+
+// Checks wether the extension is in productive phase. If not set, development
+// phase (=false) is assumed.
+function isExtensionProductive () {
+       return ((isset($GLOBALS['ext_productive'][getCurrentExtensionName()])) && ($GLOBALS['ext_productive'][getCurrentExtensionName()] === true));
+}
+
 // [EOF]
 ?>