|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- Yii::setAlias('common', dirname(__DIR__));
- Yii::setAlias('frontend', dirname(dirname(__DIR__)) . '/frontend');
- Yii::setAlias('backend', dirname(dirname(__DIR__)) . '/backend');
- Yii::setAlias('console', dirname(dirname(__DIR__)) . '/console');
- Yii::setAlias('producer', dirname(dirname(__DIR__)) . '/producer');
-
- $server_name = $_SERVER['SERVER_NAME'] ;
- Yii::setAlias('@domainName', (YII_ENV === 'dev') ? (($server_name == 'localhost') ? 'localhost' : 'laboiteapain-dev.net') : 'laboiteapain.net');
- Yii::setAlias('@baseUrl', ($server_name == 'localhost') ? '/reservation_pain/' : '/');
- Yii::setAlias('@baseUrlFrontend', (($server_name == 'localhost') ? '/frontend/web' : ''));
- Yii::setAlias('@baseUrlBackend', (($server_name == 'localhost') ? '/backend/web' : ''));
- Yii::setAlias('@baseUrlProducer', (($server_name == 'localhost') ? '/producer/web' : ''));
- Yii::setAlias('@frontendSubdomain', (($server_name == 'localhost') ? '' : 'www'));
- Yii::setAlias('@backendSubdomain', (($server_name == 'localhost') ? '' : 'admin'));
- Yii::setAlias('@producerSubdomain', (($server_name == 'localhost') ? '' : 'producteurs'));
-
- /*
- * Autoload
- */
-
- Yii::$classMap['Import'] = Yii::getAlias('@common/exts/Import.php'); // sesuaikan pathnya
-
- // yii
- Import::using('Yii');
- Import::using('yii\filters\*');
- Import::using('yii\data\*');
- Import::using('yii\db\*');
- Import::using('yii\behaviors\*');
- Import::using('yii\helpers\*');
- Import::using('yii\web\NotFoundHttpException');
-
-
- // models
- Import::using('common\models\*');
- Import::using('frontend\models\*');
- Import::using('backend\models\*');
-
- // controllers
- Import::using('common\controllers\*');
- Import::using('frontend\controllers\*');
- Import::using('backend\controllers\*');
- Import::using('producer\controllers\*');
-
- // helpers
- Import::using('common\helpers\*');
-
- // components
- Import::using('common\components\*');
- Import::using('producer\components\*');
- Import::using('backend\components\*');
- Import::using('frontend\components\*');
-
- // pdf
- Import::using('kartik\mpdf\Pdf');
|