Skip to content

Commit

Permalink
修改配置方法
Browse files Browse the repository at this point in the history
  • Loading branch information
yidashi committed Jun 17, 2016
1 parent e924bcc commit 869043e
Show file tree
Hide file tree
Showing 35 changed files with 212 additions and 370 deletions.
55 changes: 55 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Framework
# ---------
YII_DEBUG = true
YII_ENV = dev

# App
# ---------
APP_NAME = 饮水思源

# Databases
# ---------
DB_DSN = mysql:host=127.0.0.1;port=3306;dbname=yii
DB_USERNAME = root
DB_PASSWORD = root
DB_TABLE_PREFIX = pop_

TEST_DB_DSN = mysql:host=localhost;port=3306;dbname=yii
TEST_DB_USERNAME = root
TEST_DB_PASSWORD = root
TEST_DB_TABLE_PREFIX = pop_

# Redis
# --------
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

# Urls
# ----
FRONTEND_URL = http:https://www.51siyuan.cn
BACKEND_URL = http:https://www.51siyuan.cn/admin
STATIC_URL = http:https://image.51siyuan.cn


# Mail
# ---------

MAIL_DRIVER=smtp
MAIL_HOST=smtp.163.com
MAIL_PORT=25
MAIL_USERNAME=your_mail_username
MAIL_PASSWORD=your_mail_password
MAIL_ENCRYPTION=null


# Other
# -----

FRONTEND_COOKIE_VALIDATION_KEY = QYeL37kRMbCg1X9kmTzC3ctJqCVcqj1Y
BACKEND_COOKIE_VALIDATION_KEY = c0AXETckg6V4dYDAPlp0iQNgQHYhKXqM

ADMIN_EMAIL = [email protected]
ROBOT_EMAIL = [email protected]


11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# yii console command
/yii

# phpstorm project files
.idea

Expand Down Expand Up @@ -28,4 +25,10 @@ composer.phar
phpunit.phar
# local phpunit config
/phpunit.xml
/dump.rdb

# redis
dump.rdb


# env
.env
12 changes: 7 additions & 5 deletions common/config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
Yii::setAlias('api', dirname(dirname(__DIR__)) . '/api');
Yii::setAlias('console', dirname(dirname(__DIR__)) . '/console');
Yii::setAlias('tests', dirname(dirname(__DIR__)) . '/tests');
Yii::setAlias('database', dirname(dirname(__DIR__)) . '/database');





Yii::setAlias('runnerScript', dirname(dirname(dirname(__FILE__))) .'/yii');
Yii::setAlias('staticroot', dirname(dirname(__DIR__)) . '/web/static');
if (YII_ENV_PROD) {
Yii::setAlias('static', 'http:https://image.51siyuan.cn');
} else {
Yii::setAlias('static', 'http:https://127.0.0.1/yii/web/static');
}
Yii::setAlias('static', env('STATIC_URL'));
2 changes: 1 addition & 1 deletion common/config/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'runtimePath' => dirname(dirname(__DIR__)).'/runtime',
'timezone' => 'PRC',
'language' => 'zh-CN',
'name' => '饮水思源',
'name' => env('APP_NAME'),
'components' => [
'cache' => [
'class' => 'yii\caching\FileCache',
Expand Down
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"yidashi/yii2-bootstrap-markdown": "^1.0",
"mihaildev/yii2-elfinder": "^1.0",
"qiniu/php-sdk": "^7.0",
"omnilight/yii2-scheduling": "*"
"omnilight/yii2-scheduling": "*",
"vlucas/phpdotenv": "^2.0"
},
"require-dev": {
"yiisoft/yii2-codeception": "*",
Expand All @@ -43,6 +44,11 @@
"yiisoft/yii2-faker": "*",
"jamband/yii2-schemadump": "*"
},
"autoload": {
"files": [
"helpers.php"
]
},
"config": {
"process-timeout": 1800
},
Expand Down
54 changes: 52 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions console/config/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
'migrate' => [
'class' => 'yii\console\controllers\MigrateController',
'templateFile' => '@jamband/schemadump/template.php',
'useTablePrefix' => true,
'migrationPath' => '@database/migrations',
],
'schemadump' => [
'class' => 'jamband\schemadump\SchemaDumpController',
Expand Down
File renamed without changes.
File renamed without changes.
33 changes: 0 additions & 33 deletions environments/dev/backend/config/main-local.php

This file was deleted.

4 changes: 0 additions & 4 deletions environments/dev/backend/config/params-local.php

This file was deleted.

28 changes: 0 additions & 28 deletions environments/dev/common/config/main-local.php

This file was deleted.

11 changes: 0 additions & 11 deletions environments/dev/common/config/params-local.php

This file was deleted.

18 changes: 0 additions & 18 deletions environments/dev/console/config/main-local.php

This file was deleted.

4 changes: 0 additions & 4 deletions environments/dev/console/config/params-local.php

This file was deleted.

31 changes: 0 additions & 31 deletions environments/dev/frontend/config/main-local.php

This file was deleted.

4 changes: 0 additions & 4 deletions environments/dev/frontend/config/params-local.php

This file was deleted.

Loading

0 comments on commit 869043e

Please sign in to comment.