From 5028631583f1b1393c56408ef063b64029856f54 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 1 Dec 2023 15:20:34 +0000 Subject: [PATCH] Merge pull request #1485 from hydephp/refactor-internal-phar-support Refactor internal configuration loader and remove experimental Phar support https://github.com/hydephp/develop/commit/66aaf69bba88df309359754693fa7511b8b9b951 --- src/Foundation/Internal/LoadConfiguration.php | 25 +------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/Foundation/Internal/LoadConfiguration.php b/src/Foundation/Internal/LoadConfiguration.php index 10bf1418..db1b31e4 100644 --- a/src/Foundation/Internal/LoadConfiguration.php +++ b/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()) {