Skip to content

Commit

Permalink
Adjust WorkerPool bootstrap setup for Docker
Browse files Browse the repository at this point in the history
The WorkerPool bootstrap setup has been modified to accommodate a Docker environment. Now, the script uses 'docker/preload.php' as the bootstrap in Docker environment, and falls back to 'vendor/autoload.php' if the Docker file does not exist. This adjustment helps to maintain a flexible setup that can suit different runtime contexts.
  • Loading branch information
SmetDenis committed Apr 11, 2024
1 parent 94060d1 commit c45df91
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion csv-blueprint.php
Expand Up @@ -20,12 +20,17 @@

\define('PATH_ROOT', __DIR__);
require_once PATH_ROOT . '/vendor/autoload.php';
WorkerPool::setBootstrap(PATH_ROOT . '/vendor/autoload.php');

if ('cli' !== \PHP_SAPI) {
throw new Exception('This script must be run from the command line.');
}

WorkerPool::setBootstrap(
\file_exists(PATH_ROOT . '/docker/preload.php')
? PATH_ROOT . '/docker/preload.php'
: PATH_ROOT . '/vendor/autoload.php',
);

// Fix for GitHub actions. See action.yml
$_SERVER['argv'] = Utils::fixArgv($_SERVER['argv'] ?? []);
$_SERVER['argc'] = \count($_SERVER['argv']);
Expand Down

0 comments on commit c45df91

Please sign in to comment.