summaryrefslogtreecommitdiff
path: root/src/lib/PluginManager.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/PluginManager.class.php')
-rw-r--r--src/lib/PluginManager.class.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/PluginManager.class.php b/src/lib/PluginManager.class.php
index 2e3dd2b..ce5a3ef 100644
--- a/src/lib/PluginManager.class.php
+++ b/src/lib/PluginManager.class.php
@@ -1,6 +1,8 @@
<?php
+require_once('Singleton.class.php');
+require_once('Database.class.php');
-class PluginManager {
+class PluginManager extends Singleton {
public $plugins = array();
private $loaded = false;
@@ -8,7 +10,7 @@ class PluginManager {
* Return an instance of the plugin with $plugin_name
*/
public function loadPlugin($plugin_name) {
- global $mm; $db = $mm->database();
+ $db = Database::getInstance();
require_once("$plugin_name.class.php");
$obj = new $plugin_name;
@@ -53,7 +55,7 @@ class PluginManager {
* Return an array of enabled plugin names.
*/
public function getActivePlugins() {
- global $mm; $db = $mm->database();
+ $db = Database::getInstance();
$string = $db->getSysConf('plugins');
return $db->valueToArray($string);
}
@@ -62,7 +64,7 @@ class PluginManager {
* Set the enabled plugins.
*/
public function setActivePlugins($plugins) {
- global $mm; $db = $mm->database();
+ $db = Database::getInstance();
$string = $db->arrayToValue($plugins);
return $db->setSysConf('plugins', $string);
}