mirror of
				https://github.com/elyby/accounts.git
				synced 2025-05-31 14:11:46 +05:30 
			
		
		
		
	Реорганизован компонент для контроллера amqp очередей в наш внешний пакет
This commit is contained in:
		@@ -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));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user