From 4393922441ba3fc2ab37b48c66844000a21ea4ac Mon Sep 17 00:00:00 2001 From: Aaron Collegeman Date: Mon, 27 Mar 2017 10:46:19 -0400 Subject: [PATCH 01/10] Update helpers.php --- src/Illuminate/Foundation/helpers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php index 84ebf2d781e6..6b6ebf5b79b0 100644 --- a/src/Illuminate/Foundation/helpers.php +++ b/src/Illuminate/Foundation/helpers.php @@ -346,7 +346,7 @@ function csrf_token() */ function database_path($path = '') { - return app()->databasePath().($path ? DIRECTORY_SEPARATOR.$path : $path); + return app()->databasePath($path); } } From 7393593975bc7e9a5ca7e61fcf9e959b1111036b Mon Sep 17 00:00:00 2001 From: Aaron Collegeman Date: Mon, 27 Mar 2017 10:47:43 -0400 Subject: [PATCH 02/10] Update Application.php --- src/Illuminate/Foundation/Application.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index 08843b1e7c13..cc264699a051 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -334,11 +334,13 @@ public function configPath() /** * Get the path to the database directory. * + * @param string $path * @return string */ - public function databasePath() + public function databasePath($path = '') { - return $this->databasePath ?: $this->basePath.DIRECTORY_SEPARATOR.'database'; + $basePath = $this->databasePath ?: $this->basePath.DIRECTORY_SEPARATOR.'database'; + return $basePath.($path ? DIRECTORY_SEPARATOR.$path : $path); } /** From ab1754f120cee9a5440e73a4bb165cf29853a5ab Mon Sep 17 00:00:00 2001 From: Aaron Collegeman Date: Mon, 27 Mar 2017 10:48:20 -0400 Subject: [PATCH 03/10] Update DatabaseServiceProvider.php --- src/Illuminate/Database/DatabaseServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Database/DatabaseServiceProvider.php b/src/Illuminate/Database/DatabaseServiceProvider.php index ea78a59d178d..a8ee7b030b78 100755 --- a/src/Illuminate/Database/DatabaseServiceProvider.php +++ b/src/Illuminate/Database/DatabaseServiceProvider.php @@ -80,7 +80,7 @@ protected function registerEloquentFactory() $this->app->singleton(EloquentFactory::class, function ($app) { return EloquentFactory::construct( - $app->make(FakerGenerator::class), database_path('factories') + $app->make(FakerGenerator::class), $this->app->databasePath('factories') ); }); } From 0e858291af223f874b69663ce32109b6a9940d75 Mon Sep 17 00:00:00 2001 From: Aaron Collegeman Date: Mon, 27 Mar 2017 10:49:09 -0400 Subject: [PATCH 04/10] Update PaginationServiceProvider.php --- src/Illuminate/Pagination/PaginationServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Pagination/PaginationServiceProvider.php b/src/Illuminate/Pagination/PaginationServiceProvider.php index 3751507eb2a0..d5ca6daec800 100755 --- a/src/Illuminate/Pagination/PaginationServiceProvider.php +++ b/src/Illuminate/Pagination/PaginationServiceProvider.php @@ -17,7 +17,7 @@ public function boot() if ($this->app->runningInConsole()) { $this->publishes([ - __DIR__.'/resources/views' => resource_path('views/vendor/pagination'), + __DIR__.'/resources/views' => $this->app->resourcePath('views/vendor/pagination'), ], 'laravel-pagination'); } } From d26ac1579bc50fbf2f1deea225d697ac6292990d Mon Sep 17 00:00:00 2001 From: Aaron Collegeman Date: Mon, 27 Mar 2017 10:53:00 -0400 Subject: [PATCH 05/10] Update NotificationServiceProvider.php --- src/Illuminate/Notifications/NotificationServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Notifications/NotificationServiceProvider.php b/src/Illuminate/Notifications/NotificationServiceProvider.php index ba1fb2c3ad4c..e8909f4551e0 100644 --- a/src/Illuminate/Notifications/NotificationServiceProvider.php +++ b/src/Illuminate/Notifications/NotificationServiceProvider.php @@ -19,7 +19,7 @@ public function boot() if ($this->app->runningInConsole()) { $this->publishes([ - __DIR__.'/resources/views' => resource_path('views/vendor/notifications'), + __DIR__.'/resources/views' => $this->app->resourcePath('views/vendor/notifications'), ], 'laravel-notifications'); } } From 3bc0321b324fb48f98d7abe439d6581dd37fc9da Mon Sep 17 00:00:00 2001 From: Aaron Collegeman Date: Mon, 27 Mar 2017 10:56:57 -0400 Subject: [PATCH 06/10] Update Application.php --- src/Illuminate/Foundation/Application.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index cc264699a051..e37d16ba11ce 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -339,8 +339,8 @@ public function configPath() */ public function databasePath($path = '') { - $basePath = $this->databasePath ?: $this->basePath.DIRECTORY_SEPARATOR.'database'; - return $basePath.($path ? DIRECTORY_SEPARATOR.$path : $path); + $databasePath = $this->databasePath ?: $this->basePath.DIRECTORY_SEPARATOR.'database'; + return $databasePath.($path ? DIRECTORY_SEPARATOR.$path : $path); } /** From b1c5e4cc3cef0667dadd98771f4f618fa0b1d3cf Mon Sep 17 00:00:00 2001 From: Aaron Collegeman Date: Mon, 27 Mar 2017 11:55:22 -0400 Subject: [PATCH 07/10] Update Application.php --- src/Illuminate/Foundation/Application.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index e37d16ba11ce..e7e349604fb8 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -294,41 +294,45 @@ protected function bindPathsInContainer() /** * Get the path to the application "app" directory. * + * @param string $path * @return string */ - public function path() + public function path($path = '') { - return $this->basePath.DIRECTORY_SEPARATOR.'app'; + return $this->basePath.DIRECTORY_SEPARATOR.'app'.($path ? DIRECTORY_SEPARATOR.$path : $path); } /** * Get the base path of the Laravel installation. * + * @param string $path * @return string */ - public function basePath() + public function basePath($path = '') { - return $this->basePath; + return $this->basePath.($path ? DIRECTORY_SEPARATOR.$path : $path); } /** * Get the path to the bootstrap directory. * + * @param string $path * @return string */ - public function bootstrapPath() + public function bootstrapPath($path = '') { - return $this->basePath.DIRECTORY_SEPARATOR.'bootstrap'; + return $this->basePath.DIRECTORY_SEPARATOR.'bootstrap'.($path ? DIRECTORY_SEPARATOR.$path : $path); } /** * Get the path to the application configuration files. * + * @param string $path * @return string */ - public function configPath() + public function configPath($path = '') { - return $this->basePath.DIRECTORY_SEPARATOR.'config'; + return $this->basePath.DIRECTORY_SEPARATOR.'config'.($path ? DIRECTORY_SEPARATOR.$path : $path); } /** From bf88921a7838e2d09a4ab318c23c07e6d84e655f Mon Sep 17 00:00:00 2001 From: Aaron Collegeman Date: Mon, 27 Mar 2017 11:57:24 -0400 Subject: [PATCH 08/10] Update Application.php --- src/Illuminate/Foundation/Application.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index e7e349604fb8..e8fd8d5f8eb2 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -344,6 +344,7 @@ public function configPath($path = '') public function databasePath($path = '') { $databasePath = $this->databasePath ?: $this->basePath.DIRECTORY_SEPARATOR.'database'; + return $databasePath.($path ? DIRECTORY_SEPARATOR.$path : $path); } From 3935dd98d0ea1cd55b37cd6fec6f5af621fdeaa4 Mon Sep 17 00:00:00 2001 From: Aaron Collegeman Date: Mon, 27 Mar 2017 11:59:25 -0400 Subject: [PATCH 09/10] Update Application.php --- src/Illuminate/Foundation/Application.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index e8fd8d5f8eb2..dab051b42635 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -294,7 +294,7 @@ protected function bindPathsInContainer() /** * Get the path to the application "app" directory. * - * @param string $path + * @param string $path Optionally, a path to append to the app path * @return string */ public function path($path = '') @@ -305,7 +305,7 @@ public function path($path = '') /** * Get the base path of the Laravel installation. * - * @param string $path + * @param string $path Optionally, a path to append to the base path * @return string */ public function basePath($path = '') @@ -316,7 +316,7 @@ public function basePath($path = '') /** * Get the path to the bootstrap directory. * - * @param string $path + * @param string $path Optionally, a path to append to the bootstrap path * @return string */ public function bootstrapPath($path = '') @@ -327,7 +327,7 @@ public function bootstrapPath($path = '') /** * Get the path to the application configuration files. * - * @param string $path + * @param string $path Optionally, a path to append to the config path * @return string */ public function configPath($path = '') @@ -338,7 +338,7 @@ public function configPath($path = '') /** * Get the path to the database directory. * - * @param string $path + * @param string $path Optionally, a path to append to the database path * @return string */ public function databasePath($path = '') From 529c0fe7943e5e77413104808cb386a5924b91eb Mon Sep 17 00:00:00 2001 From: Aaron Collegeman Date: Mon, 27 Mar 2017 12:01:11 -0400 Subject: [PATCH 10/10] Update Application.php This is not normally how I would code such an expression, but StyleCI is failing me on leading whitespace that I can't seem to kill. --- src/Illuminate/Foundation/Application.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index dab051b42635..4f514af5f51a 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -343,9 +343,7 @@ public function configPath($path = '') */ public function databasePath($path = '') { - $databasePath = $this->databasePath ?: $this->basePath.DIRECTORY_SEPARATOR.'database'; - - return $databasePath.($path ? DIRECTORY_SEPARATOR.$path : $path); + return ($this->databasePath ?: $this->basePath.DIRECTORY_SEPARATOR.'database').($path ? DIRECTORY_SEPARATOR.$path : $path); } /**