Setup basic for cli interface
This commit is contained in:
parent
cc9856ad39
commit
3e10244ff5
4 changed files with 31 additions and 0 deletions
|
@ -20,6 +20,7 @@
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Runtime\\": "src/Runtime/",
|
"Runtime\\": "src/Runtime/",
|
||||||
|
"Cli\\": "src/Cli/",
|
||||||
"App\\": "app/"
|
"App\\": "app/"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
|
8
dd
Normal file
8
dd
Normal 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
13
src/Cli/Factory.php
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Cli;
|
||||||
|
|
||||||
|
class Factory
|
||||||
|
{
|
||||||
|
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
echo 'het werkt :)';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace Runtime\Factory;
|
namespace Runtime\Factory;
|
||||||
|
|
||||||
|
use Cli\Factory;
|
||||||
use Runtime\Exceptions\Exceptions\ClassNotFoundException;
|
use Runtime\Exceptions\Exceptions\ClassNotFoundException;
|
||||||
use Runtime\Http\View\ViewEngine;
|
use Runtime\Http\View\ViewEngine;
|
||||||
use Runtime\Router\Route;
|
use Runtime\Router\Route;
|
||||||
|
@ -12,6 +13,9 @@ use Twig\Loader\FilesystemLoader;
|
||||||
|
|
||||||
class BootstrapFactory {
|
class BootstrapFactory {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
Route::setDefaultNamespace('\App\Http\Controllers');
|
Route::setDefaultNamespace('\App\Http\Controllers');
|
||||||
|
@ -29,6 +33,11 @@ class BootstrapFactory {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function kernel()
|
||||||
|
{
|
||||||
|
app(Factory::class)->handle();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $abstract
|
* @param $abstract
|
||||||
* @return mixed
|
* @return mixed
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue