Skip to content

Commit

Permalink
TASK: Use other directory in phar context
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbelasichon committed Apr 4, 2023
1 parent 63072a1 commit 1bf06d5
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/Cli/Symfony/ConsoleKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace TYPO3\Surf\Cli\Symfony;

use Phar;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Config\Loader\LoaderInterface;
Expand Down Expand Up @@ -67,8 +68,21 @@ protected function build(ContainerBuilder $container): void
);
}

public function getProjectDir(): string
public function getCacheDir(): string
{
return \dirname(__DIR__, 3);
if(Phar::running() !== '') {
return sys_get_temp_dir() . '/_surf';
}

return parent::getCacheDir();
}

public function getLogDir(): string
{
if(Phar::running() !== '') {
return sys_get_temp_dir() . '/_surf_log';
}

return parent::getLogDir();
}
}

0 comments on commit 1bf06d5

Please sign in to comment.