PHP code example of pkg6 / consoles
1. Go to this page and download the library: Download pkg6/consoles library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pkg6 / consoles example snippets
bash
# 查看可用命令
php consoles list
# 运行特定命令
php consoles [command-name]
bash
# 基本用法(监听当前目录,文件变化时执行指定命令)
consoles watch:run --command="php consoles greeting"
# 监听特定目录
consoles watch:run --path=/path/to/directory --command="php consoles greeting"
# 排除某些文件或目录
consoles watch:run --exclude=vendor/ --exclude=node_modules/ --command="php consoles greeting"
# 指定监听引擎(默认使用 swoole)
consoles watch:run --engine=swoole --command="php consoles greeting"