From 04c2424f24bb84d04a4c56296719e26475fceaac Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Thu, 30 Sep 2021 17:16:25 +0200 Subject: [PATCH] Restore phar stream wrapper after attaching to concrete (#34) --- .../Adapter/AbstractApplicationEnabledAdapter.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Concrete/Adapter/AbstractApplicationEnabledAdapter.php b/src/Concrete/Adapter/AbstractApplicationEnabledAdapter.php index 4fdd32d..8427aba 100644 --- a/src/Concrete/Adapter/AbstractApplicationEnabledAdapter.php +++ b/src/Concrete/Adapter/AbstractApplicationEnabledAdapter.php @@ -8,6 +8,7 @@ use Concrete\Console\Concrete\Connection\ConnectionInterface; use Concrete\Console\Util\Installation; use Concrete\Core\Application\Application; +use Phar; abstract class AbstractApplicationEnabledAdapter implements AdapterInterface { @@ -87,7 +88,13 @@ protected function registerAutoload(string $path, string $core): void */ protected function getApplicationInstance(string $path, string $core): Application { - return require $core . '/bootstrap/start.php'; + try { + return require $core . '/bootstrap/start.php'; + } finally { + if (Phar::running() !== '' && !in_array('phar', stream_get_wrappers(), true)) { + stream_wrapper_restore('phar'); + } + } } /**