New static plugin hook registration has now been implemented. Looks to work with...
[squirrelmail.git] / include / init.php
index 1db44003f37effc3c89ba5f2f0ed382209a2eb96..6a0d70e1b362bbc3abb883e0243c26fe0201f385 100644 (file)
@@ -268,20 +268,13 @@ if (file_exists(SM_PATH . 'plugins/compatibility/functions.php'))
     include_once(SM_PATH . 'plugins/compatibility/functions.php');
 $squirrelmail_plugin_hooks = array();
 
-/* On init, register all plugins configured for use. */
-if (isset($plugins) && is_array($plugins)) {
-    // turn on output buffering in order to prevent output of new lines
-    ob_start();
-    foreach ($plugins as $name) {
-        use_plugin($name);
-    }
-    // get output and remove whitespace
-    $output = trim(ob_get_contents());
-    ob_end_clean();
-    // if plugins output more than newlines and spacing, stop script execution.
-    if (!empty($output)) {
-        die($output);
-    }
+/**
+ * On init, we no longer need to load all plugin setup files. 
+ * Now, we load the statically generated hook registrations here
+ * and let the hook calls include only the plugins needed.
+ */
+if (file_exists(SM_PATH . 'config/plugin_hooks.php')) {
+    include_once(SM_PATH . 'config/plugin_hooks.php');
 }
 
 /**