]> git.mxchange.org Git - friendica.git/commitdiff
allow plugins to become cmd modules
authorFriendika <info@friendika.com>
Fri, 11 Feb 2011 00:17:21 +0000 (16:17 -0800)
committerFriendika <info@friendika.com>
Fri, 11 Feb 2011 00:17:21 +0000 (16:17 -0800)
boot.php
index.php

index 9d41abec49b0d4ec5514a0f718b0e605016fa3f0..f1edf798eabc62f1f19e2d95d4b705d23e42fd2e 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -195,7 +195,7 @@ class App {
        public  $hooks;
        public  $timezone;
        public  $interactive = true;
-
+       public  $plugins;
 
        private $scheme;
        private $hostname;
@@ -478,6 +478,8 @@ function check_config(&$a) {
        if($plugins)
                $plugins_arr = explode(',',str_replace(' ', '',$plugins));
 
+       $a->plugins = $plugins_arr;
+
        $installed_arr = array();
 
        if(count($installed)) {
index 5f128ebb1b4754a9615a97d244d3bcc1b7db2dce..d0de1b9dc69ce83da782704f4e3a34f4bb37abf6 100644 (file)
--- a/index.php
+++ b/index.php
@@ -134,7 +134,12 @@ else
 
 
 if(strlen($a->module)) {
-       if(file_exists("mod/{$a->module}.php")) {
+       if(is_array($a->plugins) && in_array($a->module,$a->plugins) && file_exists("addon/{$a->module}/{$a->module}.php")) {
+               include("addon/{$a->module}/{$a->module}.php");
+               if(function_exists($a->module . '_module'))
+                       $a->module_loaded = true;
+       }
+       if((! $a->module_loaded) && (file_exists("mod/{$a->module}.php"))) {
                include("mod/{$a->module}.php");
                $a->module_loaded = true;
        }