cfmgrv4 init...1
This commit is contained in:
parent
c958bf7fe6
commit
958da4e1ee
@ -94,14 +94,17 @@ class ZoneController extends CloudflareController
|
||||
if ($this->_account_entity === null) {
|
||||
throw new \Exception("해당 계정정보를 찾을수 없습니다.");
|
||||
}
|
||||
//Zone생성
|
||||
$zone_entitys = [];
|
||||
foreach ($this->formDatas['domains'] as $domain) {
|
||||
//Zone생성
|
||||
$zone_entity = $this->getMyLibrary()->create($domain, $this->formDatas);
|
||||
//Record생성
|
||||
$zone_entitys[] = $this->getMyLibrary()->create($domain);
|
||||
}
|
||||
//Record생성
|
||||
foreach ($zone_entitys as $zone_entity) {
|
||||
$record = new Record($this->_account_entity, $zone_entity);
|
||||
foreach ($this->formDatas['hosts'] as $host) {
|
||||
$record->create($host, [
|
||||
'type' => $this->formDatas['type'],
|
||||
'type' => $this->formDatas['type'],
|
||||
'content' => $this->formDatas['content'],
|
||||
'proxied' => $this->formDatas['proxied'],
|
||||
]);
|
||||
|
||||
@ -91,14 +91,14 @@ class Zone extends MyCloudflare
|
||||
$entity->$field = $cf->result->value;
|
||||
return $entity;
|
||||
}
|
||||
public function create(string $domain, array $formDatas): ZoneEntity
|
||||
public function create(string $domain, bool $jump_start = false): ZoneEntity
|
||||
{
|
||||
//Socket용
|
||||
//도메인생성을 위해 Cloudflare에 전송
|
||||
$cf = $this->getRequest()->post('zones/', [
|
||||
'accountId' => $this->_account_entity->getPK(),
|
||||
'name' => $domain,
|
||||
'jump_start' => array_key_exists('jump_start', $formDatas) ? $formDatas['jumb_start'] : false,
|
||||
'jump_start' => $jump_start,
|
||||
]);
|
||||
$cf = json_decode($cf->getBody());
|
||||
if (!$cf->success) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user