默認(rèn)拉下來的GatewayWorker如下,我現(xiàn)在開發(fā)一款小游戲,一些目錄結(jié)構(gòu)大家一般是怎么設(shè)計的呢?
.
├── Applications // 這里是所有開發(fā)者應(yīng)用項目
│ └── YourApp // 其中一個項目目錄,目錄名可以自定義
│ ├── Events.php // 開發(fā)者只需要關(guān)注這個文件
│ ├── start_gateway.php // gateway進程啟動腳本,包括端口號等設(shè)置
│ ├── start_businessworker.php // businessWorker進程啟動腳本
│ └── start_register.php // 注冊服務(wù)啟動腳本
│
├── start.php // 全局啟動腳本,此腳本會依次加載Applications/項目/start_*.php啟動腳本
│
└── vendor // GatewayWorker框架和Workerman框架源碼目錄,此目錄開發(fā)者不用關(guān)心
我自己的思路是:
├── Applications
│ └── 游戲project1
│ ├── Logic 游戲邏輯
│ └── player.php
│ └── fight.php
│ ├── config 游戲配置
│ └── app.php
│ └── db.php
│ └── routes.php
│ ├── Dao 數(shù)據(jù)庫連接
│ └── mysql.php
│ └── redis.php
│ └── mongo.php
│ ├── functions.php 公共函數(shù)
│ ├── Events.php
│ ├── start_gateway.php
│ ├── start_businessworker.php
│ └── start_register.php
│
├── start.php
│
└── vendor