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 <?php
return [ return [
'backendTranslatedLanguages' => [
'ru' => 'Русский',
'en' => 'English',
],
'backendDefaultLanguage' => 'ru',
]; ];

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

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

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

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

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

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

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

@ -1,8 +1,13 @@
<?php <?php
return [ return [
'cookieValidationKey' => '', 'cookieValidationKey' => '',
'cookieDomain' => '.morework.dev', 'cookieDomain' => '.morework.local',
'frontendHostInfo' => 'http://morework.dev', 'staticPath' => dirname(__DIR__, 2) . '/static',
'backendHostInfo' => 'http://admin.morework.dev', 'frontendHostInfo' => 'http://morework.local',
'staticHostInfo' => 'http://static.shop.dev', '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 = [ $config = [
'components' => [ 'components' => [
'view' => [
'theme' => [
'basePath' => '@webroot/themes/sport',
'baseUrl' => '@web/themes/sport',
'pathMap' => [
'@frontend/views' => '@webroot/themes/sport',
'@frontend/widgets' => '@webroot/themes/sport/widgets',
],
],
],
'authClientCollection' => [ 'authClientCollection' => [
'class' => 'yii\authclient\Collection', 'class' => 'yii\authclient\Collection',
'clients' => [ 'clients' => [

6
setup.php

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

Loading…
Cancel
Save