Setup basic for cli interface

This commit is contained in:
Maarten 2019-12-24 01:23:13 +01:00
parent cc9856ad39
commit 3e10244ff5
4 changed files with 31 additions and 0 deletions

View file

@ -20,6 +20,7 @@
"autoload": {
"psr-4": {
"Runtime\\": "src/Runtime/",
"Cli\\": "src/Cli/",
"App\\": "app/"
},
"files": [

8
dd Normal file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env php
<?php
include __DIR__ . '/vendor/autoload.php';
$bootstrap = \Runtime\Bootstrap::createInstance();
$bootstrap->kernel();
?>

13
src/Cli/Factory.php Normal file
View file

@ -0,0 +1,13 @@
<?php
namespace Cli;
class Factory
{
public function handle()
{
echo 'het werkt :)';
}
}

View file

@ -2,6 +2,7 @@
namespace Runtime\Factory;
use Cli\Factory;
use Runtime\Exceptions\Exceptions\ClassNotFoundException;
use Runtime\Http\View\ViewEngine;
use Runtime\Router\Route;
@ -12,6 +13,9 @@ use Twig\Loader\FilesystemLoader;
class BootstrapFactory {
/**
*
*/
public function handle()
{
Route::setDefaultNamespace('\App\Http\Controllers');
@ -29,6 +33,11 @@ class BootstrapFactory {
}
}
public function kernel()
{
app(Factory::class)->handle();
}
/**
* @param $abstract
* @return mixed