webman:从命令行执行命令
一,官方文档地址:
https://www.workerman.net/doc/webman/plugin/console.html
二,安装所需的库:
1,从命令行安装:
liuhongdi@lhdpc:/data/webman/imageadmin$ composer require webman/console
2,查看安装后的版本:
liuhongdi@lhdpc:/data/webman/imageadmin$ composer show webman/console
name : webman/console
descrip. : Webman console
keywords : webman console
versions : * v1.2.38
...
3,说明:安装完成后,项目目录下增加了webman这个php程序
三,使用命令行:
1,查看webman框架的版本:
liuhongdi@lhdpc:/data/webman/imageadmin$ php webman version
Webman-framework v1.5.7
2,创建controller
liuhongdi@lhdpc:/data/webman/imageadmin$ php webman make:controller login
Make controller login
liuhongdi@lhdpc:/data/webman/imageadmin$ ll app/controller/LoginController.php
-rw-rw-r-- 1 liuhongdi liuhongdi 175 9月 20 21:11 app/controller/LoginController.php
3,创建model
liuhongdi@lhdpc:/data/webman/imageadmin$ php webman make:model staff
Make model Staff
liuhongdi@lhdpc:/data/webman/imageadmin$ ls app/model
Comment.php Staff.php Test.php
4,创建middleware
liuhongdi@lhdpc:/data/webman/imageadmin$ php webman make:middleware CheckJwt
Make middleware CheckJwt
liuhongdi@lhdpc:/data/webman/imageadmin$ ls app/middleware/
CheckIp.php CheckJwt.php HttpLog.php StaticFile.php
说明:刘宏缔的架构森林—专注it技术的博客,
网站:https://blog.imgtouch.com
原文: https://blog.imgtouch.com/index.php/2023/09/20/webman-cong-ming-ling-hang-zhi-xing-ming-ling/
代码: https://github.com/liuhongdi/ 或 https://gitee.com/liuhongdi
说明:作者:刘宏缔 邮箱: 371125307@qq.com
四,查看webman框架的版本:
liuhongdi@lhdpc:/data/webman/imageadmin$ php webman version
Webman-framework v1.5.7