Exemplo n.º 1
0
 public function init()
 {
     if ($this->configFile !== null) {
         \Resque::loadConfig($this->configFile);
     }
 }
Exemplo n.º 2
0
 * with php-resque. Navigate to /path/to/php-resque/examples/ in your browser
 * and you can add some test jobs to see how it all works.
 * 
 * Note that you will also have to run `/path/to/bin/resque worker:start` from
 * your command line in order for php-resque to process jobs.
 */
if (!ini_get('date.timezone') or !date_default_timezone_get()) {
    date_default_timezone_set('UTC');
}
if (file_exists($file = __DIR__ . '/../vendor/autoload.php')) {
    require_once $file;
} else {
    echo 'You need to set up the project dependencies using the following commands:' . 'curl -s http://getcomposer.org/installer | php' . 'php composer.phar install';
    exit(1);
}
Resque::loadConfig();
$job = false;
if (isset($_GET['action'])) {
    switch ($_GET['action']) {
        case 'reset':
            $redis = Resque\Redis::instance();
            $keys = $redis->keys('*');
            foreach ($keys as $key) {
                $redis->del($key);
            }
            header('Location: ?');
            break;
        case 'push':
            $job = Resque::push('HelloWorld', array());
            break;
        case 'delayed':