['listener'], 'aliases' => [ '@bower' => '@vendor/bower-asset', ], 'vendorPath' => dirname(__DIR__, 2) . '/vendor', 'on beforeRequest' => function () { if (method_exists(Yii::$app->request, 'getAbsoluteUrl')) { $url = Yii::$app->request->getAbsoluteUrl(); if ($_SERVER['SERVER_NAME'] != 'localhost' && !empty($url) && substr($url, -1) == '/' && substr($url, -5) != '.net/') { $url = substr($url, 0, strlen($url) - 1); Yii::$app->getResponse()->redirect($url, 301); Yii::$app->end(); } } }, 'components' => [ 'assetManager' => [ 'linkAssets' => YII_ENV == "dev" ? 'true' : false, ], 'user' => [ 'class' => 'yii\web\User', 'identityClass' => 'common\logic\User\User\Model\User', 'enableAutoLogin' => true, 'identityCookie' => [ 'name' => 'distrib', 'domain' => (($serverName != 'localhost') ? '.' : '') . Yii::getAlias('@domainName'), 'path' => '/', ] ], 'session' => [ 'class' => 'yii\web\Session', 'name' => 'PHPDISTRIBSESSID', 'cookieParams' => [ 'domain' => (($serverName != 'localhost') ? '.' : '') . Yii::getAlias('@domainName'), 'httpOnly' => true, ], ], 'cache' => [ 'class' => 'yii\caching\FileCache', ], 'image' => [ 'class' => 'yii\image\ImageDriver', 'driver' => 'GD', //GD or Imagick ], 'urlManagerProducer' => [ 'class' => 'producer\components\UrlManagerProducer', 'subDomain' => Yii::getAlias('@producerSubdomain'), 'domainName' => Yii::getAlias('@domainName'), 'baseUrl' => Yii::getAlias('@baseUrl') . Yii::getAlias('@baseUrlProducer'), 'enablePrettyUrl' => true, 'showScriptName' => false, 'enableStrictParsing' => false, 'rules' => [ '' => 'site/index', '//' => '/', ], ], 'urlManagerFrontend' => [ 'class' => 'common\components\UrlManagerCommon', 'subDomain' => Yii::getAlias('@frontendSubdomain'), 'domainName' => Yii::getAlias('@domainName'), 'baseUrl' => Yii::getAlias('@baseUrl') . Yii::getAlias('@baseUrlFrontend'), 'enablePrettyUrl' => true, 'showScriptName' => false, 'enableStrictParsing' => false, 'rules' => [ ], ], 'urlManagerBackend' => [ 'class' => 'common\components\UrlManagerCommon', 'subDomain' => Yii::getAlias('@backendSubdomain'), 'domainName' => Yii::getAlias('@domainName'), 'baseUrl' => Yii::getAlias('@baseUrl') . Yii::getAlias('@baseUrlBackend'), 'enablePrettyUrl' => true, 'showScriptName' => false, 'enableStrictParsing' => false, 'rules' => [], ], 'logic' => function () { return new BusinessLogic(); }, 'listener' => [ 'class' => \justcoded\yii2\eventlistener\components\EventListener::class, 'listeners' => [], 'observers' => [ CreditHistory::class => [ common\logic\User\UserProducer\Event\CreditHistoryObserver::class ], Distribution::class => [ common\logic\Subscription\Subscription\Event\DistributionObserver::class ], Ticket::class => [ common\logic\User\User\Event\TicketObserver::class, ], ], ], ], 'language' => 'fr-FR', 'timeZone' => 'Europe/Paris', ];