diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 7309c20bf19..ead8bb0b1ba 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -29,3 +29,8 @@ This serves two purposes: ### Security - in case of vulnerabilities. + +### Internal + +- Internal: Only inject custom app config location when missing from parent in https://github.com/hydephp/develop/pull/1485 +- Internal: Remove experimental Phar support from internal configuration loader in https://github.com/hydephp/develop/pull/1485 diff --git a/packages/framework/src/Foundation/Internal/LoadConfiguration.php b/packages/framework/src/Foundation/Internal/LoadConfiguration.php index 10bf1418286..db1b31e4090 100644 --- a/packages/framework/src/Foundation/Internal/LoadConfiguration.php +++ b/packages/framework/src/Foundation/Internal/LoadConfiguration.php @@ -4,16 +4,13 @@ namespace Hyde\Foundation\Internal; -use Phar; use Illuminate\Contracts\Foundation\Application; use Illuminate\Contracts\Config\Repository; use Illuminate\Foundation\Bootstrap\LoadConfiguration as BaseLoadConfiguration; use function getenv; use function array_merge; -use function dirname; use function in_array; -use function is_dir; use function tap; /** @internal */ @@ -24,9 +21,7 @@ protected function getConfigurationFiles(Application $app): array { return (array) tap(parent::getConfigurationFiles($app), function (array &$files) use ($app): void { // Inject our custom config file which is stored in `app/config.php`. - $files['app'] = $app->basePath().DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'config.php'; - - $this->providePharSupportIfNeeded($files); + $files['app'] ??= $app->basePath().DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'config.php'; }); } @@ -61,24 +56,6 @@ private function mergeConfigurationFile(Repository $repository, string $file): v )); } - /** - * Provide support for running Hyde in a Phar archive. - * - * @experimental - * - * @codeCoverageIgnore - */ - private static function providePharSupportIfNeeded(array &$files): void - { - // If we're running in a Phar and no project config directory exists, - // we need to adjust the path to use the bundled static Phar config file. - - /** @var array{app: string} $files */ - if (Phar::running() && (! is_dir($files['app']))) { - $files['app'] = dirname(__DIR__, 6).DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php'; - } - } - private function loadRuntimeConfiguration(Application $app, Repository $repository): void { if ($app->runningInConsole()) {