123456789101112131415161718192021 |
- #!/usr/bin/env php
- <?php
- if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
- require_once __DIR__ . '/../vendor/autoload.php';
- } else {
- require_once __DIR__ . '/../../../autoload.php';
- }
- parse_str($argv[2], $config);
- $cls = $config['jobClass'];
- if (!is_a($cls, 'Jobby\BackgroundJob', true)) {
- throw new Jobby\Exception('"jobClass" needs to be an instanceof Jobby\BackgroundJob');
- }
- /** @var \Jobby\BackgroundJob $job */
- $job = new $cls($argv[1], $config);
- $job->run();
|