Decouple Bootstrap
This commit is contained in:
parent
04b9f60df6
commit
4c8ce751f2
@ -316,7 +316,6 @@ class Input {
|
||||
$q_types = [];
|
||||
// A fake value so I can shift it off to have a 1-indexed array
|
||||
$high_types = [];
|
||||
$output = [];
|
||||
$count = 1;
|
||||
|
||||
// Split into segments of different values
|
||||
|
@ -1,25 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Sleepy - a REST framework
|
||||
*
|
||||
*
|
||||
* A PHP Rest Framework valuing convention over configuration,
|
||||
* but aiming to be as flexible as possible
|
||||
*
|
||||
* @author Timothy J. Warren
|
||||
*/
|
||||
|
||||
namespace Sleepy\Core;
|
||||
|
||||
class Router {
|
||||
|
||||
protected $class;
|
||||
protected $method;
|
||||
|
||||
public function __construct($config = [])
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// End of core/Router.php
|
36
index.php
36
index.php
@ -10,45 +10,19 @@
|
||||
* @package Sleepy
|
||||
*/
|
||||
|
||||
namespace Sleepy\Core;
|
||||
|
||||
// Include namespaces
|
||||
use Aura\Di\Container as DiContainer;
|
||||
use Aura\Di\Factory as DiFactory;
|
||||
use Aura\Router\RouterFactory;
|
||||
namespace Sleepy;
|
||||
|
||||
define('BASEPATH', __DIR__ . '/');
|
||||
define('SLEEPY_DIR', 'Sleepy');
|
||||
define('APP_DIR', 'application');
|
||||
define('APPPATH', __DIR__ . '/application/');
|
||||
|
||||
// Include 3rd party dependencies
|
||||
include BASEPATH . '/vendor/autoload.php';
|
||||
|
||||
// Load the autoloader
|
||||
// Autoloaders
|
||||
include BASEPATH . 'vendor/autoload.php';
|
||||
require BASEPATH . SLEEPY_DIR . '/autoload.php';
|
||||
|
||||
$di = new DiContainer(new DiFactory());
|
||||
// And...bootstrap
|
||||
require APPPATH . 'bootstrap.php';
|
||||
|
||||
$rf = new RouterFactory();
|
||||
|
||||
$di->set('config', new Config());
|
||||
$di->set('router', $rf->newInstance());
|
||||
$di->set('input', new Input());
|
||||
$di->set('output', new Output($di->get('config'), $di->get('input')));
|
||||
|
||||
$browser->browser_name_regex = \utf8_encode($browser->browser_name_regex);
|
||||
$di->get('output')->set_data(['json','yaml','html'], [
|
||||
'$_SERVER' => $i->server(),
|
||||
'$_GET' => $i->get(),
|
||||
'$_POST' => $i->post(),
|
||||
'$_PUT' => $i->put(),
|
||||
'$_DELETE' => $i->delete(),
|
||||
'$_ENV' => $i->env(),
|
||||
'$_COOKIE' => $i->cookie(),
|
||||
'browser' => $browser,
|
||||
'raw headers' => $i->header(),
|
||||
'parsed headers' => $i->header_array()
|
||||
]);
|
||||
|
||||
// End of index.php
|
Reference in New Issue
Block a user