Skip to content

Commit

Permalink
change config
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Jul 3, 2016
1 parent c36c3c3 commit 0fb17b4
Show file tree
Hide file tree
Showing 40 changed files with 586 additions and 16 deletions.
2 changes: 1 addition & 1 deletion appfront/config/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'id' => 'app-front',
'basePath' => dirname(__DIR__),
//'bootstrap' => ['log'],
'controllerNamespace' => 'appafront\controllers',
'controllerNamespace' => 'appfront\controllers',
# compress css and js to one file,
//'bootstrap' => ['assetsAutoCompress'],
'components' => [
Expand Down
1 change: 1 addition & 0 deletions apphtml5/config/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php
20 changes: 20 additions & 0 deletions apphtml5/config/fecshop_local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
# 本文件在app/web/index.php 处引入。

# fecshop的核心模块
$modules = [];
foreach (glob(__DIR__ . '/fecshop_local_modules/*.php') as $filename){
$modules = array_merge($modules,require($filename));
}
# 服务器组件
$services = [];
foreach (glob(__DIR__ . '/fecshop_local_services/*.php') as $filename){
$services = array_merge($services,require($filename));
}


return [
'modules'=>$modules,
'components' => $services,
//'bootstrap' => ['store'],
];
2 changes: 2 additions & 0 deletions apphtml5/config/fecshop_local_modules/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
2 changes: 2 additions & 0 deletions apphtml5/config/fecshop_local_services/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
97 changes: 97 additions & 0 deletions apphtml5/config/main.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);


return [
'id' => 'app-html5',
'basePath' => dirname(__DIR__),
//'bootstrap' => ['log'],
'controllerNamespace' => 'apphtml5\controllers',
# compress css and js to one file,
//'bootstrap' => ['assetsAutoCompress'],
'components' => [
/*
# compress css and js to one file,
'assetsAutoCompress' =>
[
'class' => '\skeeks\yii2\assetsAuto\AssetsAutoCompressComponent',
'enabled' => true,
'jsCompress' => true,
'cssFileCompile' => true,
'jsFileCompile' => true,
],
*/



'session' => [
# use mongodb storage session data
//'class' => 'yii\mongodb\Session',
//'db' => 'mongodb',
//'sessionCollection' => 'session',
# use redis storage session data
'class' => 'yii\redis\Session',
# session time out time.
'timeout' => 6000,

],

'cache' => [
'class' => 'yii\redis\Cache',
'keyPrefix' => 'apphtml5',
],



'urlManager' => [
'class' => 'yii\web\UrlManager',
'enablePrettyUrl' => true,
'showScriptName' => false,
],

'request' => [
'class' => 'fecshop\services\Request',
/*
'enableCookieValidation' => true,
'enableCsrfValidation' => true,
'noCsrfRoutes' => [
'catalog/product/addreview',
'favorite/product/remark',
'paypal/ipn/index',
'paypal/ipn',
],
*/
],

/*
'view' => [
'theme' => [
'pathMap' => ['@app/views' => '@app/themes/adminlte'],
'baseUrl' => '@web/themes/adminlte',
],
],
//添加js,css;
'assetManager' => [
//'converter' => [
// 'forceConversion' => true,
//],
'bundles' => [
'yii\bootstrap\BootstrapAsset' => [
'basePath' => '@webroot',
'baseUrl' => '@web',
'css' => ['assets/176d11b6/css/bootstrap.css'],
'js' => ['js/web.js','js/My97DatePicker/WdatePicker.js'],
],
],
],
*/
],
# 自定义参数
'params' => $params,
];
4 changes: 4 additions & 0 deletions apphtml5/config/params.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
return [
'adminEmail' => 'admin@example.com',
];
2 changes: 2 additions & 0 deletions apphtml5/runtime/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
2 changes: 2 additions & 0 deletions apphtml5/web/assets/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
Binary file added apphtml5/web/favicon.ico
Binary file not shown.
2 changes: 2 additions & 0 deletions apphtml5/web/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow:
1 change: 1 addition & 0 deletions appserver/config/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php
20 changes: 20 additions & 0 deletions appserver/config/fecshop_local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
# 本文件在app/web/index.php 处引入。

# fecshop的核心模块
$modules = [];
foreach (glob(__DIR__ . '/fecshop_local_modules/*.php') as $filename){
$modules = array_merge($modules,require($filename));
}
# 服务器组件
$services = [];
foreach (glob(__DIR__ . '/fecshop_local_services/*.php') as $filename){
$services = array_merge($services,require($filename));
}


return [
'modules'=>$modules,
'components' => $services,
//'bootstrap' => ['store'],
];
2 changes: 2 additions & 0 deletions appserver/config/fecshop_local_modules/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
2 changes: 2 additions & 0 deletions appserver/config/fecshop_local_services/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
97 changes: 97 additions & 0 deletions appserver/config/main.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);


return [
'id' => 'app-server',
'basePath' => dirname(__DIR__),
//'bootstrap' => ['log'],
'controllerNamespace' => 'appserver\controllers',
# compress css and js to one file,
//'bootstrap' => ['assetsAutoCompress'],
'components' => [
/*
# compress css and js to one file,
'assetsAutoCompress' =>
[
'class' => '\skeeks\yii2\assetsAuto\AssetsAutoCompressComponent',
'enabled' => true,
'jsCompress' => true,
'cssFileCompile' => true,
'jsFileCompile' => true,
],
*/



'session' => [
# use mongodb storage session data
//'class' => 'yii\mongodb\Session',
//'db' => 'mongodb',
//'sessionCollection' => 'session',
# use redis storage session data
'class' => 'yii\redis\Session',
# session time out time.
'timeout' => 6000,

],

'cache' => [
'class' => 'yii\redis\Cache',
'keyPrefix' => 'appserver',
],



'urlManager' => [
'class' => 'yii\web\UrlManager',
'enablePrettyUrl' => true,
'showScriptName' => false,
],

'request' => [
'class' => 'fecshop\services\Request',
/*
'enableCookieValidation' => true,
'enableCsrfValidation' => true,
'noCsrfRoutes' => [
'catalog/product/addreview',
'favorite/product/remark',
'paypal/ipn/index',
'paypal/ipn',
],
*/
],

/*
'view' => [
'theme' => [
'pathMap' => ['@app/views' => '@app/themes/adminlte'],
'baseUrl' => '@web/themes/adminlte',
],
],
//添加js,css;
'assetManager' => [
//'converter' => [
// 'forceConversion' => true,
//],
'bundles' => [
'yii\bootstrap\BootstrapAsset' => [
'basePath' => '@webroot',
'baseUrl' => '@web',
'css' => ['assets/176d11b6/css/bootstrap.css'],
'js' => ['js/web.js','js/My97DatePicker/WdatePicker.js'],
],
],
],
*/
],
# 自定义参数
'params' => $params,
];
4 changes: 4 additions & 0 deletions appserver/config/params.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
return [
'adminEmail' => 'admin@example.com',
];
2 changes: 2 additions & 0 deletions appserver/runtime/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
2 changes: 2 additions & 0 deletions appserver/web/assets/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
Binary file added appserver/web/favicon.ico
Binary file not shown.
2 changes: 2 additions & 0 deletions appserver/web/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow:
7 changes: 5 additions & 2 deletions environments/dev/appadmin/web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
require(__DIR__ . '/../../common/config/main-local.php'),
require(__DIR__ . '/../config/main.php'),
require(__DIR__ . '/../config/main-local.php'),
# fecshop base
# fecshop base config
require(__DIR__ . '/../../vendor/fancyecommerce/fecshop/config/fecshop.php'),
# fecshop module base
# fecshop module config
require(__DIR__ . '/../../vendor/fancyecommerce/fecshop/app/appadmin/config/appadmin.php'),
# Third-party partners config

# developer local config
require(__DIR__ . '/../config/fecshop_local.php')

);
Expand Down
11 changes: 5 additions & 6 deletions environments/dev/appfront/web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
require(__DIR__ . '/../../common/config/main-local.php'),
require(__DIR__ . '/../config/main.php'),
require(__DIR__ . '/../config/main-local.php'),
# fecshop base
# fecshop base config
require(__DIR__ . '/../../vendor/fancyecommerce/fecshop/config/fecshop.php'),
# fecshop module base
require(__DIR__ . '/../../vendor/fancyecommerce/fecshop/app/appadmin/config/appadmin.php'),
# fecshop module config
require(__DIR__ . '/../../vendor/fancyecommerce/fecshop/app/appfront/config/appfront.php'),
# Third-party partners config

# thrid part confing

# user local config.
# developer local config
require(__DIR__ . '/../config/fecshop_local.php')

);
Expand Down
36 changes: 36 additions & 0 deletions environments/dev/apphtml5/config/main-local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

$config = [
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => '',
],
'redis' => [
'class' => 'yii\redis\Connection',
'hostname' => 'localhost',
'port' => 6379,
'database' => '1',
# connect redis with unix Stock
//'unixSocket' => '/var/run/redis/redis.sock',
# redis password
#'password' => 'xxxx',

],
],
];

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 changes: 3 additions & 0 deletions environments/dev/apphtml5/config/params-local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
return [
];
19 changes: 19 additions & 0 deletions environments/dev/apphtml5/web/index-test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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__ . '/../../tests/codeception/config/backend/acceptance.php');

(new yii\web\Application($config))->run();

0 comments on commit 0fb17b4

Please sign in to comment.