Initial commit

This commit is contained in:
Maarten 2019-12-20 00:09:25 +01:00
commit 06f17dff5b
9 changed files with 115 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
.idea
vendor

View file

@ -0,0 +1,13 @@
<?php
namespace App\Http\Controllers;
use Runtime\Http\Controllers\Controller;
class BaseController extends Controller {
public function test() {
return $this->lol();
}
}

25
composer.json Normal file
View file

@ -0,0 +1,25 @@
{
"name": "maartenvr98/framework",
"type": "project",
"description": "Another Cool Framework.",
"keywords": [
"framework"
],
"license": "MIT",
"require": {
"php": "^7.2"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"autoload": {
"psr-4": {
"Runtime\\": "src/Runtime/",
"App\\": "app/"
}
},
"minimum-stability": "dev",
"prefer-stable": true
}

19
composer.lock generated Normal file
View file

@ -0,0 +1,19 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "6de065434f40becaf0a1e74d6aaff7a9",
"packages": [],
"packages-dev": [],
"aliases": [],
"minimum-stability": "dev",
"stability-flags": [],
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
"php": "^7.2"
},
"platform-dev": []
}

5
index.php Normal file
View file

@ -0,0 +1,5 @@
<?php
include 'vendor/autoload.php';
echo \Runtime\Bootstrap::handle();

0
routes/web.php Normal file
View file

28
src/Runtime/Bootstrap.php Normal file
View file

@ -0,0 +1,28 @@
<?php
namespace Runtime;
use App\Http\Controllers\BaseController;
class Bootstrap {
/**
* Start handling process
*
* @return string
*/
public static function handle() {
return (new Bootstrap())->run();
}
private $base;
public function __construct()
{
$this->base = new BaseController();
}
protected function run() {
return $this->base->test();
}
}

View file

@ -0,0 +1,11 @@
<?php
namespace Runtime\Http\Controllers;
class Controller {
public function lol() {
return new ControllerExtractor();
}
}

View file

@ -0,0 +1,12 @@
<?php
namespace Runtime\Http\Controllers;
class ControllerExtractor {
public function __toString()
{
return "Het werkt :)";
}
}