* 碼云倉庫:[https://gitee.com/zhqings/zqphp](https://gitee.com/zhqings/zqphp)
* zqphp結合workerman從4.x版本開發。
* 支持Workerman Swoole(開發中) Apache Nginx iis Cli 訪問
* 如要支持Workerman訪問,項目內不能使用exit,die函數,可以使用方法`come($Data=null)`方法代替
* PHP版本要求:`php-7.1`或更高版本
* [WorkerMan的特性](http://doc.workerman.net/getting-started/feature.html)
*****
* [ ] 創建index.php文件
```
<?php
//引加文件
require __DIR__ . '/zqphp/AutoLoad.php';
$Obj = new \zqphp\AutoLoad(__DIR__ . '/application');
$Obj->Run('8080');
```
*****
* 創建文件application/Lib/index.php
```
<?php
class index{
public function main() {
echo 'Hello';
}
}
```
*****
* [ ] Workermany啟動 php index.php start 訪問 `http://127.0.0.1:8080/index/main`
* [ ] Cli訪問 `php index.php index/main`
* [ ] Apache Nginx IIS 沒有偽靜態也可以通過訪問 `/index.php/index/main`
* [ ] Apache Nginx IIS 偽靜態 訪問` /index/main`
*****
Apache偽靜態(`.htaccess`)
```
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,PT,L]
</IfModule>
```
*****
Nginx偽靜態
```
if (!-d $request_filename){
set $rule_0 1$rule_0;
}
if (!-f $request_filename){
set $rule_0 2$rule_0;
}
if ($rule_0 = "21"){
rewrite ^/(.*)$ /index.php last;
}
```
*****
iis偽靜態(`web.config`)
```
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="index" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false"/>
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true"/>
</conditions>
<action type="Rewrite" url="index.php/{R:1}" appendQueryString="true"/>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
```
*****
* [ ] 目錄結構
```
zqphp 框架目錄(此目錄下的類取消自動加載)
├─Config 配置目錄
│ ├─Config.php 默認配置文件
│ ├─ErrInfo.php 自定義報錯內容
│ ├─Mime.Types 默認Mime類型
├─Events 擴展目錄(此目錄的類使用時會自動加載)
│ ├─GatewayClient GatewayClient
│ ├─GatewayWorker GatewayWorker框架
│ ├─Medoo Medoo Mysql
│ ├─think 第三方從Thinkphp分離出來的Mysql(zqphpMysql正在開發中)
│ ├─Workerman Workerman框架
│ ├─zqphp zqphp舊版本類
│ ├─Cookie.php Cookie類
│ ├─Frame.php 框架函數類
│ ├─GlobalVariables.php 全局變量類
│ ├─Request.php 請求類
│ ├─Response.php 響應類
│ ├─Session.php Session類
│ ├─TempLets.php TempLets模板類
├─Public 框架方法目錄(此目錄文件會自動加載)
│ ├─FrameWay.php 框架函數(框架類中調出來的)
│ ├─ResponseWay.php 響應函數(響應類中調出來的)
├─AutoLoad.php 框架主加載文件
```
- 開始使用
- 配置文件
- 路由模式
- AutoLoad類
- 啟動文件
- __construct
- SetRouting
- SetAlias
- SetStop
- SetError
- Access
- SetWorker
- SetClassFile
- SetClassDir
- Run
- OpenLoad
- LinuxStartAll
- Session類
- 使用說明
- set
- get
- delete
- pull
- has
- id
- Cookie類
- 使用說明
- set
- get
- delete
- pull
- has
- TempLets類
- 模板語法
- 模板標簽
- html
- show
- assign
- obtain
- Request類
- get
- post
- host
- referer
- getip
- localip
- header
- body
- file
- scheme
- protocolversion
- uri
- path
- querystring
- method
- Response
- SendFile
- FileStream
- SendData
- SetStatus
- SetHead
- SetMime
- WebSend
- redirect
- dumpJson
- dump
- come
- ps
- Frame類
- GetWeb
- ViewFile
- RoutingData
- SetClassFile
- SetClassDir
- GetMime
- FileMime
- LoadDir
- StartDir
- IsJson
- ArrJson
- JsonFormat
- ObStart
- GetConfig
- ConfigDir
- TempDir
- GetRunData
- GetStatic
- IsDebug
- SetDebug
- GetDebugInfo
- GlobalVariables類
- 使用說明
- set
- get
- delete
- pull
- has
- id
- Mysql類
- 新版本
- 第三方
- Thinkorm
- Medoo
- 舊版本
- Mysql 配置格式
- 項目中操作數據庫
- 項目場景
- 項目數據庫配置
- 項目數據庫中間類
- 項目中操作數據表
- 連貫操作
- where
- table
- data
- order
- field
- limit
- page
- group
- having
- join
- tabname
- union
- sql
- link
- link_base
- lock
- CURD 操作
- 寫入數據
- 數據刪除
- 數據查詢
- 數據更新
- 數據統計操作
- count
- sum
- max
- min
- avg
- 操作DEMO
- CurdTrait.php
- 項目Model層操作表.md
- Curl類
- Method類
- SslAes類
- layui_zqadmin