您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

37 行
1.5KB

  1. <?php
  2. define('YII_ENV', 'test');
  3. defined('YII_DEBUG') or define('YII_DEBUG', true);
  4. require_once __DIR__ . '/../vendor/yiisoft/yii2/Yii.php';
  5. require __DIR__ .'/../vendor/autoload.php';
  6. // @see common/config/bootstrap.php
  7. $dirname = dirname(__DIR__);
  8. Yii::setAlias('common', $dirname.'/common');
  9. Yii::setAlias('frontend', $dirname . '/frontend');
  10. Yii::setAlias('backend', $dirname . '/backend');
  11. Yii::setAlias('console', $dirname . '/console');
  12. Yii::setAlias('producer', $dirname . '/producer');
  13. $serverName = isset($_SERVER['SERVER_NAME']) ?? '' ;
  14. $domainName = '' ;
  15. if($serverName == 'localhost') {
  16. $domainName = 'localhost' ;
  17. }
  18. else {
  19. $domainName = (YII_ENV === 'dev') ? 'opendistrib-beta.net' : 'opendistrib.net' ;
  20. }
  21. Yii::setAlias('@domainName', $domainName);
  22. Yii::setAlias('@baseUrl', ($serverName == 'localhost') ? '/Opendistrib/' : '/');
  23. Yii::setAlias('@baseUrlFrontend', (($serverName == 'localhost') ? '/frontend/web' : ''));
  24. Yii::setAlias('@baseUrlBackend', (($serverName == 'localhost') ? '/backend/web' : ''));
  25. Yii::setAlias('@baseUrlProducer', (($serverName == 'localhost') ? '/producer/web' : ''));
  26. Yii::setAlias('@frontendSubdomain', (($serverName == 'localhost') ? '' : 'www'));
  27. Yii::setAlias('@backendSubdomain', (($serverName == 'localhost') ? '' : 'admin'));
  28. Yii::setAlias('@producerSubdomain', (($serverName == 'localhost') ? '' : 'producteurs'));
  29. /*
  30. * Autoload
  31. */
  32. Yii::$classMap['Import'] = Yii::getAlias('@common/exts/Import.php');
  33. Import::using('common\components\*');