cfmgrv3/app/Controllers/CLI/Cloudflare/API/Auth.php
2024-05-15 10:37:47 +09:00

30 lines
977 B
PHP

<?php
namespace App\Controllers\CLI\Cloudflare\API;
use App\Entities\Cloudflare\API\AuthEntity;
use App\Libraries\Log\Log;
class Auth extends API
{
final public function execute()
{
//transation처리
// $this->getAuthModel()->db->transBegin();
try {
$entitys = $this->getAuthModel()->asObject(AuthEntity::class)->where(['status' => 'use'])->findAll();
foreach ($entitys as $entity) {
$api = new \App\Libraries\Cloudflare\API\Account($entity);
$api->reload();
}
//transation 완료
// $this->getAuthModel()->db->transCommit();
Log::add("error", __METHOD__ . "에서 Account Reload 완료");
} catch (\Exception $e) {
//transaction 오류복구
// $this->getAuthModel()->db->transRollback();
Log::add("error", __METHOD__ . "에서 Account Reload 오류\n" . $e->getMessage());
}
}
}