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

17
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',
'mailChimpKey' => '',
'mailChimpListId' => '',
'cookieValidationKey' => '',
'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' => '',
];

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

@ -1,30 +1,58 @@
<?php
$config = [
'components' => [
'authClientCollection' => [
'class' => 'yii\authclient\Collection',
'clients' => [
'vk' => [
'class' => 'yii\authclient\clients\VKontakte',
'clientId' => '',
'clientSecret' => '',
],
],
]
],
'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' => '',
'clientSecret' => '',
],
],
]
],
];
if (!YII_ENV_TEST) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
'class' => 'yii\debug\Module',
'allowedIPs' => ['*'],
];
$config['bootstrap'][] = 'gii';
$config['bootstrap'][] = '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
return [
'backendTranslatedLanguages' => [
'ru' => 'Русский',
'en' => 'English',
],
'backendDefaultLanguage' => 'ru',
];

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

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

@ -1,33 +1,44 @@
<?php
$config = [
'components' => [
'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' => '',
],
],
]
],
'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' => '',
'clientSecret' => '',
],
],
]
],
];
return $config;

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