Initial commit
This commit is contained in:
16
environments/dev/common/config/codeception-local.php
Normal file
16
environments/dev/common/config/codeception-local.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
return yii\helpers\ArrayHelper::merge(
|
||||
require __DIR__ . '/main.php',
|
||||
require __DIR__ . '/main-local.php',
|
||||
require __DIR__ . '/test.php',
|
||||
require __DIR__ . '/test-local.php',
|
||||
[
|
||||
'components' => [
|
||||
'request' => [
|
||||
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
|
||||
'cookieValidationKey' => '',
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
23
environments/dev/common/config/main-local.php
Normal file
23
environments/dev/common/config/main-local.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'components' => [
|
||||
'db' => [
|
||||
'class' => \yii\db\Connection::class,
|
||||
'dsn' => 'mysql:host=mysql;dbname=app',
|
||||
'username' => 'app',
|
||||
'password' => '123',
|
||||
'charset' => 'utf8',
|
||||
],
|
||||
'queue' => [
|
||||
'class' => \yii\queue\sync\Queue::class,
|
||||
'handle' => true, // whether tasks should be executed immediately
|
||||
],
|
||||
'mailer' => [
|
||||
'class' => \yii\symfonymailer\Mailer::class,
|
||||
'viewPath' => '@common/mail',
|
||||
// send all mails to a file by default.
|
||||
'useFileTransport' => true,
|
||||
],
|
||||
],
|
||||
];
|
||||
8
environments/dev/common/config/params-local.php
Normal file
8
environments/dev/common/config/params-local.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'company_name' => 'Five Devs',
|
||||
'product_name' => 'Calorie',
|
||||
'sonar.url' => 'https://yourname.sonar.software', # no trailing slash
|
||||
'sonar.bearerToken' => '',
|
||||
];
|
||||
9
environments/dev/common/config/test-local.php
Normal file
9
environments/dev/common/config/test-local.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'components' => [
|
||||
'db' => [
|
||||
'dsn' => 'mysql:host=localhost;dbname=yii2advanced_test',
|
||||
],
|
||||
],
|
||||
];
|
||||
8
environments/dev/console/config/main-local.php
Normal file
8
environments/dev/console/config/main-local.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'bootstrap' => ['gii'],
|
||||
'modules' => [
|
||||
'gii' => 'yii\gii\Module',
|
||||
],
|
||||
];
|
||||
4
environments/dev/console/config/params-local.php
Normal file
4
environments/dev/console/config/params-local.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
];
|
||||
4
environments/dev/console/config/test-local.php
Normal file
4
environments/dev/console/config/test-local.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
];
|
||||
11
environments/dev/frontend/config/codeception-local.php
Normal file
11
environments/dev/frontend/config/codeception-local.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
return yii\helpers\ArrayHelper::merge(
|
||||
require dirname(dirname(__DIR__)) . '/common/config/codeception-local.php',
|
||||
require __DIR__ . '/main.php',
|
||||
require __DIR__ . '/main-local.php',
|
||||
require __DIR__ . '/test.php',
|
||||
require __DIR__ . '/test-local.php',
|
||||
[
|
||||
]
|
||||
);
|
||||
27
environments/dev/frontend/config/main-local.php
Normal file
27
environments/dev/frontend/config/main-local.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?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::class,
|
||||
'allowedIPs' => ['*'],
|
||||
];
|
||||
|
||||
$config['bootstrap'][] = 'gii';
|
||||
$config['modules']['gii'] = [
|
||||
'class' => \yii\gii\Module::class,
|
||||
'allowedIPs' => ['*'],
|
||||
];
|
||||
}
|
||||
|
||||
return $config;
|
||||
4
environments/dev/frontend/config/params-local.php
Normal file
4
environments/dev/frontend/config/params-local.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
];
|
||||
4
environments/dev/frontend/config/test-local.php
Normal file
4
environments/dev/frontend/config/test-local.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
];
|
||||
28
environments/dev/frontend/web/index-test.php
Normal file
28
environments/dev/frontend/web/index-test.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?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 = yii\helpers\ArrayHelper::merge(
|
||||
require __DIR__ . '/../../common/config/main.php',
|
||||
require __DIR__ . '/../../common/config/main-local.php',
|
||||
require __DIR__ . '/../../common/config/test.php',
|
||||
require __DIR__ . '/../../common/config/test-local.php',
|
||||
require __DIR__ . '/../config/main.php',
|
||||
require __DIR__ . '/../config/main-local.php',
|
||||
require __DIR__ . '/../config/test.php',
|
||||
require __DIR__ . '/../config/test-local.php'
|
||||
);
|
||||
|
||||
(new yii\web\Application($config))->run();
|
||||
18
environments/dev/frontend/web/index.php
Normal file
18
environments/dev/frontend/web/index.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?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);
|
||||
28
environments/dev/yii_test
Normal file
28
environments/dev/yii_test
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/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/main.php',
|
||||
require __DIR__ . '/common/config/main-local.php',
|
||||
require __DIR__ . '/common/config/test.php',
|
||||
require __DIR__ . '/common/config/test-local.php',
|
||||
require __DIR__ . '/console/config/main.php',
|
||||
require __DIR__ . '/console/config/main-local.php',
|
||||
require __DIR__ . '/console/config/test.php',
|
||||
require __DIR__ . '/console/config/test-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
|
||||
78
environments/index.php
Normal file
78
environments/index.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* The manifest of files that are local to specific environment.
|
||||
* This file returns a list of environments that the application
|
||||
* may be installed under. The returned data must be in the following
|
||||
* format:
|
||||
*
|
||||
* ```php
|
||||
* return [
|
||||
* 'environment name' => [
|
||||
* 'path' => 'directory storing the local files',
|
||||
* 'skipFiles' => [
|
||||
* // list of files that should only be copied once and skipped if they already exist
|
||||
* ],
|
||||
* 'setWritable' => [
|
||||
* // list of directories that should be set writable
|
||||
* ],
|
||||
* 'setExecutable' => [
|
||||
* // list of files that should be set executable
|
||||
* ],
|
||||
* 'setCookieValidationKey' => [
|
||||
* // list of config files that need to be inserted with automatically generated cookie validation keys
|
||||
* ],
|
||||
* 'createSymlink' => [
|
||||
* // list of symlinks to be created. Keys are symlinks, and values are the targets.
|
||||
* ],
|
||||
* ],
|
||||
* ];
|
||||
* ```
|
||||
*/
|
||||
return [
|
||||
'Development' => [
|
||||
'path' => 'dev',
|
||||
'setWritable' => [
|
||||
'console/runtime',
|
||||
'frontend/runtime',
|
||||
'frontend/web/assets',
|
||||
],
|
||||
'setExecutable' => [
|
||||
'yii',
|
||||
'yii_test',
|
||||
],
|
||||
'setCookieValidationKey' => [
|
||||
'common/config/codeception-local.php',
|
||||
'frontend/config/main-local.php',
|
||||
],
|
||||
],
|
||||
'Testing' => [
|
||||
'path' => 'test',
|
||||
'setWritable' => [
|
||||
'console/runtime',
|
||||
'frontend/runtime',
|
||||
'frontend/web/assets',
|
||||
],
|
||||
'setExecutable' => [
|
||||
'yii',
|
||||
'yii_test',
|
||||
],
|
||||
'setCookieValidationKey' => [
|
||||
'common/config/codeception-local.php',
|
||||
'frontend/config/main-local.php',
|
||||
],
|
||||
],
|
||||
'Production' => [
|
||||
'path' => 'prod',
|
||||
'setWritable' => [
|
||||
'console/runtime',
|
||||
'frontend/runtime',
|
||||
'frontend/web/assets',
|
||||
],
|
||||
'setExecutable' => [
|
||||
'yii',
|
||||
],
|
||||
'setCookieValidationKey' => [
|
||||
'frontend/config/main-local.php',
|
||||
],
|
||||
],
|
||||
];
|
||||
32
environments/prod/common/config/main-local.php
Normal file
32
environments/prod/common/config/main-local.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Connection;
|
||||
use yii\queue\db\Queue;
|
||||
use yii\symfonymailer\Mailer;
|
||||
|
||||
return [
|
||||
'components' => [
|
||||
'db' => [
|
||||
'class' => Connection::class,
|
||||
'dsn' => 'mysql:host=localhost;dbname=app',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'charset' => 'utf8',
|
||||
],
|
||||
'queue' => [
|
||||
'class' => Queue::class,
|
||||
'db' => 'db', // DB connection component or its config
|
||||
'tableName' => '{{%queue}}', // Table name
|
||||
'channel' => 'default', // Queue channel key
|
||||
'mutex' => 'yii\mutex\MysqlMutex', // Mutex used to sync queries
|
||||
'as log' => 'yii\queue\LogBehavior',
|
||||
//'as deadLetterBehavior' => \common\behaviors\DeadLetterQueue::class,
|
||||
'ttr' => 5 * 60, // Max time for anything job handling
|
||||
'attempts' => 3, // Max number of attempts
|
||||
],
|
||||
'mailer' => [
|
||||
'class' => Mailer::class,
|
||||
'viewPath' => '@common/mail',
|
||||
],
|
||||
],
|
||||
];
|
||||
4
environments/prod/common/config/params-local.php
Normal file
4
environments/prod/common/config/params-local.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
];
|
||||
4
environments/prod/console/config/main-local.php
Normal file
4
environments/prod/console/config/main-local.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
];
|
||||
4
environments/prod/console/config/params-local.php
Normal file
4
environments/prod/console/config/params-local.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
];
|
||||
10
environments/prod/frontend/config/main-local.php
Normal file
10
environments/prod/frontend/config/main-local.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'components' => [
|
||||
'request' => [
|
||||
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
|
||||
'cookieValidationKey' => '',
|
||||
],
|
||||
],
|
||||
];
|
||||
4
environments/prod/frontend/config/params-local.php
Normal file
4
environments/prod/frontend/config/params-local.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
];
|
||||
18
environments/prod/frontend/web/index.php
Normal file
18
environments/prod/frontend/web/index.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', false);
|
||||
defined('YII_ENV') or define('YII_ENV', 'prod');
|
||||
|
||||
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/prod/frontend/web/robots.txt
Normal file
2
environments/prod/frontend/web/robots.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Allow: /
|
||||
24
environments/prod/yii
Normal file
24
environments/prod/yii
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
* Yii console bootstrap file.
|
||||
*/
|
||||
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', false);
|
||||
defined('YII_ENV') or define('YII_ENV', 'prod');
|
||||
|
||||
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);
|
||||
16
environments/test/common/config/codeception-local.php
Normal file
16
environments/test/common/config/codeception-local.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
return yii\helpers\ArrayHelper::merge(
|
||||
require __DIR__ . '/main.php',
|
||||
require __DIR__ . '/main-local.php',
|
||||
require __DIR__ . '/test.php',
|
||||
require __DIR__ . '/test-local.php',
|
||||
[
|
||||
'components' => [
|
||||
'request' => [
|
||||
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
|
||||
'cookieValidationKey' => '',
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
13
environments/test/common/config/main-local.php
Normal file
13
environments/test/common/config/main-local.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'components' => [
|
||||
'db' => [
|
||||
'class' => \yii\db\Connection::class,
|
||||
'dsn' => 'mysql:host=mysql;dbname=app',
|
||||
'username' => 'app',
|
||||
'password' => '123',
|
||||
'charset' => 'utf8',
|
||||
],
|
||||
],
|
||||
];
|
||||
4
environments/test/common/config/params-local.php
Normal file
4
environments/test/common/config/params-local.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
];
|
||||
9
environments/test/common/config/test-local.php
Normal file
9
environments/test/common/config/test-local.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'components' => [
|
||||
'db' => [
|
||||
'dsn' => 'mysql:host=localhost;dbname=yii2advanced_test',
|
||||
],
|
||||
],
|
||||
];
|
||||
8
environments/test/console/config/main-local.php
Normal file
8
environments/test/console/config/main-local.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'bootstrap' => ['gii'],
|
||||
'modules' => [
|
||||
'gii' => 'yii\gii\Module',
|
||||
],
|
||||
];
|
||||
4
environments/test/console/config/params-local.php
Normal file
4
environments/test/console/config/params-local.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
];
|
||||
4
environments/test/console/config/test-local.php
Normal file
4
environments/test/console/config/test-local.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
];
|
||||
11
environments/test/frontend/config/codeception-local.php
Normal file
11
environments/test/frontend/config/codeception-local.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
return yii\helpers\ArrayHelper::merge(
|
||||
require dirname(dirname(__DIR__)) . '/common/config/codeception-local.php',
|
||||
require __DIR__ . '/main.php',
|
||||
require __DIR__ . '/main-local.php',
|
||||
require __DIR__ . '/test.php',
|
||||
require __DIR__ . '/test-local.php',
|
||||
[
|
||||
]
|
||||
);
|
||||
12
environments/test/frontend/config/main-local.php
Normal file
12
environments/test/frontend/config/main-local.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
$config = [
|
||||
'components' => [
|
||||
'request' => [
|
||||
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
|
||||
'cookieValidationKey' => '',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
return $config;
|
||||
4
environments/test/frontend/config/params-local.php
Normal file
4
environments/test/frontend/config/params-local.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
];
|
||||
4
environments/test/frontend/config/test-local.php
Normal file
4
environments/test/frontend/config/test-local.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
];
|
||||
28
environments/test/frontend/web/index-test.php
Normal file
28
environments/test/frontend/web/index-test.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?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 = yii\helpers\ArrayHelper::merge(
|
||||
require __DIR__ . '/../../common/config/main.php',
|
||||
require __DIR__ . '/../../common/config/main-local.php',
|
||||
require __DIR__ . '/../../common/config/test.php',
|
||||
require __DIR__ . '/../../common/config/test-local.php',
|
||||
require __DIR__ . '/../config/main.php',
|
||||
require __DIR__ . '/../config/main-local.php',
|
||||
require __DIR__ . '/../config/test.php',
|
||||
require __DIR__ . '/../config/test-local.php'
|
||||
);
|
||||
|
||||
(new yii\web\Application($config))->run();
|
||||
18
environments/test/frontend/web/index.php
Normal file
18
environments/test/frontend/web/index.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
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 = 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/test/frontend/web/robots.txt
Normal file
2
environments/test/frontend/web/robots.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Disallow: /
|
||||
24
environments/test/yii
Normal file
24
environments/test/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);
|
||||
28
environments/test/yii_test
Normal file
28
environments/test/yii_test
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/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/main.php',
|
||||
require __DIR__ . '/common/config/main-local.php',
|
||||
require __DIR__ . '/common/config/test.php',
|
||||
require __DIR__ . '/common/config/test-local.php',
|
||||
require __DIR__ . '/console/config/main.php',
|
||||
require __DIR__ . '/console/config/main-local.php',
|
||||
require __DIR__ . '/console/config/test.php',
|
||||
require __DIR__ . '/console/config/test-local.php'
|
||||
);
|
||||
|
||||
$application = new yii\console\Application($config);
|
||||
$exitCode = $application->run();
|
||||
exit($exitCode);
|
||||
15
environments/test/yii_test.bat
Normal file
15
environments/test/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