Browse Source

Environments update

master
Egorka 6 years ago
parent
commit
2328f83810
  1. 5
      environments/dev/backend/config/params-local.php
  2. 11
      environments/dev/common/config/params-local.php
  3. 28
      environments/dev/frontend/config/main-local.php
  4. 5
      environments/prod/backend/config/params-local.php
  5. 13
      environments/prod/common/config/params-local.php
  6. 11
      environments/prod/frontend/config/main-local.php
  7. 6
      setup.php

5
environments/dev/backend/config/params-local.php

@ -1,3 +1,8 @@
<?php
return [
'backendTranslatedLanguages' => [
'ru' => 'Русский',
'en' => 'English',
],
'backendDefaultLanguage' => 'ru',
];

11
environments/dev/common/config/params-local.php

@ -1,10 +1,13 @@
<?php
return [
'cookieValidationKey' => '',
'cookieDomain' => '.domain.local',
'frontendHostInfo' => 'http://domain.local',
'backendHostInfo' => 'http://admin.domain.local',
'staticHostInfo' => 'http://static.domain.local',
'cookieDomain' => '.morework.local',
'staticPath' => dirname(__DIR__, 2) . '/static',
'frontendHostInfo' => 'http://morework.local',
'backendHostInfo' => 'http://admin.morework.local',
'staticHostInfo' => 'http://static.morework.local',
'supportEmail' => 'support@morework.local',
'adminEmail' => 'admin@morework.local',
'mailChimpKey' => '',
'mailChimpListId' => '',
];

28
environments/dev/frontend/config/main-local.php

@ -2,9 +2,35 @@
$config = [
'components' => [
'view' => [
'theme' => [
'basePath' => '@webroot/themes/sport',
'baseUrl' => '@web/themes/sport',
'pathMap' => [
'@frontend/views' => '@webroot/themes/sport',
'@frontend/widgets' => '@webroot/themes/sport/widgets',
],
],
],
'authClientCollection' => [
'class' => 'yii\authclient\Collection',
'clients' => [
'yandex' => [
'class' => 'yii\authclient\clients\Yandex',
'clientId' => '',
'clientSecret' => '',
],
'google' => [
'class' => 'yii\authclient\clients\Google',
'clientId' => '',
'clientSecret' => '',
],
'facebook' => [
'class' => 'yii\authclient\clients\Facebook',
'clientId' => '',
'clientSecret' => '',
],
'vk' => [
'class' => 'yii\authclient\clients\VKontakte',
'clientId' => '',
@ -20,11 +46,13 @@ if (!YII_ENV_TEST) {
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
'allowedIPs' => ['*'],
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
'allowedIPs' => ['*'],
];
}

5
environments/prod/backend/config/params-local.php

@ -1,3 +1,8 @@
<?php
return [
'backendTranslatedLanguages' => [
'ru' => 'Русский',
'en' => 'English',
],
'backendDefaultLanguage' => 'ru',
];

13
environments/prod/common/config/params-local.php

@ -1,8 +1,13 @@
<?php
return [
'cookieValidationKey' => '',
'cookieDomain' => '.morework.dev',
'frontendHostInfo' => 'http://morework.dev',
'backendHostInfo' => 'http://admin.morework.dev',
'staticHostInfo' => 'http://static.shop.dev',
'cookieDomain' => '.morework.local',
'staticPath' => dirname(__DIR__, 2) . '/static',
'frontendHostInfo' => 'http://morework.local',
'backendHostInfo' => 'http://admin.morework.local',
'staticHostInfo' => 'http://static.morework.local',
'supportEmail' => 'support@morework.local',
'adminEmail' => 'admin@morework.local',
'mailChimpKey' => '',
'mailChimpListId' => '',
];

11
environments/prod/frontend/config/main-local.php

@ -2,6 +2,17 @@
$config = [
'components' => [
'view' => [
'theme' => [
'basePath' => '@webroot/themes/sport',
'baseUrl' => '@web/themes/sport',
'pathMap' => [
'@frontend/views' => '@webroot/themes/sport',
'@frontend/widgets' => '@webroot/themes/sport/widgets',
],
],
],
'authClientCollection' => [
'class' => 'yii\authclient\Collection',
'clients' => [

6
setup.php

@ -34,10 +34,10 @@ class Setup
// run init
if ($this->_type == 'd') {
shell_exec('php init --env=Development --overwrite=n');
shell_exec('php ' . __DIR__ . '/init --env=Development --overwrite=n');
}
else {
shell_exec('php init --env=Production --overwrite=n');
shell_exec('php ' . __DIR__ . '/init --env=Production --overwrite=n');
}
// config db
@ -145,12 +145,14 @@ class Setup
$site_domain = $this->_http_protocol . '://' . $this->_domain;
$admin_domain = $this->_http_protocol . '://admin.' . $this->_domain;
$static_domain = $this->_http_protocol . '://static.' . $this->_domain;
$cookie_domain = '.' . $this->_domain;
$content = preg_replace('/(("|\')frontendHostInfo("|\')\s*=>\s*)(""|\'\')/', "\\1'$site_domain'", $content);
$content = preg_replace('/(("|\')backendHostInfo("|\')\s*=>\s*)(""|\'\')/', "\\1'$admin_domain'", $content);
$content = preg_replace('/(("|\')staticHostInfo("|\')\s*=>\s*)(""|\'\')/', "\\1'$static_domain'", $content);
$content = preg_replace('/(("|\')supportEmail("|\')\s*=>\s*)(""|\'\')/', "\\1'$this->_email'", $content);
$content = preg_replace('/(("|\')adminEmail("|\')\s*=>\s*)(""|\'\')/', "\\1'$this->_email'", $content);
$content = preg_replace('/(("|\')cookieDomain("|\')\s*=>\s*)(""|\'\')/', "\\1'$cookie_domain'", $content);
file_put_contents($file, $content);
}

Loading…
Cancel
Save