Skip to content

Commit

Permalink
Restore phar stream wrapper after attaching to concrete (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlocati authored Sep 30, 2021
1 parent 339e153 commit 04c2424
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Concrete/Adapter/AbstractApplicationEnabledAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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');
}
}
}

/**
Expand Down

0 comments on commit 04c2424

Please sign in to comment.