diff --git a/.gitignore b/.gitignore index 208a599..c41c91b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -vendor/* \ No newline at end of file +vendor/* +.idea/* diff --git a/app/Controller/Admin.php b/app/Controller/Admin.php index b045e81..f530479 100755 --- a/app/Controller/Admin.php +++ b/app/Controller/Admin.php @@ -2,8 +2,8 @@ namespace Controller; use Sentry; -use Core\Viewer; -use Core\Response; +use Viewer; +use Response; class Admin { @@ -21,4 +21,4 @@ public function displayAdminPage(){ Viewer::file('/resources/views/admin/home'); } -} \ No newline at end of file +} diff --git a/app/Controller/Auth.php b/app/Controller/Auth.php index b737000..ed87424 100755 --- a/app/Controller/Auth.php +++ b/app/Controller/Auth.php @@ -1,12 +1,12 @@ delete(); }catch(Exception $e) { Response::redirect('admin?delete=failed'); } - + Response::redirect('admin?delete=success'); } -} \ No newline at end of file +} diff --git a/app/Service/Test/TestService.php b/app/Service/Test/TestService.php index 3f9f185..8903519 100644 --- a/app/Service/Test/TestService.php +++ b/app/Service/Test/TestService.php @@ -1,13 +1,15 @@ link('database', Core\Database::connect()); +$app->link('database', Database::connect()); /* |-------------------------------------------------------------------------- @@ -54,29 +60,29 @@ | capabilities. | */ -$app->link('cachemanager', Core\Cache::init()); +$app->link('cachemanager', Cache::init()); /* |-------------------------------------------------------------------------- -| Share the Singleton $app with the Template Files +| Load Services |-------------------------------------------------------------------------- | -| Eliminate complexity, get the job done. +| This is where all of your applications in /app/Service are loaded. | */ -Core\Sharer::share('app', $app); +$service = Service::loadServices(); /* |-------------------------------------------------------------------------- -| Load Services +| Share the Singleton $app and $service |-------------------------------------------------------------------------- | -| This is where all of your applications resides +| Eliminate complexity, get the job done. Our Dependency Injection (DI) is +| here! | */ -$service = Core\Service::loadServices(); - -Core\Sharer::share('service', $service); +Sharer::share('app', $app); +Sharer::share('service', $service); /* |-------------------------------------------------------------------------- @@ -87,8 +93,8 @@ | */ -Core\Router::start(); -Core\Router::dispatch(); +Router::start(); +Router::dispatch(); /* |-------------------------------------------------------------------------- @@ -100,5 +106,5 @@ | */ if(getenv('SHOW_EXECUTION_TIME')){ - Core\Debugger::exec_time(); -} \ No newline at end of file + Debugger::exec_time(); +} diff --git a/config/aliases.php b/config/aliases.php index 4c4f7d5..ba188d5 100755 --- a/config/aliases.php +++ b/config/aliases.php @@ -6,7 +6,11 @@ 'Core\Database' => 'Database', 'Core\Debugger' => 'Debugger', 'Core\Router' => 'Router', + 'Core\Response' => 'Response', 'Core\Sharer' => 'Sharer', 'Core\Viewer' => 'Viewer', + 'Core\Service' => 'Service', + 'Core\Service\ServiceContainer' => 'ServiceContainer', + 'Core\TimeTrackr' => 'TimeTrackr', 'Cartalyst\Sentry\Facades\Native\Sentry' => 'Sentry' -]; \ No newline at end of file +]; diff --git a/config/database.php b/config/database.php index 233936b..e4870b4 100755 --- a/config/database.php +++ b/config/database.php @@ -8,10 +8,10 @@ * @link https://www.studionexus.co/php/damnstupidsimple */ -return +return [ 'enabled' => true, - 'settings' => + 'settings' => [ 'host' => 'localhost', 'driver' => 'mysql', diff --git a/config/timetrackr.php b/config/timetrackr.php new file mode 100644 index 0000000..c228a82 --- /dev/null +++ b/config/timetrackr.php @@ -0,0 +1,6 @@ + 'Asia/Kuala_Lumpur' +]; \ No newline at end of file