Реорганизован компонент для контроллера amqp очередей в наш внешний пакет

This commit is contained in:
ErickSkrauch
2016-08-16 01:27:18 +03:00
parent 3e4573027c
commit c3d0490d4a
4 changed files with 34 additions and 246 deletions

View File

@@ -1,8 +1,35 @@
<?php
namespace console\controllers\base;
use common\components\RabbitMQ\Controller;
use Ely\Amqp\ControllerTrait;
use Yii;
use yii\console\Controller;
use yii\helpers\ArrayHelper;
use yii\helpers\Inflector;
abstract class AmqpController extends Controller {
use ControllerTrait;
public final function actionIndex() {
$this->start();
}
public function getRoutesMap() {
return [];
}
/**
* @inheritdoc
*/
protected function getConnection() {
return Yii::$app->amqp->getConnection();
}
/**
* @inheritdoc
*/
protected function buildRouteActionName($route) {
return ArrayHelper::getValue($this->getRoutesMap(), $route, 'route' . Inflector::camelize($route));
}
}