From d532fb29c9a233263367fc5db952890ab427a38f Mon Sep 17 00:00:00 2001 From: splitice Date: Thu, 3 Jul 2014 02:13:20 +1000 Subject: [PATCH] added build status to readme --- README.md | 4 +- src/Splitice/BuyVM/ApiClient.php | 74 -------------------------------- 2 files changed, 1 insertion(+), 77 deletions(-) delete mode 100644 src/Splitice/BuyVM/ApiClient.php diff --git a/README.md b/README.md index ff78225..44eb081 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,7 @@ BuyVM Stallion API (PHP) This is a PHP5 wrapper to easily integrate with BuyVM's Stallion control panel API. -Developed for use at http://www.x4b.net - -Pull requests, features and patches welcome. +Developed for use at [www.x4b.net](http://www.x4b.net). Pull requests, features and patches welcome. ## Requirements You need PHP 5.3.2+ compiled with the cURL extension. diff --git a/src/Splitice/BuyVM/ApiClient.php b/src/Splitice/BuyVM/ApiClient.php deleted file mode 100644 index 278caa9..0000000 --- a/src/Splitice/BuyVM/ApiClient.php +++ /dev/null @@ -1,74 +0,0 @@ -key = $key; - $this->hash = $hash; - - //Setup curl - $this->ch = curl_init($url); - curl_setopt($this->ch, CURLOPT_POST, true); - curl_setopt($this->ch, CURLOPT_TIMEOUT, 30); - curl_setopt($this->ch, CURLOPT_FRESH_CONNECT, 1); - curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($this->ch, CURLOPT_HEADER, 0); - curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($this->ch, CURLOPT_HTTPHEADER, array('Expect:')); - } - - function __destruct(){ - curl_close($this->ch); - } - - private function execute($post){ - //Set authentication - $post['key'] = $this->key; - $post['hash'] = $this->hash; - - //set post data - curl_setopt($this->ch, CURLOPT_POSTFIELDS, $post); - - //Execute request - $data = curl_exec($this->ch); - $code = curl_getinfo($this->ch, CURLINFO_HTTP_CODE); - - //Handle response - if($code == 200){ - preg_match_all('/<(.*?)>([^<]+)<\/\\1>/i', $data, $match); - $result = array(); - - foreach ($match[1] as $x => $y) { - $result[$y] = $match[2][$x]; - } - - return $result; - }else{ - throw new ApiTransportException($code); - } - } - - function execute_action($action, $data = array()){ - $data['action'] = $action; - return $this->execute($data); - } - - function execute_info($fields){ - $post = array(); - foreach($fields as $f){ - $post[$f] = 'true'; - } - return $this->execute($post); - } -} \ No newline at end of file