|
- <?php
- define('YII_ENV', 'test');
- defined('YII_DEBUG') or define('YII_DEBUG', true);
- require_once __DIR__ . '/../vendor/yiisoft/yii2/Yii.php';
- require __DIR__ .'/../vendor/autoload.php';
-
- // @see common/config/bootstrap.php
- $dirname = dirname(__DIR__);
- Yii::setAlias('common', $dirname.'/common');
- Yii::setAlias('frontend', $dirname . '/frontend');
- Yii::setAlias('backend', $dirname . '/backend');
- Yii::setAlias('console', $dirname . '/console');
- Yii::setAlias('producer', $dirname . '/producer');
-
- $serverName = isset($_SERVER['SERVER_NAME']) ?? '' ;
- $domainName = '' ;
- if($serverName == 'localhost') {
- $domainName = 'localhost' ;
- }
- else {
- $domainName = (YII_ENV === 'dev') ? 'opendistrib-beta.net' : 'opendistrib.net' ;
- }
-
- Yii::setAlias('@domainName', $domainName);
- Yii::setAlias('@baseUrl', ($serverName == 'localhost') ? '/Opendistrib/' : '/');
- Yii::setAlias('@baseUrlFrontend', (($serverName == 'localhost') ? '/frontend/web' : ''));
- Yii::setAlias('@baseUrlBackend', (($serverName == 'localhost') ? '/backend/web' : ''));
- Yii::setAlias('@baseUrlProducer', (($serverName == 'localhost') ? '/producer/web' : ''));
- Yii::setAlias('@frontendSubdomain', (($serverName == 'localhost') ? '' : 'www'));
- Yii::setAlias('@backendSubdomain', (($serverName == 'localhost') ? '' : 'admin'));
- Yii::setAlias('@producerSubdomain', (($serverName == 'localhost') ? '' : 'producteurs'));
-
- /*
- * Autoload
- */
- Yii::$classMap['Import'] = Yii::getAlias('@common/exts/Import.php');
- Import::using('common\components\*');
|