cfmgrv4 init...3

This commit is contained in:
최준흠 2024-10-22 17:12:53 +09:00
parent 52f264ec8d
commit e4b8b9736d
3 changed files with 9 additions and 4 deletions

View File

@ -65,9 +65,14 @@ class Cloudflare extends BaseController
$accounts = $this->account_process($auth);
foreach (array_values($accounts) as $account) {
$zones = $this->zone_process($account);
$cnt = 1;
$total = count($zones);
foreach (array_values($zones) as $zone) {
log_message("notice", "\n-----------[{$cnt}/$total}] Zone {$zone->getTitle()}의 Record/Firewall 처리 시작-----------");
$records = $this->record_process($zone);
$firewalls = $this->firewall_process($zone);
log_message("notice", "\n-----------[{$cnt}/$total}] Zone {$zone->getTitle()}의 Record/Firewall 처리 완료-----------");
$cnt++;
}
}
}

View File

@ -85,7 +85,7 @@ class Firewall extends Cloudflare
//Reload
public function reload(): array
{
log_message("notice", "\n-----------Zone {$this->getParentEntity()->getTitle()}의 Firewall 처리 시작-----------");
// log_message("notice", "\n-----------Zone {$this->getParentEntity()->getTitle()}의 Firewall 처리 시작-----------");
$entitys = [];
try {
$response = $this->getMySocket()->get("zones/{$this->getParentEntity()->getPK()}/rulesets/phases/http_request_firewall_custom/entrypoint");
@ -105,7 +105,7 @@ class Firewall extends Cloudflare
log_message("error", $e->getMessage());
// throw new \Exception($e->getMessage());
}
log_message("notice", "\n-----------Zone {$this->getParentEntity()->getTitle()}의 Firewall처리[" . count($entitys) . "개] 완료-----------");
// log_message("notice", "\n-----------Zone {$this->getParentEntity()->getTitle()}의 Firewall처리[" . count($entitys) . "개] 완료-----------");
return $entitys;
}
}

View File

@ -140,7 +140,7 @@ class Record extends Cloudflare
//Reload
public function reload(): array
{
log_message("notice", "\n-----------Zone {$this->getParentEntity()->getTitle()}의 Record 처리 시작-----------");
// log_message("notice", "\n-----------Zone {$this->getParentEntity()->getTitle()}의 Record 처리 시작-----------");
$entitys = [];
try {
$results = $this->reload_procedure("zones/{$this->getParentEntity()->getPK()}/dns_records");
@ -167,7 +167,7 @@ class Record extends Cloudflare
log_message("error", $e->getMessage());
throw new \Exception($e->getMessage());
}
log_message("notice", "\n-----------Zone {$this->getParentEntity()->getTitle()}의 Record처리[" . count($entitys) . "개] 완료-----------");
// log_message("notice", "\n-----------Zone {$this->getParentEntity()->getTitle()}의 Record처리[" . count($entitys) . "개] 완료-----------");
return $entitys;
}
}