PHP code example of icy8 / thinkphp5-cli
1. Go to this page and download the library: Download icy8/thinkphp5-cli 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/ */
icy8 / thinkphp5-cli example snippets
namespace app\spider;
use Think5Cli\Cli;
class Test extends Cli
{
// 必须配置 命令名
protected $cli_name = 'test';
// 默认参数
protected function _exec()
{
echo "hello";
}
// 其他参数 使用php think test arg1 调用
protected function _a() {
echo "a method";
}
}