From 84ca235f51ee1335f0b8420d979534c5c5e88e2b Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 31 Jan 2023 10:43:47 +0100 Subject: [PATCH 1/5] Move the storage directory into the app directory This directory only used by the internal underlying Laravel application, and there is really no reason for a user to interact with it, so there's no point in having it clog up the root structure. Instead it makes more sense to have it in the app directory that already houses files for the Laravel app. --- {storage => app/storage}/app/.gitignore | 0 {storage => app/storage}/framework/cache/.gitignore | 0 {storage => app/storage}/framework/cache/data/.gitignore | 0 {storage => app/storage}/framework/views/.gitignore | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename {storage => app/storage}/app/.gitignore (100%) rename {storage => app/storage}/framework/cache/.gitignore (100%) rename {storage => app/storage}/framework/cache/data/.gitignore (100%) rename {storage => app/storage}/framework/views/.gitignore (100%) diff --git a/storage/app/.gitignore b/app/storage/app/.gitignore similarity index 100% rename from storage/app/.gitignore rename to app/storage/app/.gitignore diff --git a/storage/framework/cache/.gitignore b/app/storage/framework/cache/.gitignore similarity index 100% rename from storage/framework/cache/.gitignore rename to app/storage/framework/cache/.gitignore diff --git a/storage/framework/cache/data/.gitignore b/app/storage/framework/cache/data/.gitignore similarity index 100% rename from storage/framework/cache/data/.gitignore rename to app/storage/framework/cache/data/.gitignore diff --git a/storage/framework/views/.gitignore b/app/storage/framework/views/.gitignore similarity index 100% rename from storage/framework/views/.gitignore rename to app/storage/framework/views/.gitignore From 0de832a2f31964dfb5ec9973ee3001f4fd92e2f4 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 31 Jan 2023 10:49:37 +0100 Subject: [PATCH 2/5] Register custom storage path --- packages/framework/src/Foundation/Application.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/framework/src/Foundation/Application.php b/packages/framework/src/Foundation/Application.php index 005364ce127..b7bb99ab4cc 100644 --- a/packages/framework/src/Foundation/Application.php +++ b/packages/framework/src/Foundation/Application.php @@ -9,6 +9,8 @@ */ class Application extends \LaravelZero\Framework\Application { + protected $storagePath = 'app/storage'; + /** * {@inheritdoc} */ From ba78c776ffa1f96959e79a882cea7a3643e499b1 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 31 Jan 2023 10:47:05 +0100 Subject: [PATCH 3/5] Update cached packages path --- .../framework/src/Console/Commands/PackageDiscoverCommand.php | 2 +- packages/framework/src/Foundation/Application.php | 2 +- .../tests/Feature/Commands/PackageDiscoverCommandTest.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/framework/src/Console/Commands/PackageDiscoverCommand.php b/packages/framework/src/Console/Commands/PackageDiscoverCommand.php index 800373fb217..4d51a058344 100644 --- a/packages/framework/src/Console/Commands/PackageDiscoverCommand.php +++ b/packages/framework/src/Console/Commands/PackageDiscoverCommand.php @@ -18,7 +18,7 @@ class PackageDiscoverCommand extends BaseCommand public function handle(PackageManifest $manifest): void { - $manifest->manifestPath = Hyde::path('storage/framework/cache/packages.php'); + $manifest->manifestPath = Hyde::path('app/storage/framework/cache/packages.php'); parent::handle($manifest); } } diff --git a/packages/framework/src/Foundation/Application.php b/packages/framework/src/Foundation/Application.php index b7bb99ab4cc..bc68a103020 100644 --- a/packages/framework/src/Foundation/Application.php +++ b/packages/framework/src/Foundation/Application.php @@ -27,6 +27,6 @@ protected function registerBaseBindings(): void public function getCachedPackagesPath(): string { // Since we have a custom path for the cache directory, we need to return it here. - return 'storage/framework/cache/packages.php'; + return 'app/storage/framework/cache/packages.php'; } } diff --git a/packages/framework/tests/Feature/Commands/PackageDiscoverCommandTest.php b/packages/framework/tests/Feature/Commands/PackageDiscoverCommandTest.php index 033b43c65d1..7a3d1995f21 100644 --- a/packages/framework/tests/Feature/Commands/PackageDiscoverCommandTest.php +++ b/packages/framework/tests/Feature/Commands/PackageDiscoverCommandTest.php @@ -21,8 +21,8 @@ public function test_package_discover_command_can_run() public function test_package_discover_command_registers_manifest_path() { $this->artisan('package:discover')->assertExitCode(0); - $this->assertEquals(Hyde::path('storage/framework/cache/packages.php'), + $this->assertEquals(Hyde::path('app/storage/framework/cache/packages.php'), $this->app->make(PackageManifest::class)->manifestPath); - $this->assertFileExists(Hyde::path('storage/framework/cache/packages.php')); + $this->assertFileExists(Hyde::path('app/storage/framework/cache/packages.php')); } } From 5b30d5605a6c7c87453ea06ca2d5952190b60a0c Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 31 Jan 2023 11:11:54 +0100 Subject: [PATCH 4/5] Update build manifest path --- .../BuildTasks/PostBuildTasks/GenerateBuildManifest.php | 2 +- packages/framework/tests/Unit/GenerateBuildManifestTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/framework/src/Framework/Features/BuildTasks/PostBuildTasks/GenerateBuildManifest.php b/packages/framework/src/Framework/Features/BuildTasks/PostBuildTasks/GenerateBuildManifest.php index fa648d6e901..e6f155e50fc 100644 --- a/packages/framework/src/Framework/Features/BuildTasks/PostBuildTasks/GenerateBuildManifest.php +++ b/packages/framework/src/Framework/Features/BuildTasks/PostBuildTasks/GenerateBuildManifest.php @@ -57,7 +57,7 @@ protected function getManifestPath(): string { return Hyde::path(config( 'hyde.build_manifest_path', - 'storage/framework/cache/build-manifest.json' + 'app/storage/framework/cache/build-manifest.json' )); } diff --git a/packages/framework/tests/Unit/GenerateBuildManifestTest.php b/packages/framework/tests/Unit/GenerateBuildManifestTest.php index ff45cb5cf93..f3fbe223e4e 100644 --- a/packages/framework/tests/Unit/GenerateBuildManifestTest.php +++ b/packages/framework/tests/Unit/GenerateBuildManifestTest.php @@ -18,9 +18,9 @@ public function test_action_generates_build_manifest() { (new GenerateBuildManifest())->run(); - $this->assertFileExists(Hyde::path('storage/framework/cache/build-manifest.json')); + $this->assertFileExists(Hyde::path('app/storage/framework/cache/build-manifest.json')); - $manifest = json_decode(file_get_contents(Hyde::path('storage/framework/cache/build-manifest.json')), true); + $manifest = json_decode(file_get_contents(Hyde::path('app/storage/framework/cache/build-manifest.json')), true); $this->assertIsArray($manifest); From d547ae6d76e11d63b5ff99077047420a231717b6 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 31 Jan 2023 10:44:35 +0100 Subject: [PATCH 5/5] Update develop.iml for new storage directory location --- .idea/develop.iml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.idea/develop.iml b/.idea/develop.iml index 6f31f397a44..f79d793af9f 100644 --- a/.idea/develop.iml +++ b/.idea/develop.iml @@ -10,8 +10,6 @@ - - @@ -25,6 +23,8 @@ + +