4 if (php_sapi_name() !== 'cli') {
8 require __DIR__ . '/vendor/autoload.php';
10 use Cli\Commands\BackupCommand;
13 // Get the directory of the CLI "entrypoint", adjusted to be the real
14 // location where running via a phar.
16 if (str_starts_with($scriptDir, 'phar://')) {
17 $scriptDir = dirname(Phar::running(false));
19 $bsDir = dirname($scriptDir);
21 // Load in our .env file from the parent directory
22 $dotenv = Dotenv\Dotenv::createImmutable($bsDir);
27 $app->setSignature('./run');
29 $app->registerCommand('backup', [new BackupCommand($bsDir), 'handle']);
31 $app->runCommand($argv);