Skip to content

Commit

Permalink
Simplify WorkerPool bootstrap setup
Browse files Browse the repository at this point in the history
The WorkerPool bootstrap has been simplified by removing conditional file_exists check and directly setting the 'vendor/autoload.php' as the bootstrap. This will make the script setup less convoluted and easier to understand.
  • Loading branch information
SmetDenis committed Apr 11, 2024
1 parent 12d5f13 commit 94060d1
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions csv-blueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,12 @@

\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 94060d1

Please sign in to comment.