summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnDoh <roundcube@tehinterweb.co.uk>2014-08-16 07:02:50 +0100
committerJohnDoh <roundcube@tehinterweb.co.uk>2014-08-16 07:02:50 +0100
commit0b799bee90d897d052d0310300a377e067e1fa34 (patch)
tree72dc1cbe5f6653289f9147d9a0fe44d5c274f17b
parente7cd99ca9e81e4f516576fff5954f68ce005cf7a (diff)
add support for optional plugins
-rw-r--r--program/lib/Roundcube/rcube_plugin_api.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/program/lib/Roundcube/rcube_plugin_api.php b/program/lib/Roundcube/rcube_plugin_api.php
index 335348cef..dae3a936d 100644
--- a/program/lib/Roundcube/rcube_plugin_api.php
+++ b/program/lib/Roundcube/rcube_plugin_api.php
@@ -170,10 +170,11 @@ class rcube_plugin_api
*
* @param string Plugin name
* @param boolean Force loading of the plugin even if it doesn't match the filter
+ * @param boolean Require loading of the plugin, error if it doesn't exist
*
* @return boolean True on success, false if not loaded or failure
*/
- public function load_plugin($plugin_name, $force = false)
+ public function load_plugin($plugin_name, $force = false, $require = true)
{
static $plugins_dir;
@@ -225,7 +226,7 @@ class rcube_plugin_api
true, false);
}
}
- else {
+ elseif ($require) {
rcube::raise_error(array('code' => 520, 'type' => 'php',
'file' => __FILE__, 'line' => __LINE__,
'message' => "Failed to load plugin file $fn"), true, false);