/** * Creates API XMLRPC client * * @return \xmlrpc_client */ private function _getClient() { if ($this->_client === null) { if (!$this->apiKey) { $this->_lastError = 'No API key provided'; return false; } $this->_client = new \xmlrpc_client('api', 'allpositions.ru', 80); $GLOBALS['xmlrpc_defencoding'] = "UTF8"; $GLOBALS['xmlrpc_internalencoding'] = "UTF-8"; $this->_client->setcookie('api_key', $this->apiKey, '/', 'allpositions.ru'); } return $this->_client; }