Skip to content

Commit

Permalink
Allow to configure process factory
Browse files Browse the repository at this point in the history
  • Loading branch information
AydinHassan committed May 17, 2024
1 parent 98507c0 commit 65049c5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
use PhpSchool\PhpWorkshop\Output\OutputInterface;
use PhpSchool\PhpWorkshop\Output\StdOutput;
use PhpSchool\PhpWorkshop\Patch;
use PhpSchool\PhpWorkshop\Process\DockerProcessFactory;
use PhpSchool\PhpWorkshop\Process\HostProcessFactory;
use PhpSchool\PhpWorkshop\Process\ProcessFactory;
use PhpSchool\PhpWorkshop\Result\Cgi\CgiResult;
Expand Down Expand Up @@ -208,7 +209,16 @@
},

ProcessFactory::class => function (ContainerInterface $c) {
return new HostProcessFactory();
$processFactory = $_ENV['process_factory'] ?? null;

return match ($processFactory) {
'docker' => new DockerProcessFactory(
$c->get('basePath'),
$c->get('appName'),
$c->get('phpschoolGlobalDir') . '/composer-cache',
),
default => new HostProcessFactory(),
};
},

//commands
Expand Down

0 comments on commit 65049c5

Please sign in to comment.