Skip to content

Commit

Permalink
更新:/docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dxkite committed Jul 19, 2019
1 parent ce4141c commit 6ac5054
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 19 deletions.
8 changes: 4 additions & 4 deletions docs/05-database.md
@@ -1,6 +1,6 @@
# 数据库

在框架中,提供了对数据库操作的类,数据库操作,数据库操作需要注意的地方包括两个部分,一个是数据源,一个是数据表,通过数据源我们可以配置数据库的链接,一个数据源由多个链接组成,目前框架支持数据源的类型为 `mysql``sqlite`,数据库的配置为 `@resource/config/data-source`, 默认读取应用的配置 `app/resource/config/data-source.json` 文件,默认的配置如下:
在框架中,提供了对数据库操作的类,数据库操作,数据库操作需要注意的地方包括两个部分,一个是数据源,一个是数据表,通过数据源我们可以配置数据库的链接,一个数据源由多个链接组成,目前框架支持数据源的类型为 `mysql``sqlite`,数据库的配置为 `@app-resouce/config/data-source`, 默认读取应用的配置 `app/resource/config/data-source.json` 文件,默认的配置如下:


```json
Expand All @@ -19,7 +19,7 @@
}
}
```


## 配置说明

Expand All @@ -39,7 +39,7 @@

| 配置项 | 说明 |
|-------|------|
| host | 数据库主机 |
| host | 数据库主机 |
| port | 数据库端口 |
| name | 数据库用户名 |
| user | 数据库用户 |
Expand All @@ -50,7 +50,7 @@

| 配置项 | 说明 |
|-------|------|
| path | 数据库地址 |
| path | 数据库地址 |


## 执行SQL语句
Expand Down
26 changes: 26 additions & 0 deletions docs/08-config.md
@@ -0,0 +1,26 @@
# 配置文件说明

在suda中,配置文件默认使用 json 格式作为配置文件,但是也可以使用 `.php``.ini``.yml` 格式的文件做配置文件,一下提到的配置文件只说明文件名称,如 `manifest` 可以是 `manifest.json`,还可以是 `manifest.yml`,优先级:`.yml` > `.json` > `.php` > `.ini`

**使用YAML作为配置需要依赖第三方库,请自行包含,推荐使用PHP扩展或者使用symfony/yaml来解析**

资源位置描述说明:

- **@app** 表示app目录
- **@app-resouce** 表示app的资源目录,默认 `app/resource`

## @app/manifest 配置

| 键名 | 键值类型 | 默认值 | 说明 |
|---|----|-----|----|
| name | string | | 应用名称|
| version | string | | 应用版本号|
| locale | string | zh-cn | 应用采用的语言包 |
| style | string | default | 采用的样式 |
| resource | string | ./resource | 资源路径 |
| route-group | array | ['default'] | 启用的路由组 |
| import | array | null | 全局共享库 |
| module.load | array | 全部模块 | 默认加载的模块 |
| module.active | array | 全部模块 | 默认激活的模块 |
| module.reachable | array | 全部模块 | 默认可以访问的模块 |

14 changes: 0 additions & 14 deletions docs/08-manifest.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/index.md
Expand Up @@ -24,4 +24,4 @@ suda 是一款轻量化、模块化的Web框架,基于 `PHP7.2` 开发。
- [D·删除记录](05-database.delete.html)
- [预定义常量](06-constant.html)
- [内置模板](07-template.html)
- [Manifest配置说明](08-manifest.html)
- [配置说明](08-config.html)

0 comments on commit 6ac5054

Please sign in to comment.