first commit
This commit is contained in:
25
environments/dev/backend/config/main-local.php
Normal file
25
environments/dev/backend/config/main-local.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$config = [
|
||||
'components' => [
|
||||
'request' => [
|
||||
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
|
||||
'cookieValidationKey' => '',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
if (!YII_ENV_TEST) {
|
||||
// configuration adjustments for 'dev' environment
|
||||
$config['bootstrap'][] = 'debug';
|
||||
$config['modules']['debug'] = [
|
||||
'class' => 'yii\debug\Module',
|
||||
];
|
||||
|
||||
$config['bootstrap'][] = 'gii';
|
||||
$config['modules']['gii'] = [
|
||||
'class' => 'yii\gii\Module',
|
||||
];
|
||||
}
|
||||
|
||||
return $config;
|
3
environments/dev/backend/config/params-local.php
Normal file
3
environments/dev/backend/config/params-local.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
return [
|
||||
];
|
9
environments/dev/backend/config/test-local.php
Normal file
9
environments/dev/backend/config/test-local.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
return yii\helpers\ArrayHelper::merge(
|
||||
require __DIR__ . '/../../common/config/test-local.php',
|
||||
require __DIR__ . '/main.php',
|
||||
require __DIR__ . '/main-local.php',
|
||||
require __DIR__ . '/test.php',
|
||||
[
|
||||
]
|
||||
);
|
18
environments/dev/backend/web/index-test.php
Normal file
18
environments/dev/backend/web/index-test.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
// NOTE: Make sure this file is not accessible when deployed to production
|
||||
if (!in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'])) {
|
||||
die('You are not allowed to access this file.');
|
||||
}
|
||||
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', true);
|
||||
defined('YII_ENV') or define('YII_ENV', 'test');
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php';
|
||||
require __DIR__ . '/../../common/config/bootstrap.php';
|
||||
require __DIR__ . '/../config/bootstrap.php';
|
||||
|
||||
$config = require __DIR__ . '/../config/test-local.php';
|
||||
|
||||
(new yii\web\Application($config))->run();
|
17
environments/dev/backend/web/index.php
Normal file
17
environments/dev/backend/web/index.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', true);
|
||||
defined('YII_ENV') or define('YII_ENV', 'dev');
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php';
|
||||
require __DIR__ . '/../../common/config/bootstrap.php';
|
||||
require __DIR__ . '/../config/bootstrap.php';
|
||||
|
||||
$config = yii\helpers\ArrayHelper::merge(
|
||||
require __DIR__ . '/../../common/config/main.php',
|
||||
require __DIR__ . '/../../common/config/main-local.php',
|
||||
require __DIR__ . '/../config/main.php',
|
||||
require __DIR__ . '/../config/main-local.php'
|
||||
);
|
||||
|
||||
(new yii\web\Application($config))->run();
|
2
environments/dev/backend/web/robots.txt
Normal file
2
environments/dev/backend/web/robots.txt
Normal file
@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Disallow: /
|
20
environments/dev/common/config/main-local.php
Normal file
20
environments/dev/common/config/main-local.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
return [
|
||||
'components' => [
|
||||
'db' => [
|
||||
'class' => 'yii\db\Connection',
|
||||
'dsn' => 'mysql:host=localhost;dbname=yii2advanced',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'charset' => 'utf8',
|
||||
],
|
||||
'mailer' => [
|
||||
'class' => 'yii\swiftmailer\Mailer',
|
||||
'viewPath' => '@common/mail',
|
||||
// send all mails to a file by default. You have to set
|
||||
// 'useFileTransport' to false and configure a transport
|
||||
// for the mailer to send real emails.
|
||||
'useFileTransport' => true,
|
||||
],
|
||||
],
|
||||
];
|
3
environments/dev/common/config/params-local.php
Normal file
3
environments/dev/common/config/params-local.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
return [
|
||||
];
|
13
environments/dev/common/config/test-local.php
Normal file
13
environments/dev/common/config/test-local.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
return yii\helpers\ArrayHelper::merge(
|
||||
require __DIR__ . '/main.php',
|
||||
require __DIR__ . '/main-local.php',
|
||||
require __DIR__ . '/test.php',
|
||||
[
|
||||
'components' => [
|
||||
'db' => [
|
||||
'dsn' => 'mysql:host=localhost;dbname=yii2advanced_test',
|
||||
]
|
||||
],
|
||||
]
|
||||
);
|
7
environments/dev/console/config/main-local.php
Normal file
7
environments/dev/console/config/main-local.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
return [
|
||||
'bootstrap' => ['gii'],
|
||||
'modules' => [
|
||||
'gii' => 'yii\gii\Module',
|
||||
],
|
||||
];
|
3
environments/dev/console/config/params-local.php
Normal file
3
environments/dev/console/config/params-local.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
return [
|
||||
];
|
25
environments/dev/frontend/config/main-local.php
Normal file
25
environments/dev/frontend/config/main-local.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$config = [
|
||||
'components' => [
|
||||
'request' => [
|
||||
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
|
||||
'cookieValidationKey' => '',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
if (!YII_ENV_TEST) {
|
||||
// configuration adjustments for 'dev' environment
|
||||
$config['bootstrap'][] = 'debug';
|
||||
$config['modules']['debug'] = [
|
||||
'class' => 'yii\debug\Module',
|
||||
];
|
||||
|
||||
$config['bootstrap'][] = 'gii';
|
||||
$config['modules']['gii'] = [
|
||||
'class' => 'yii\gii\Module',
|
||||
];
|
||||
}
|
||||
|
||||
return $config;
|
3
environments/dev/frontend/config/params-local.php
Normal file
3
environments/dev/frontend/config/params-local.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
return [
|
||||
];
|
9
environments/dev/frontend/config/test-local.php
Normal file
9
environments/dev/frontend/config/test-local.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
return yii\helpers\ArrayHelper::merge(
|
||||
require __DIR__ . '/../../common/config/test-local.php',
|
||||
require __DIR__ . '/main.php',
|
||||
require __DIR__ . '/main-local.php',
|
||||
require __DIR__ . '/test.php',
|
||||
[
|
||||
]
|
||||
);
|
18
environments/dev/frontend/web/index-test.php
Normal file
18
environments/dev/frontend/web/index-test.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
// NOTE: Make sure this file is not accessible when deployed to production
|
||||
if (!in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'])) {
|
||||
die('You are not allowed to access this file.');
|
||||
}
|
||||
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', true);
|
||||
defined('YII_ENV') or define('YII_ENV', 'test');
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php';
|
||||
require __DIR__ . '/../../common/config/bootstrap.php';
|
||||
require __DIR__ . '/../config/bootstrap.php';
|
||||
|
||||
$config = require __DIR__ . '/../config/test-local.php';
|
||||
|
||||
(new yii\web\Application($config))->run();
|
17
environments/dev/frontend/web/index.php
Normal file
17
environments/dev/frontend/web/index.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', true);
|
||||
defined('YII_ENV') or define('YII_ENV', 'dev');
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php';
|
||||
require __DIR__ . '/../../common/config/bootstrap.php';
|
||||
require __DIR__ . '/../config/bootstrap.php';
|
||||
|
||||
$config = yii\helpers\ArrayHelper::merge(
|
||||
require __DIR__ . '/../../common/config/main.php',
|
||||
require __DIR__ . '/../../common/config/main-local.php',
|
||||
require __DIR__ . '/../config/main.php',
|
||||
require __DIR__ . '/../config/main-local.php'
|
||||
);
|
||||
|
||||
(new yii\web\Application($config))->run();
|
2
environments/dev/frontend/web/robots.txt
Normal file
2
environments/dev/frontend/web/robots.txt
Normal file
@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Disallow: /
|
24
environments/dev/yii
Normal file
24
environments/dev/yii
Normal file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
* Yii console bootstrap file.
|
||||
*/
|
||||
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', true);
|
||||
defined('YII_ENV') or define('YII_ENV', 'dev');
|
||||
|
||||
require __DIR__ . '/vendor/autoload.php';
|
||||
require __DIR__ . '/vendor/yiisoft/yii2/Yii.php';
|
||||
require __DIR__ . '/common/config/bootstrap.php';
|
||||
require __DIR__ . '/console/config/bootstrap.php';
|
||||
|
||||
$config = yii\helpers\ArrayHelper::merge(
|
||||
require __DIR__ . '/common/config/main.php',
|
||||
require __DIR__ . '/common/config/main-local.php',
|
||||
require __DIR__ . '/console/config/main.php',
|
||||
require __DIR__ . '/console/config/main-local.php'
|
||||
);
|
||||
|
||||
$application = new yii\console\Application($config);
|
||||
$exitCode = $application->run();
|
||||
exit($exitCode);
|
23
environments/dev/yii_test
Normal file
23
environments/dev/yii_test
Normal file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
* Yii console bootstrap file.
|
||||
*/
|
||||
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', true);
|
||||
defined('YII_ENV') or define('YII_ENV', 'test');
|
||||
|
||||
require __DIR__ . '/vendor/autoload.php';
|
||||
require __DIR__ . '/vendor/yiisoft/yii2/Yii.php';
|
||||
require __DIR__ . '/common/config/bootstrap.php';
|
||||
require __DIR__ . '/console/config/bootstrap.php';
|
||||
|
||||
$config = yii\helpers\ArrayHelper::merge(
|
||||
require __DIR__ . '/common/config/test-local.php',
|
||||
require __DIR__ . '/console/config/main.php',
|
||||
require __DIR__ . '/console/config/main-local.php'
|
||||
);
|
||||
|
||||
$application = new yii\console\Application($config);
|
||||
$exitCode = $application->run();
|
||||
exit($exitCode);
|
15
environments/dev/yii_test.bat
Normal file
15
environments/dev/yii_test.bat
Normal file
@ -0,0 +1,15 @@
|
||||
@echo off
|
||||
|
||||
rem -------------------------------------------------------------
|
||||
rem Yii command line bootstrap script for Windows.
|
||||
rem -------------------------------------------------------------
|
||||
|
||||
@setlocal
|
||||
|
||||
set YII_PATH=%~dp0
|
||||
|
||||
if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe
|
||||
|
||||
"%PHP_COMMAND%" "%YII_PATH%yii_test" %*
|
||||
|
||||
@endlocal
|
Reference in New Issue
Block a user