作者 zhl

u

... ... @@ -57,14 +57,16 @@ public function handle()
echo $start_at . ', empty event.' . PHP_EOL;
sleep(30);
} else {
foreach ($events as $val) {
}
$this->expend($events);
}
}
return true;
}
/**
* @param $data
* @return bool
*/
public function expend($data)
{
foreach ($data as $val) {
... ... @@ -76,11 +78,21 @@ public function expend($data)
case BtEvents::TYPE_DELETE_SITE:
$result = $this->deleteSiteEvent($val->id, $param);
break;
case BtEvents::TYPE_CREATE_SSL:
$result = $this->createSiteSsl($val->id, $param);
break;
case BtEvents::TYPE_RENEWAL_SSL:
$result = $this->renewalSiteSsl($val->id, $param);
break;
case BtEvents::TYPE_EVENT_CALLBACK:
$result = $this->callbackEvent($val->id, $param);
break;
default:
$result = false;
break;
}
}
return true;
}
/**
... ... @@ -263,6 +275,7 @@ public function callbackEvent($id, $param)
$array = [
'status' => $status,
'message' => $message,
'data' => [],
'param' => $param
];
list($code, $result) = app(ToolRepository::class)->curlRequest($callback, $array);
... ...
... ... @@ -74,7 +74,7 @@ public function createSsl(Request $request)
if (empty($host))
return $this->error('请提交有效host信息');
$result = app(BtRepository::class)->deleteBtSite($host);
$result = app(BtRepository::class)->applySsl($host);
return $result ? $this->success() : $this->error('创建ssl失败,提交异步任务!');
} catch (\Exception $e) {
return $this->error($e->getMessage());
... ...
... ... @@ -50,7 +50,7 @@ public function createBtSite($domain, $ssl_open, $ssl_auto, $ssl_auto_day, $ssl_
'path' => env('PROJECT_PATH') ? env('PROJECT_PATH') : dirname(dirname(app_path())) . DIRECTORY_SEPARATOR . $domain,
'type_id' => 0,
'type' => 'PHP',
'version' => '73',
'version' => '74',
'port' => '80',
'ps' => $host,
'ftp' => false,
... ...
... ... @@ -67,7 +67,7 @@
|
*/
'timezone' => 'UTC',
'timezone' => 'PRC',
/*
|--------------------------------------------------------------------------
... ...