Browse Source

Environments update

master
Egorka 6 years ago
parent
commit
2328f83810
  1. 5
      environments/dev/backend/config/params-local.php
  2. 17
      environments/dev/common/config/params-local.php
  3. 60
      environments/dev/frontend/config/main-local.php
  4. 5
      environments/prod/backend/config/params-local.php
  5. 15
      environments/prod/common/config/params-local.php
  6. 65
      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',
]; ];

17
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',
'mailChimpKey' => '', 'staticHostInfo' => 'http://static.morework.local',
'mailChimpListId' => '', 'supportEmail' => 'support@morework.local',
'adminEmail' => 'admin@morework.local',
'mailChimpKey' => '',
'mailChimpListId' => '',
]; ];

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

@ -1,30 +1,58 @@
<?php <?php
$config = [ $config = [
'components' => [ 'components' => [
'authClientCollection' => [ 'view' => [
'class' => 'yii\authclient\Collection', 'theme' => [
'clients' => [ 'basePath' => '@webroot/themes/sport',
'vk' => [ 'baseUrl' => '@web/themes/sport',
'class' => 'yii\authclient\clients\VKontakte', 'pathMap' => [
'clientId' => '', '@frontend/views' => '@webroot/themes/sport',
'clientSecret' => '', '@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' => '',
'clientSecret' => '',
],
],
]
],
]; ];
if (!YII_ENV_TEST) { if (!YII_ENV_TEST) {
// configuration adjustments for 'dev' environment // configuration adjustments for 'dev' environment
$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',
]; ];

15
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' => '',
]; ];

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

@ -1,33 +1,44 @@
<?php <?php
$config = [ $config = [
'components' => [ 'components' => [
'authClientCollection' => [ 'view' => [
'class' => 'yii\authclient\Collection', 'theme' => [
'clients' => [ 'basePath' => '@webroot/themes/sport',
'yandex' => [ 'baseUrl' => '@web/themes/sport',
'class' => 'yii\authclient\clients\Yandex', 'pathMap' => [
'clientId' => '', '@frontend/views' => '@webroot/themes/sport',
'clientSecret' => '', '@frontend/widgets' => '@webroot/themes/sport/widgets',
], ],
'google' => [ ],
'class' => 'yii\authclient\clients\Google', ],
'clientId' => '',
'clientSecret' => '', 'authClientCollection' => [
], 'class' => 'yii\authclient\Collection',
'facebook' => [ 'clients' => [
'class' => 'yii\authclient\clients\Facebook', 'yandex' => [
'clientId' => '', 'class' => 'yii\authclient\clients\Yandex',
'clientSecret' => '', 'clientId' => '',
], 'clientSecret' => '',
'vk' => [ ],
'class' => 'yii\authclient\clients\VKontakte', 'google' => [
'clientId' => '', 'class' => 'yii\authclient\clients\Google',
'clientSecret' => '', 'clientId' => '',
], 'clientSecret' => '',
], ],
] 'facebook' => [
], 'class' => 'yii\authclient\clients\Facebook',
'clientId' => '',
'clientSecret' => '',
],
'vk' => [
'class' => 'yii\authclient\clients\VKontakte',
'clientId' => '',
'clientSecret' => '',
],
],
]
],
]; ];
return $config; return $config;

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