_debug = $debug; } abstract protected function getClient(); abstract protected function requestURL(string $url, string $method, array $datas = []): object; final public function setServerInfo($ip, $port) { $this->_serverInfo['ip'] = $ip; $this->_serverInfo['port'] = $port; } final protected function getServerInfo($scheme = "https://", $delimeter = ":"): string { return $scheme . $this->_serverInfo['ip'] . $delimeter . $this->_serverInfo['port']; } final public function setAccountInfo($id, $password) { $this->_serverInfo['id'] = $id; $this->_serverInfo['password'] = $password; } final protected function getAccountInfo($authType = 'basic'): array { //type: basic , digest return array($this->_serverInfo['id'], $this->_serverInfo['password'], $authType); } protected function isSSLVerifiy(): bool { return getenv('api.ssl') == 'true' ? true : false; } protected function getCookieFile() { return PATHS['API'] . getenv('api.cookie.file') ?: "api-cookie_" . date("Ymd") . ".log"; } protected function getDebugFile() { return PATHS['API'] . getenv('api.debug.file') ?: "api-debug_" . date("Ymd") . ".log"; } final public function get(string $url): object { return $this->requestURL($url, 'GET'); } final public function post(string $url, array $datas): object { return $this->requestURL($url, 'POST', $datas); } }