From d2acaa24c2e1fef938a8c326907155695c43a9b0 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sun, 1 Jun 2014 13:16:51 -0500 Subject: [PATCH 01/10] Point at 4.3. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 158d9114..365d4442 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "keywords": ["framework", "laravel"], "license": "MIT", "require": { - "laravel/framework": "4.2.*" + "laravel/framework": "4.3.*" }, "autoload": { "classmap": [ From e5fe0aff573bbfea42d8b4b0ad2c71b5aa0087ee Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 23 Jun 2014 21:22:55 -0500 Subject: [PATCH 02/10] Move the environment settings into their own file. --- bootstrap/environment.php | 18 ++++++++++++++++++ bootstrap/start.php | 6 +----- 2 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 bootstrap/environment.php diff --git a/bootstrap/environment.php b/bootstrap/environment.php new file mode 100644 index 00000000..f133a3d9 --- /dev/null +++ b/bootstrap/environment.php @@ -0,0 +1,18 @@ +detectEnvironment([ + + 'local' => ['homestead'], + +]); diff --git a/bootstrap/start.php b/bootstrap/start.php index 84559be3..949f2e5f 100644 --- a/bootstrap/start.php +++ b/bootstrap/start.php @@ -24,11 +24,7 @@ | */ -$env = $app->detectEnvironment(array( - - 'local' => array('homestead'), - -)); +require __DIR__.'/environment.php'; /* |-------------------------------------------------------------------------- From 5b82dfb0ed840452fed5d900922ee686946c4120 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 18 Jul 2014 14:32:47 -0500 Subject: [PATCH 03/10] Working on compile config file. --- app/config/compile.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/config/compile.php b/app/config/compile.php index d5e55181..7f6d7b5f 100644 --- a/app/config/compile.php +++ b/app/config/compile.php @@ -13,6 +13,23 @@ | */ + 'files' => array( + // + ), + /* + |-------------------------------------------------------------------------- + | Compiled File Providers + |-------------------------------------------------------------------------- + | + | Here you may list service providers which define a "compiles" function + | that returns additional files that should be compiled, providing an + | easy way to get common files from any packages you are utilizing. + | + */ + + 'providers' => array( + // + ), ); From b20409fa53bb78251a507b4e6e2fdd87ab062c85 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sat, 26 Jul 2014 22:00:01 -0500 Subject: [PATCH 04/10] Move storage out of app directory. --- app/database/production.sqlite | 0 bootstrap/paths.php | 2 +- {app/storage => storage}/.gitignore | 0 {app/storage => storage}/cache/.gitignore | 0 {app/storage => storage}/logs/.gitignore | 0 {app/storage => storage}/meta/.gitignore | 0 {app/storage => storage}/sessions/.gitignore | 0 {app/storage => storage}/views/.gitignore | 0 8 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 app/database/production.sqlite rename {app/storage => storage}/.gitignore (100%) rename {app/storage => storage}/cache/.gitignore (100%) rename {app/storage => storage}/logs/.gitignore (100%) rename {app/storage => storage}/meta/.gitignore (100%) rename {app/storage => storage}/sessions/.gitignore (100%) rename {app/storage => storage}/views/.gitignore (100%) diff --git a/app/database/production.sqlite b/app/database/production.sqlite deleted file mode 100644 index e69de29b..00000000 diff --git a/bootstrap/paths.php b/bootstrap/paths.php index 5a1f640b..27889875 100644 --- a/bootstrap/paths.php +++ b/bootstrap/paths.php @@ -52,6 +52,6 @@ | */ - 'storage' => __DIR__.'/../app/storage', + 'storage' => __DIR__.'/../storage', ); diff --git a/app/storage/.gitignore b/storage/.gitignore similarity index 100% rename from app/storage/.gitignore rename to storage/.gitignore diff --git a/app/storage/cache/.gitignore b/storage/cache/.gitignore similarity index 100% rename from app/storage/cache/.gitignore rename to storage/cache/.gitignore diff --git a/app/storage/logs/.gitignore b/storage/logs/.gitignore similarity index 100% rename from app/storage/logs/.gitignore rename to storage/logs/.gitignore diff --git a/app/storage/meta/.gitignore b/storage/meta/.gitignore similarity index 100% rename from app/storage/meta/.gitignore rename to storage/meta/.gitignore diff --git a/app/storage/sessions/.gitignore b/storage/sessions/.gitignore similarity index 100% rename from app/storage/sessions/.gitignore rename to storage/sessions/.gitignore diff --git a/app/storage/views/.gitignore b/storage/views/.gitignore similarity index 100% rename from app/storage/views/.gitignore rename to storage/views/.gitignore From a8a0996faaab673c1ac9b6d375619298efb026af Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sat, 26 Jul 2014 22:00:51 -0500 Subject: [PATCH 05/10] Tweak default SQLite database. --- app/config/database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/database.php b/app/config/database.php index 3498fa81..552367c4 100644 --- a/app/config/database.php +++ b/app/config/database.php @@ -48,7 +48,7 @@ 'sqlite' => array( 'driver' => 'sqlite', - 'database' => __DIR__.'/../database/production.sqlite', + 'database' => storage_path().'/database.sqlite', 'prefix' => '', ), From 812532c68826eb3ea7863e8829e841c69f20707a Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sun, 27 Jul 2014 14:10:37 -0500 Subject: [PATCH 06/10] Rename commands directory. --- app/{commands => console}/.gitkeep | 0 app/start/global.php | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename app/{commands => console}/.gitkeep (100%) diff --git a/app/commands/.gitkeep b/app/console/.gitkeep similarity index 100% rename from app/commands/.gitkeep rename to app/console/.gitkeep diff --git a/app/start/global.php b/app/start/global.php index 82ab9ba4..c12f33e5 100644 --- a/app/start/global.php +++ b/app/start/global.php @@ -13,7 +13,7 @@ ClassLoader::addDirectories(array( - app_path().'/commands', + app_path().'/console', app_path().'/controllers', app_path().'/models', app_path().'/database/seeds', From a5001352e645bbcb65be2be7b11371142c683918 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 29 Jul 2014 23:52:16 -0500 Subject: [PATCH 07/10] Fix autoload map. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 365d4442..72e77469 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ }, "autoload": { "classmap": [ - "app/commands", + "app/console", "app/controllers", "app/models", "app/database/migrations", From 0e0fd73b435d22aebb2efd2c42bf9df23d197b99 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 31 Jul 2014 15:13:50 -0500 Subject: [PATCH 08/10] Working on overall app structure. --- app/{console => commands}/.gitkeep | 0 app/commands/InspireCommand.php | 43 +++++++++++ app/config/app.php | 5 ++ app/{ => routing}/filters.php | 5 +- app/{ => routing}/routes.php | 13 ++++ app/src/Providers/AppServiceProvider.php | 27 +++++++ app/src/Providers/ArtisanServiceProvider.php | 45 +++++++++++ app/src/Providers/ErrorServiceProvider.php | 46 +++++++++++ app/src/Providers/LogServiceProvider.php | 41 ++++++++++ app/{models => src}/User.php | 0 app/start/artisan.php | 13 ---- app/start/global.php | 81 -------------------- app/start/local.php | 3 - bootstrap/autoload.php | 13 ---- composer.json | 4 +- 15 files changed, 226 insertions(+), 113 deletions(-) rename app/{console => commands}/.gitkeep (100%) create mode 100644 app/commands/InspireCommand.php rename app/{ => routing}/filters.php (96%) rename app/{ => routing}/routes.php (51%) create mode 100644 app/src/Providers/AppServiceProvider.php create mode 100644 app/src/Providers/ArtisanServiceProvider.php create mode 100644 app/src/Providers/ErrorServiceProvider.php create mode 100644 app/src/Providers/LogServiceProvider.php rename app/{models => src}/User.php (100%) delete mode 100644 app/start/artisan.php delete mode 100644 app/start/global.php delete mode 100644 app/start/local.php diff --git a/app/console/.gitkeep b/app/commands/.gitkeep similarity index 100% rename from app/console/.gitkeep rename to app/commands/.gitkeep diff --git a/app/commands/InspireCommand.php b/app/commands/InspireCommand.php new file mode 100644 index 00000000..4cbd600a --- /dev/null +++ b/app/commands/InspireCommand.php @@ -0,0 +1,43 @@ +comment('Inspiring Quote Here.'); + } + +} diff --git a/app/config/app.php b/app/config/app.php index 27665c60..4e518901 100644 --- a/app/config/app.php +++ b/app/config/app.php @@ -95,6 +95,11 @@ 'providers' => array( + 'AppServiceProvider', + 'ArtisanServiceProvider', + 'ErrorServiceProvider', + 'LogServiceProvider', + 'Illuminate\Foundation\Providers\ArtisanServiceProvider', 'Illuminate\Auth\AuthServiceProvider', 'Illuminate\Cache\CacheServiceProvider', diff --git a/app/filters.php b/app/routing/filters.php similarity index 96% rename from app/filters.php rename to app/routing/filters.php index fd0b4bcb..908b99ed 100644 --- a/app/filters.php +++ b/app/routing/filters.php @@ -13,7 +13,10 @@ App::before(function($request) { - // + if (App::isDownForMaintenance()) + { + return Response::make('Be right back!'); + } }); diff --git a/app/routes.php b/app/routing/routes.php similarity index 51% rename from app/routes.php rename to app/routing/routes.php index 3e10dcf5..e2591227 100644 --- a/app/routes.php +++ b/app/routing/routes.php @@ -1,5 +1,18 @@ registerInspireCommand(); + + $this->commands('commands.inspire'); + } + + /** + * Register the Inspire Artisan command. + * + * @return void + */ + protected function registerInspireCommand() + { + // Each available Artisan command must be registered with the console so + // that it is available to be called. We'll register every command so + // the console gets access to each of the command object instances. + $this->app->bindShared('commands.inspire', function() + { + return new InspireCommand; + }); + } + +} \ No newline at end of file diff --git a/app/src/Providers/ErrorServiceProvider.php b/app/src/Providers/ErrorServiceProvider.php new file mode 100644 index 00000000..af5464e4 --- /dev/null +++ b/app/src/Providers/ErrorServiceProvider.php @@ -0,0 +1,46 @@ +setupErrorHandlers(); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + // + } + + /** + * Setup the error handlers for the application. + * + * @return void + */ + protected function setupErrorHandlers() + { + // Here you may handle any errors that occur in your application, including + // logging them or displaying custom views for specific errors. You may + // even register several error handlers to handle different types of + // exceptions. If nothing is returned, the default error view is + // shown, which includes a detailed stack trace during debug. + + $this->app->error(function(Exception $exception, $code) + { + Log::error($exception); + }); + } + +} \ No newline at end of file diff --git a/app/src/Providers/LogServiceProvider.php b/app/src/Providers/LogServiceProvider.php new file mode 100644 index 00000000..3a0666a3 --- /dev/null +++ b/app/src/Providers/LogServiceProvider.php @@ -0,0 +1,41 @@ +setupLogging(); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + // + } + + /** + * Setup the logging facilities for the application. + * + * @return void + */ + protected function setupLogging() + { + // Here we will configure the error logger setup for the application which + // is built on top of the wonderful Monolog library. By default we will + // build a basic log file setup which creates a single file for logs. + + Log::useFiles(storage_path().'/logs/laravel.log'); + } + +} \ No newline at end of file diff --git a/app/models/User.php b/app/src/User.php similarity index 100% rename from app/models/User.php rename to app/src/User.php diff --git a/app/start/artisan.php b/app/start/artisan.php deleted file mode 100644 index 1df850bc..00000000 --- a/app/start/artisan.php +++ /dev/null @@ -1,13 +0,0 @@ - Date: Thu, 31 Jul 2014 22:59:25 -0500 Subject: [PATCH 09/10] Continuing to work on structure. --- app/config/app.php | 6 ++++++ app/src/Providers/AppServiceProvider.php | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/app/config/app.php b/app/config/app.php index 4e518901..eae5124c 100644 --- a/app/config/app.php +++ b/app/config/app.php @@ -95,11 +95,17 @@ 'providers' => array( + /* + * Application Service Providers... + */ 'AppServiceProvider', 'ArtisanServiceProvider', 'ErrorServiceProvider', 'LogServiceProvider', + /* + * Laravel Framework Service Providers... + */ 'Illuminate\Foundation\Providers\ArtisanServiceProvider', 'Illuminate\Auth\AuthServiceProvider', 'Illuminate\Cache\CacheServiceProvider', diff --git a/app/src/Providers/AppServiceProvider.php b/app/src/Providers/AppServiceProvider.php index 608c50ad..8a943c95 100644 --- a/app/src/Providers/AppServiceProvider.php +++ b/app/src/Providers/AppServiceProvider.php @@ -21,6 +21,10 @@ public function boot() */ public function register() { + // This service provider is a convenient place to register your services + // in the IoC container. If you wish, you may make additional methods + // or service providers to keep the code more focused and granular. + // } From c58286aa250d6fe0e347ddb1800f96e62e24de08 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 31 Jul 2014 23:41:39 -0500 Subject: [PATCH 10/10] Remove class loader from aliases. --- app/config/app.php | 1 - bootstrap/autoload.php | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/app/config/app.php b/app/config/app.php index eae5124c..cc1bdace 100644 --- a/app/config/app.php +++ b/app/config/app.php @@ -166,7 +166,6 @@ 'Auth' => 'Illuminate\Support\Facades\Auth', 'Blade' => 'Illuminate\Support\Facades\Blade', 'Cache' => 'Illuminate\Support\Facades\Cache', - 'ClassLoader' => 'Illuminate\Support\ClassLoader', 'Config' => 'Illuminate\Support\Facades\Config', 'Controller' => 'Illuminate\Routing\Controller', 'Cookie' => 'Illuminate\Support\Facades\Cookie', diff --git a/bootstrap/autoload.php b/bootstrap/autoload.php index 626612a2..44c7dfa9 100644 --- a/bootstrap/autoload.php +++ b/bootstrap/autoload.php @@ -32,19 +32,6 @@ require $compiled; } -/* -|-------------------------------------------------------------------------- -| Register The Laravel Auto Loader -|-------------------------------------------------------------------------- -| -| We register an auto-loader "behind" the Composer loader that can load -| model classes on the fly, even if the autoload files have not been -| regenerated for the application. We'll add it to the stack here. -| -*/ - -Illuminate\Support\ClassLoader::register(); - /* |-------------------------------------------------------------------------- | Register The Workbench Loaders