diff --git a/composer.json b/composer.json index a909e884..a69b5905 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,8 @@ "phpunit/phpunit": "^4.8", "squizlabs/php_codesniffer": "^2.3", "roave/security-advisories": "dev-master", - "filp/whoops": "^2.0" + "filp/whoops": "^2.0", + "symfony/var-dumper": "^3.0" }, "autoload": { "psr-4": { diff --git a/config/app.php b/config/app.php index 4d847f64..08b73799 100644 --- a/config/app.php +++ b/config/app.php @@ -2,6 +2,8 @@ use Zend\Expressive\Application; use Zend\ServiceManager\ServiceManager; +chdir(dirname(__DIR__)); + require __DIR__ . '/../vendor/autoload.php'; // Build container diff --git a/config/autoload/routes.global.php b/config/autoload/routes.global.php index 83650c5c..773f3e87 100644 --- a/config/autoload/routes.global.php +++ b/config/autoload/routes.global.php @@ -12,6 +12,15 @@ return [ }, 'allowed_methods' => ['GET'], ], + [ + 'name' => 'cli', + 'path' => 'command-name', + 'middleware' => function ($req, $resp) { + $resp->getBody()->write('Hello world from cli'); + return $resp; + }, + 'allowed_methods' => ['GET'], + ], ], ]; diff --git a/public/index.php b/public/index.php index cf46cc99..16af56e5 100644 --- a/public/index.php +++ b/public/index.php @@ -1,8 +1,6 @@ run(); diff --git a/templates/layout/default.html.twig b/templates/layout/default.html.twig index 163e6437..b3664d0e 100644 --- a/templates/layout/default.html.twig +++ b/templates/layout/default.html.twig @@ -43,9 +43,7 @@