Throw exception when used within the PHP builtin webserver

This commit is contained in:
Flavio Copes
2015-12-03 17:29:46 +01:00
parent 939eadce08
commit 3af03e2f8e

View File

@@ -102,6 +102,9 @@ class AdminPlugin extends Plugin
{
// Only activate admin if we're inside the admin path.
if ($this->active) {
if (php_sapi_name() == 'cli-server') {
throw new \RuntimeException('The Admin Plugin cannot run on the PHP built-in webserver. It needs Apache, Nginx or another full-featured web server.', 500);
}
$this->grav['debugger']->addMessage("Admin Basic");
$this->initializeAdmin();