start of command-line ext manager
This commit is contained in:
parent
930de7fc8c
commit
a9b3ffe0eb
@ -128,6 +128,17 @@ class ExtManager extends Extension {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function onCommand(CommandEvent $event) {
|
||||||
|
if($event->cmd == "help") {
|
||||||
|
print " disable-all-ext\n";
|
||||||
|
print " disable all extensions\n\n";
|
||||||
|
}
|
||||||
|
if($event->cmd == "disable-all-ext") {
|
||||||
|
$this->write_config(array());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function onUserBlockBuilding(UserBlockBuildingEvent $event) {
|
public function onUserBlockBuilding(UserBlockBuildingEvent $event) {
|
||||||
global $user;
|
global $user;
|
||||||
if($user->can("manage_extension_list")) {
|
if($user->can("manage_extension_list")) {
|
||||||
@ -167,6 +178,10 @@ class ExtManager extends Extension {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->write_config($extras);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function write_config($extras) {
|
||||||
file_put_contents(
|
file_put_contents(
|
||||||
"data/config/extensions.conf.php",
|
"data/config/extensions.conf.php",
|
||||||
'<'.'?php'."\n".
|
'<'.'?php'."\n".
|
||||||
|
Loading…
x
Reference in New Issue
Block a user