Здравствуйте! Хочу установить
wiki.workerman.net/Workerman_documentation#Installation
Добавляю в composer, создаю файл в корне следующего содержания:
namespace app;
use Workerman\Worker;
use Workerman\Lib\Timer;
use app\models\Auction;
require_once './vendor/workerman/workerman/Autoloader.php';
$task = new Worker();
$task->onWorkerStart = function($task){
$time_interval = 5;
$timer_id = Timer::add($time_interval,
function(){
$endedAuctionExist = Auction::find()->where(['ended_at'=>2])->exists();
if($endedAuctionExist){
$auctions = Auction::find()->where(['ended_at'=>2])->all();
foreach($auctions as $auction){
/* @var $auction Auction */
$auction->winner_id = 10;
$auction->save();
}
}
}
);
};
Worker::runAll();
Workerman стартует:
Workerman[auction.php] start in DEBUG mode
----------------------- WORKERMAN -----------------------------
Workerman version:3.3.4 PHP version:5.4.16
------------------------ WORKERS -------------------------------
user worker listen processes status
root none none 1 [OK]
----------------------------------------------------------------
Press Ctrl-C to quit. Start success.
PHP Fatal error: Class 'app\models\Auction' not found in auction.php on line 15
Подскажите что не так?