nice, event-based command line support; try 'php index.php' for info

This commit is contained in:
Shish
2012-06-17 20:05:16 +01:00
parent 427175983b
commit 082e6fa31b
5 changed files with 97 additions and 13 deletions

View File

@ -69,6 +69,19 @@ class AdminPage extends Extension {
}
}
public function onCommand(CommandEvent $event) {
if($event->cmd == "help") {
print " get-page [query string]\n";
print " eg 'get-page post/list'\n\n";
}
if($event->cmd == "get-page") {
global $page;
$_GET['q'] = $event->args[0];
send_event(_get_page_request());
$page->display();
}
}
public function onAdminBuilding(AdminBuildingEvent $event) {
$this->theme->display_page();
$this->theme->display_form();