Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
王兴勇
/
helper-config
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f41316a6
authored
Nov 03, 2017
by
王兴勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-m
parent
59c8a2df
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
README.MD
+7
-7
No files found.
README.MD
View file @
f41316a6
#快捷功能
###功能
#
快捷功能
###
功能
1.
模拟会员登陆
2.
模拟Admin后台登陆
3.
快捷切换数据连接
###警告
###
警告
>以下所有配置文件名不能出现 . 这个符号,如果文件名出现 . 这个符号会被转成对应的目录分隔符 /
###模块引入
###
模块引入
>在 `shopnc.php` 头部
```
php
require
sprintf
(
'%s%sconfig%2$scommon.php'
,
dirname
(
__DIR__
),
DIRECTORY_SEPARATOR
);
```
###数据库快捷切换功能
###
数据库快捷切换功能
修改
`data/config/config.ini.php`
中修改 mysql 配置参数
```
php
...
...
...
@@ -35,7 +35,7 @@ $config['db']['master']['dbname'] = $__DB_CONFIG['dbname'];
*/
$__DB_CONFIG
=
require_db_config
(
$config_name
);
```
#####以下一断是为了兼容命令行模式执行PHP时使用,不使用命令行可忽略
#####
以下一断是为了兼容命令行模式执行PHP时使用,不使用命令行可忽略
```
php
//在 config.ini.php 文件头部写入以下代码
if
(
!
function_exists
(
'require_db_config'
))
{
...
...
@@ -44,7 +44,7 @@ if ( ! function_exists('require_db_config')) {
$__DB_CONFIG
=
require_db_config
(
'local'
);
}
```
###用户模拟登陆
###
用户模拟登陆
>使用 `faker_login` 来实现数据库连接快速切换
>个人在 `shopnc.php` 底部使用 `faker_login`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment