mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 23:55:35 +08:00
update plugin docs and add some helper functions
This commit is contained in:
@@ -397,3 +397,11 @@ public function testRoute(HttpRequestEvent $event)
|
||||
$socket = ws_socket();
|
||||
$socket->send('hello world', $event->getFd()); // 客户端的连接 fd 编号可以通过 WebSocketOpenEvent 等事件获取
|
||||
```
|
||||
|
||||
### zm_create_app()
|
||||
|
||||
创建一个炸毛框架的单文件应用(仅单文件,项目外非编写插件模式时可用),效果等同于 `new \ZM\ZMApplication()`。
|
||||
|
||||
### zm_create_plugin()
|
||||
|
||||
创建一个炸毛单文件模式的插件对象,效果等同于 `new \ZM\Plugin\ZMPlugin()`。
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
└── test-app/
|
||||
├── main.php
|
||||
├── empty/
|
||||
└── zmplugin.json
|
||||
└── composer.json
|
||||
```
|
||||
|
||||
```php
|
||||
@@ -36,7 +36,7 @@ $result = \ZM\Store\FileSystem::scanDirFiles('/home/ab/test/', true, false);
|
||||
结果:
|
||||
[
|
||||
"/home/ab/test/test-app/main.php",
|
||||
"/home/ab/test/test-app/zmplugin.json"
|
||||
"/home/ab/test/test-app/composer.json"
|
||||
]
|
||||
*/
|
||||
$result2 = \ZM\Store\FileSystem::scanDirFiles('/home/ab/test/', false, true, true);
|
||||
|
||||
Reference in New Issue
Block a user