问题:我正在尝试引导 L4 框架以供某些文件(位于 php-resque 工作人员app/workers
)使用,但工作人员似乎无法在DB
使用DB::table('tablename')...
. composer dumpautoload
没有帮助。
我使用的引导程序没有加载DB
类吗?它似乎已经加载了工人阶级。
L4 引导失败
<?php
// Bootstrap the laravel environment for our resque workers.
require __DIR__.'/bootstrap/autoload.php';
错误
PHP Fatal error: Class 'DB' not found in /var/www/dev/app/libraries/test.php on line 50
作曲家.json
{
"require": {
"laravel/framework": "4.0.*",
"chrisboulton/php-resque": "@stable"
},
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php",
"app/libraries",
"app/workers"
]
},
"scripts": {
"post-update-cmd": "php artisan optimize"
},
"minimum-stability": "dev"
}