在Laravel 3和Composer中找不到类


Class not found with Laravel 3 and Composer

我试图通过artisan使用php-resque composer包。我相信Laravel是v3.2.7。当运行php artisan queue命令时,我得到错误:

误差

PHP Fatal error:  Class 'Resque' not found in /var/www/dev/application/tasks/queue.php on line 20
Fatal error: Class 'Resque' not found in /var/www/dev/application/tasks/queue.php on line 20

这里有什么问题吗?php-resque包似乎已经安装到vendor目录…

PHP

(queue.php)

class Queue_Task
{
    public function run()
    {
        // Autoload composer vendors.
        require path('composer').DS.'autoload.php';
        // You can pass arguments into the worker as payload
        $args = array('name' => 'John Smith');
        Resque::enqueue('testqueue', 'ExampleWorker', $args);
        echo "Resque job queued.'n";
        return;
    }
}

公共/index . php

// --------------------------------------------------------------
// Tick... Tock... Tick... Tock...
// --------------------------------------------------------------
define('LARAVEL_START', microtime(true));
// --------------------------------------------------------------
// Indicate that the request is from the web.
// --------------------------------------------------------------
$web = true;
// --------------------------------------------------------------
// Set the core Laravel path constants.
// --------------------------------------------------------------
require '../paths.php';
// --------------------------------------------------------------
// Autoload composer vendors.
// --------------------------------------------------------------
require path('composer').'autoload.php';
// --------------------------------------------------------------
// Unset the temporary web variable.
// --------------------------------------------------------------
unset($web);
// --------------------------------------------------------------
// Launch Laravel.
// --------------------------------------------------------------
require path('sys').'laravel.php';
// --------------------------------------------------------------
// Autoload composer vendors.
// --------------------------------------------------------------
require path('composer').DS.'autoload.php';

paths.php <片段/em>

// --------------------------------------------------------------
// The path to the composer vendors directory.
// --------------------------------------------------------------
$paths['composer'] = 'vendor';

您的作曲器路径缺少DIRECTORY_SEPARATOR