backupscript/backup

33 lines
737 B
Plaintext
Raw Normal View History

2023-05-26 11:47:40 +00:00
#!/usr/bin/env php
<?php
$autoload = null;
$autoloadFiles = [
__DIR__ . '/../vendor/autoload.php',
__DIR__ . '/../../../autoload.php',
__DIR__ . '/vendor/autoload.php'
];
foreach ($autoloadFiles as $autoloadFile) {
if (file_exists($autoloadFile)) {
$autoload = $autoloadFile;
break;
}
}
if (! $autoload) {
echo "Autoload file not found; try 'composer dump-autoload' first." . PHP_EOL;
exit(1);
}
require $autoload;
2023-05-31 09:00:20 +00:00
$package = \Composer\InstalledVersions::getRootPackage();
2023-05-26 11:47:40 +00:00
use Symfony\Component\Console\Application;
2023-05-31 09:00:20 +00:00
$application = new Application('backup', $package['version']);
2023-05-26 11:47:40 +00:00
$application->add(new App\CommandBackup());
$application->add(new App\CommandShow());
$application->run();