Skip to content

Commit

Permalink
Merge pull request ezsystems#33 from emodric/fix_assets_install
Browse files Browse the repository at this point in the history
Fix restoring working directory when building legacy CLI kernel handler
  • Loading branch information
andrerom committed Aug 31, 2015
2 parents 5e467e5 + 783f93a commit 0852275
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mvc/Kernel/Loader.php
Expand Up @@ -206,15 +206,15 @@ public function getWebHandler()
public function buildLegacyKernelHandlerCLI()
{
$legacyRootDir = $this->legacyRootDir;
$webrootDir = $this->webrootDir;
$eventDispatcher = $this->eventDispatcher;
$container = $this->container;
$that = $this;

return function () use ( $legacyRootDir, $webrootDir, $container, $eventDispatcher, $that )
return function () use ( $legacyRootDir, $container, $eventDispatcher, $that )
{
if ( !$that->getCLIHandler() )
{
$currentDir = getcwd();
chdir( $legacyRootDir );

$legacyParameters = new ParameterBag( $container->getParameter( 'ezpublish_legacy.kernel_handler.cli.options' ) );
Expand All @@ -226,7 +226,8 @@ public function buildLegacyKernelHandlerCLI()
$that->setCLIHandler(
new CLIHandler( $legacyParameters->all(), $container->get( 'ezpublish.siteaccess' ), $container )
);
chdir( $webrootDir );

chdir( $currentDir );
}

return $that->getCLIHandler();
Expand Down

0 comments on commit 0852275

Please sign in to comment.