You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.2 KiB
55 lines
1.2 KiB
<?php
|
|
|
|
namespace App\Console\Commands; // 定义命名空间
|
|
|
|
/**
|
|
* 卸载商城项目命令
|
|
*
|
|
* 该命令用于卸载商城项目,包括清理缓存、重置数据库迁移和删除上传的静态资源。
|
|
*/
|
|
class UninstallShop extends BaseCommand
|
|
{
|
|
/**
|
|
* 控制台命令的名称和签名
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'moon:uninstall'; // 定义命令的名称和签名
|
|
|
|
/**
|
|
* 控制台命令的描述
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = '卸载商城项目'; // 描述该命令的用途
|
|
|
|
/**
|
|
* 创建一个新的命令实例.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct(); // 调用父类构造函数
|
|
}
|
|
|
|
/**
|
|
* 执行控制台命令
|
|
*
|
|
* 该方法执行卸载商城项目的逻辑,依次调用其他命令来完成任务。
|
|
*
|
|
* @return mixed
|
|
*/
|
|
public function handle()
|
|
{
|
|
// 调用清理命令,清除缓存
|
|
$this->call('moon:clear');
|
|
|
|
// 调用迁移重置命令,重置数据库迁移
|
|
$this->call('migrate:reset');
|
|
|
|
// 删除所有上传的静态资源
|
|
$this->call('moon:delete');
|
|
}
|
|
}
|