mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2025-12-27 17:00:16 +00:00
32 lines
1.0 KiB
PHP
32 lines
1.0 KiB
PHP
<?php
|
||
// +----------------------------------------------------------------------
|
||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||
// +----------------------------------------------------------------------
|
||
// | 官方网址:https://www.niucloud.com
|
||
// +----------------------------------------------------------------------
|
||
// | niucloud团队 版权所有 开源版本可自由商用
|
||
// +----------------------------------------------------------------------
|
||
// | Author: Niucloud Team
|
||
// +----------------------------------------------------------------------
|
||
|
||
namespace app\job\sys;
|
||
|
||
use core\base\BaseJob;
|
||
use core\util\Terminal;
|
||
|
||
/**
|
||
* 校验composer
|
||
*/
|
||
class CheckComposer extends BaseJob
|
||
{
|
||
public function doJob($file)
|
||
{
|
||
if (Terminal::execute(root_path(), 'composer -V') === true) {
|
||
file_put_contents($file, time());
|
||
//todo 部署一个十五秒后再校验一次删除这个文件
|
||
CheckDeleteJob::invoke(['file' => $file], secs: 8);
|
||
}
|
||
return true;
|
||
}
|
||
}
|