2013-01-12 11:40:26 +00:00
|
|
|
<?php
|
2021-02-18 23:23:32 +00:00
|
|
|
|
|
|
|
namespace Resque\Example;
|
|
|
|
|
2013-01-12 11:40:26 +00:00
|
|
|
// Find and initialize Composer
|
|
|
|
// NOTE: You should NOT use this when developing against php-resque.
|
|
|
|
// The autoload code below is specifically for this demo.
|
2018-05-29 20:25:02 +00:00
|
|
|
$files = [
|
2018-05-25 09:03:48 +00:00
|
|
|
__DIR__ . '/../../vendor/autoload.php',
|
|
|
|
__DIR__ . '/../../../../autoload.php',
|
|
|
|
__DIR__ . '/../vendor/autoload.php',
|
2018-05-29 20:25:02 +00:00
|
|
|
];
|
2013-01-12 11:40:26 +00:00
|
|
|
|
|
|
|
foreach ($files as $file) {
|
2018-05-25 09:03:48 +00:00
|
|
|
if (file_exists($file)) {
|
|
|
|
require_once $file;
|
|
|
|
break;
|
|
|
|
}
|
2013-01-12 11:40:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!class_exists('Composer\Autoload\ClassLoader', false)) {
|
2018-05-25 09:03:48 +00:00
|
|
|
die(
|
|
|
|
'You need to set up the project dependencies using the following commands:' . PHP_EOL .
|
|
|
|
'curl -s http://getcomposer.org/installer | php' . PHP_EOL .
|
|
|
|
'php composer.phar install' . PHP_EOL
|
|
|
|
);
|
2021-02-18 23:23:32 +00:00
|
|
|
}
|