49 lines
1.5 KiB
PHP
49 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Controllers\Cloudflare;
|
|
|
|
use Psr\Log\LoggerInterface;
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
|
use CodeIgniter\HTTP\RequestInterface;
|
|
|
|
use App\Libraries\MySocket\Cloudflare\AccountSocket;
|
|
use App\Libraries\MyStorage\AccountStorage;
|
|
|
|
class AccountController extends MyCloudflare
|
|
{
|
|
private $_email = "";
|
|
private $_api_key = "";
|
|
private $_mySocket = null;
|
|
private $_myStorage = null;
|
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
|
{
|
|
parent::initController($request, $response, $logger);
|
|
}
|
|
final protected function getMySocket(): AccountSocket
|
|
{
|
|
if ($this->_mySocket === null) {
|
|
$this->_mySocket = new AccountSocket($this->_email, $this->_api_key);
|
|
}
|
|
return $this->_mySocket;
|
|
}
|
|
final protected function getMyStorage(): AccountStorage
|
|
{
|
|
if ($this->_myStorage === null) {
|
|
$this->_myStorage = new AccountStorage();
|
|
}
|
|
return $this->_myStorage;
|
|
}
|
|
|
|
public function create(): void
|
|
{
|
|
$this->_email = $this->request->getVar('email');
|
|
$this->_api_key = $this->request->getVar('key');
|
|
//전송
|
|
$result = $this->getMySocket()->create_process($this->_email);
|
|
$formDatas = [];
|
|
$formDatas['key'] = $this->_api_key;
|
|
$entity = $this->getMyStorage()->create_process($result, $formDatas);
|
|
log_message("notice", __FUNCTION__ . "=> 작업을 완료하였습니다.");
|
|
}
|
|
}
|