Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

56 linhas
2.0KB

  1. <?php
  2. Yii::setAlias('common', dirname(__DIR__));
  3. Yii::setAlias('frontend', dirname(dirname(__DIR__)) . '/frontend');
  4. Yii::setAlias('backend', dirname(dirname(__DIR__)) . '/backend');
  5. Yii::setAlias('console', dirname(dirname(__DIR__)) . '/console');
  6. Yii::setAlias('producer', dirname(dirname(__DIR__)) . '/producer');
  7. $server_name = $_SERVER['SERVER_NAME'] ;
  8. Yii::setAlias('@domainName', (YII_ENV === 'dev') ? (($server_name == 'localhost') ? 'localhost' : 'laboiteapain-dev.net') : 'laboiteapain.net');
  9. Yii::setAlias('@baseUrl', ($server_name == 'localhost') ? '/laboiteapain/' : '/');
  10. Yii::setAlias('@baseUrlFrontend', (($server_name == 'localhost') ? '/frontend/web' : ''));
  11. Yii::setAlias('@baseUrlBackend', (($server_name == 'localhost') ? '/backend/web' : ''));
  12. Yii::setAlias('@baseUrlProducer', (($server_name == 'localhost') ? '/producer/web' : ''));
  13. Yii::setAlias('@frontendSubdomain', (($server_name == 'localhost') ? '' : 'www'));
  14. Yii::setAlias('@backendSubdomain', (($server_name == 'localhost') ? '' : 'admin'));
  15. Yii::setAlias('@producerSubdomain', (($server_name == 'localhost') ? '' : 'producteurs'));
  16. /*
  17. * Autoload
  18. */
  19. Yii::$classMap['Import'] = Yii::getAlias('@common/exts/Import.php'); // sesuaikan pathnya
  20. // yii
  21. Import::using('Yii');
  22. Import::using('yii\filters\*');
  23. Import::using('yii\data\*');
  24. Import::using('yii\db\*');
  25. Import::using('yii\behaviors\*');
  26. Import::using('yii\helpers\*');
  27. Import::using('yii\web\NotFoundHttpException');
  28. Import::using('yii\grid\*');
  29. // models
  30. Import::using('common\models\*');
  31. Import::using('frontend\models\*');
  32. Import::using('backend\models\*');
  33. // controllers
  34. Import::using('common\controllers\*');
  35. Import::using('frontend\controllers\*');
  36. Import::using('backend\controllers\*');
  37. Import::using('producer\controllers\*');
  38. // helpers
  39. Import::using('common\helpers\*');
  40. // components
  41. Import::using('common\components\*');
  42. Import::using('producer\components\*');
  43. Import::using('backend\components\*');
  44. Import::using('frontend\components\*');
  45. // pdf
  46. Import::using('kartik\mpdf\Pdf');