Too useless exemple

master
sheychen 2017-06-10 17:20:06 +02:00
commit e96b17f5a5
3 changed files with 42 additions and 0 deletions

19
composer.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "krutush/exemple",
"license": "MIT",
"authors": [
{
"name": "sheychen",
"email": "contact@clementbois.fr"
}
],
"require": {
//PHP7.1
"krutush/krutush": "dev-master"
},
"autoload": {
"psr-4": {
"Exemple\\": "src/"
}
}
}

6
public/index.php Normal file
View File

@ -0,0 +1,6 @@
<?php
require __DIR__.'/../vendor/autoload.php';
$app = new Exemple\MyApp();
$app->run();
?>

17
src/MyApp.php Normal file
View File

@ -0,0 +1,17 @@
<?php
namespace Exemple;
use Krutush\App;
class MyApp extends App{
public function __construct(array $data = array()){
if(!isset($data['path']['root']))
$data['path']['root'] = dirname(__DIR__);
if(!isset($data['app']['namespace']))
$data['app']['namespace'] = __NAMESPACE__.'\\Controller\\';
if(!isset($data['app']['controller']))
$data['app']['controller'] = '';
parent::__construct($data);
}
}