Commit 336cd64f authored by xiabin's avatar xiabin

添加生产环境配置

parent dd36f3f9
<?php <?php
return [
$config = [
'components' => [ 'components' => [
'request' => [ 'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
...@@ -7,3 +8,6 @@ return [ ...@@ -7,3 +8,6 @@ return [
], ],
], ],
]; ];
return $config;
<?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.');
}
if(!function_exists('fnmatch')) {
function fnmatch($pattern, $string) {
return preg_match("#^".strtr(preg_quote($pattern, '#'), array('\*' => '.*', '\?' => '.'))."$#i", $string);
} // end
} // end if
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__ . '/../../tests/codeception/config/backend/acceptance.php');
(new yii\web\Application($config))->run();
<?php <?php
defined('YII_DEBUG') or define('YII_DEBUG', false); defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'prod'); defined('YII_ENV') or define('YII_ENV', 'dev');
if(!function_exists('fnmatch')) {
function fnmatch($pattern, $string) {
return preg_match("#^".strtr(preg_quote($pattern, '#'), array('\*' => '.*', '\?' => '.'))."$#i", $string);
} // end
} // end if
require(__DIR__ . '/../../vendor/autoload.php'); require(__DIR__ . '/../../vendor/autoload.php');
require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php'); require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
require(__DIR__ . '/../../common/config/bootstrap.php'); require(__DIR__ . '/../../common/config/bootstrap.php');
......
<?php <?php
return [ return [
'components' => [ 'components' => [
'cache' => [
'class' => 'yii\redis\Cache',
'redis' => [
'hostname' => '192.168.1.12',
'port' => 6380,
'database' => 2,
]
],
'db' => [ 'db' => [
'class' => 'yii\db\Connection', 'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=yii2advanced', 'dsn' => 'mysql:host=192.168.1.7;port:3305;dbname=pp_c',
'username' => 'root', 'username' => 'pp_c',
'password' => '', 'password' => 'nF@V5LK#ilb!NEvZ@1Ze#rWm#H',
'charset' => 'utf8', 'charset' => 'utf8',
], ],
'redis' => [
'class' => 'yii\redis\Connection',
'hostname' => '192.168.1.21',
'port' => 6380,
'database' => 2,
],
'mailer' => [ 'mailer' => [
'class' => 'yii\swiftmailer\Mailer', 'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail', '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,
], ],
'qiniu' => [
'class' => 'common\components\Qiniu',
'accessKey' => 'n85SCPB9uO2v32az-3TRFsZCXwJu7YddyzLRYXg-',
'secretKey' => 'KDl3b7aLpj7n9YZ07lHGivVY4c_Q-0QSM0TZ_-XS',
'storages' => [
'public' => [
'bucket' => 'pp-classroom',
'fsizeLimit' => pow(1024, 2) * 5, //5MB
'mimeLimit' => 'image/jpeg;image/png;image/gif',
'url' => 'http://dev.qdn.pp.cc/'
],
'video' => [
'bucket' => 'pp-classroom-private',
'fsizeLimit' => pow(1024, 3) * 2, //2GB
'mimeLimit' => 'video/*;flv-application/octet-stream',
'url' => 'http://oe9d6dr84.bkt.clouddn.com/'
]
]
]
], ],
]; ];
<?php <?php
return [ return [
'adminEmail' => 'admin@example.com',
'supportEmail' => 'support@example.com',
'user.passwordResetTokenExpire' => 3600,
'captchaId' => '4d6ad870bf63a30be3d22c92925b04ca',
'privateKey' => 'a2ca5e5139d1f43ac4e1cd248f3e52e4',
'msg.host' => 'http://114.55.132.75:7893/sms.aspx',
'msg.userid' => '78',
'msg.account' => '276147613x',
'msg.password' => '276147613',
'msg.signature' => '【最课堂】',
'alipay' => [
'partner' => '2088701843067550',
'seller_id' => '2088701843067550',
'key' => '12vr33u4g314hytde3g81oao9dfdarm6',
'notify_url' => 'http://c.pp.cc/pay/alipay-notify',
'return_url' => 'http://商户网址/create_direct_pay_by_user-PHP-UTF-8/return_url.php',
'sign_type' => strtoupper('MD5'),
'input_charset' => strtolower('utf-8'),
'cacert' => getcwd() . '\\cacert.pem',
'transport' => 'http',
'payment_type' => '1',
'service' => 'create_direct_pay_by_user',
],
// 'weixinpay'=>[
// 'appid'=>'wx180521eb22e9d7af',
// 'mchid'=>'1295461001',
// 'key'=>'ejg0l9phOAkp021qB54shz0Q8Tiscwzy',
// 'appsecret'=>'f20293c9548c469fb8b855fc98c4ef3c',
//
// ]
'weixinpay' => [
'appid' => 'wx5714a24a60083b2a',
'mchid' => '1399794002',
'key' => '8934e7d15453e97507ef794cf7b0519d',
'appsecret' => '7c18222c6ec31efa65d21606a629585d',
]
]; ];
<?php <?php
return [
$config = [
'components' => [ 'components' => [
'request' => [ 'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation 'cookieValidationKey' => '1o1zEUf8jdBvsnZy_JygPUO5_sZ7zBci',
'cookieValidationKey' => '', ],
'session' => [
'timeout' => 3600,
'name' => 'zuiektang-frontend',
'class' => 'yii\redis\Session',
'redis' => [
'hostname' => '192.168.1.21',
'port' => 6380,
'database' => 2,
]
], ],
], ],
]; ];
return $config;
<?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.');
}
if(!function_exists('fnmatch')) {
function fnmatch($pattern, $string) {
return preg_match("#^".strtr(preg_quote($pattern, '#'), array('\*' => '.*', '\?' => '.'))."$#i", $string);
} // end
} // end if
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__ . '/../../tests/codeception/config/frontend/acceptance.php');
(new yii\web\Application($config))->run();
<?php <?php
defined('YII_DEBUG') or define('YII_DEBUG', false); defined('YII_DEBUG') or define('YII_DEBUG', false);
defined('YII_ENV') or define('YII_ENV', 'prod'); defined('YII_ENV') or define('YII_ENV', 'prod');
if(!function_exists('fnmatch')) {
function fnmatch($pattern, $string) {
return preg_match("#^".strtr(preg_quote($pattern, '#'), array('\*' => '.*', '\?' => '.'))."$#i", $string);
} // end
} // end if
require(__DIR__ . '/../../vendor/autoload.php'); require(__DIR__ . '/../../vendor/autoload.php');
require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php'); require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
require(__DIR__ . '/../../common/config/bootstrap.php'); require(__DIR__ . '/../../common/config/bootstrap.php');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment