canyin-project/ybcy/commands/tasks/TestController.php

40 lines
748 B
PHP
Raw Permalink Normal View History

2024-11-01 16:07:54 +08:00
<?php
namespace app\commands\tasks;
use Yii;
use yii\console\Controller;
use yii\console\ExitCode;
class TestController extends Controller
{
/**
* @return int Exit code
*/
public function actionIndex()
{
sleep(1);
echo "我是index方法\n";
return ExitCode::OK;
}
/**
* @return int Exit code
*/
public function actionTest()
{
sleep(2);
echo "我是test方法\n";
return ExitCode::OK;
}
public function actionCeshi(){
// file_put_contents('test.txt',111, FILE_APPEND);
return ExitCode::OK;
}
public function actionDemo(){
file_put_contents('test.txt',111, FILE_APPEND);
return ExitCode::OK;
}
}