0

I have built my first Laravel 4 package.

I have used artisan to create the structure.

I need to use the package to process a queue (as the worker).

I am using the builtin Beanstalk queue and have it configured and I am able to add to the queue.

What is the correct syntax to add the correct path to the class that I would like to use to process the queue.

I can get this working if the class is saved here /app/controllers/TestClass.php ( beacuse this gets autoloaded)
Example:

Route::get('/addtoqueue', function()
{
    $message = "This is a test message";
    Queue::push('TestClass', array('message' => $message));
    return 'Added to Queue';
});

But what should I put in as the class in the queue if the class is in a package?
This file is in workbench: workbench\vendor\package\src\Vendor\Package

My package composer file contains

"autoload": {
    "psr-0": {
        "Qwickli\\Tika": "src/"
    }
},

Eg. Queue::push('vendor\package\TestClass', array('message' => $message));

When I run php artisan queue:listen it correctly picks up the items in the queue and but it does NOT find the class (in the package) that I would like to use process the queue.

For some reason the class is not being loaded (or autoloaded) and I don't know how to make that happen.

Thanks for all and any help

JackPoint
  • 4,031
  • 1
  • 30
  • 42
Dave
  • 21
  • 1
  • 5
  • This may be a workbench related problem. Have you tried the same without the package in the workbench? (i.e. in the vendor/Vendor/Package directory) – Phill Sparks May 09 '13 at 12:35

1 Answers1

0

Looks like your package classes are not been autoloaded.

Try to access your package folder, workbench/vendor/package and run a compsoer update. If your composer "autoload" settings are correct, this should work.

Luis Dalmolin
  • 3,416
  • 1
  • 18
  • 24