You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bootstrap.php 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. // models
  29. Import::using('common\models\*');
  30. Import::using('frontend\models\*');
  31. Import::using('backend\models\*');
  32. // controllers
  33. Import::using('common\controllers\*');
  34. Import::using('frontend\controllers\*');
  35. Import::using('backend\controllers\*');
  36. Import::using('producer\controllers\*');
  37. // helpers
  38. Import::using('common\helpers\*');
  39. // components
  40. Import::using('common\components\*');
  41. Import::using('producer\components\*');
  42. Import::using('backend\components\*');
  43. Import::using('frontend\components\*');
  44. // pdf
  45. Import::using('kartik\mpdf\Pdf');