allow plugins to become cmd modules
This commit is contained in:
parent
6da603fbb5
commit
f217a557b8
4
boot.php
4
boot.php
|
@ -195,7 +195,7 @@ class App {
|
||||||
public $hooks;
|
public $hooks;
|
||||||
public $timezone;
|
public $timezone;
|
||||||
public $interactive = true;
|
public $interactive = true;
|
||||||
|
public $plugins;
|
||||||
|
|
||||||
private $scheme;
|
private $scheme;
|
||||||
private $hostname;
|
private $hostname;
|
||||||
|
@ -478,6 +478,8 @@ function check_config(&$a) {
|
||||||
if($plugins)
|
if($plugins)
|
||||||
$plugins_arr = explode(',',str_replace(' ', '',$plugins));
|
$plugins_arr = explode(',',str_replace(' ', '',$plugins));
|
||||||
|
|
||||||
|
$a->plugins = $plugins_arr;
|
||||||
|
|
||||||
$installed_arr = array();
|
$installed_arr = array();
|
||||||
|
|
||||||
if(count($installed)) {
|
if(count($installed)) {
|
||||||
|
|
|
@ -134,7 +134,12 @@ else
|
||||||
|
|
||||||
|
|
||||||
if(strlen($a->module)) {
|
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");
|
include("mod/{$a->module}.php");
|
||||||
$a->module_loaded = true;
|
$a->module_loaded = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user