一区二区视频在线观看,久操视频在线免费观看,欧美在线二区,欧美日韩国产在线成人网,欧美日韩国产精品,黄色网站在线观看视频

龍巖易富通網絡科技有限公司

龍巖小程序開發,龍巖分銷系統

centos 定時執行 think命令

2025.06.21 | 133閱讀 | 0條評論 | php

在TP5中自定義hello命令

<?php

    protected function configure()

    {

        $this->setName('hello')                      //定義命令的名字

        ->setDescription('This is my command')     //定義命令的描述

        ->addArgument('name')                      //增加一個名字參數

        ->addArgument('age');                      //增加一個年齡參數

    }


    protected function execute(Input $input, Output $output)

    {

        //獲取輸入的參數

        $name = $input->getArgument('name');

        $age = $input->getArgument('age');


        //輸出獲得的參數

        $output->writeln("My name is $name ,age is $age");

    }


centos定時執行

* * * * *  php /path/to/your/project/think hello

贊 (

發表評論