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