From 464e01697efd89040fb092e754b9520a9ba0922d Mon Sep 17 00:00:00 2001 From: LeonZhang Date: Wed, 15 Jul 2015 16:53:55 +1000 Subject: [PATCH 1/3] Removed sku options get method because it's an arrary not resource --- src/Bigcommerce/Api/Resources/Sku.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/Bigcommerce/Api/Resources/Sku.php b/src/Bigcommerce/Api/Resources/Sku.php index 58dbdecb..db20f176 100644 --- a/src/Bigcommerce/Api/Resources/Sku.php +++ b/src/Bigcommerce/Api/Resources/Sku.php @@ -19,17 +19,6 @@ class Sku extends Resource 'product_id', ); - public function options() - { - $options = Client::getCollection($this->fields->options->resource, 'SkuOption'); - - foreach ($options as $option) { - $option->product_id = $this->product_id; - } - - return $options; - } - public function create() { return Client::createResource('/products/' . $this->product_id . '/skus', $this->getCreateFields()); From b05934473f8f55f35215015d15f8dc86c562ceab Mon Sep 17 00:00:00 2001 From: LeonZhang Date: Wed, 22 Jul 2015 17:16:01 +1000 Subject: [PATCH 2/3] Added STDIN definition in connect construct to fix update method errors --- src/Bigcommerce/Api/Connection.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Bigcommerce/Api/Connection.php b/src/Bigcommerce/Api/Connection.php index 12fb659e..7858622b 100644 --- a/src/Bigcommerce/Api/Connection.php +++ b/src/Bigcommerce/Api/Connection.php @@ -91,6 +91,7 @@ class Connection */ public function __construct() { + define('STDIN', fopen("php://stdin", "r")); $this->curl = curl_init(); curl_setopt($this->curl, CURLOPT_HEADERFUNCTION, array($this, 'parseHeader')); curl_setopt($this->curl, CURLOPT_WRITEFUNCTION, array($this, 'parseBody')); From 37aaa3fa6a03720d5785d407eab0d92a80c70209 Mon Sep 17 00:00:00 2001 From: LeonZhang Date: Wed, 22 Jul 2015 17:42:29 +1000 Subject: [PATCH 3/3] Added check STDIN is defined --- src/Bigcommerce/Api/Connection.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Bigcommerce/Api/Connection.php b/src/Bigcommerce/Api/Connection.php index 7858622b..92ecf3df 100644 --- a/src/Bigcommerce/Api/Connection.php +++ b/src/Bigcommerce/Api/Connection.php @@ -91,7 +91,10 @@ class Connection */ public function __construct() { - define('STDIN', fopen("php://stdin", "r")); + if (!defined('STDIN')) { + define('STDIN', fopen("php://stdin", "r")); + } + $this->curl = curl_init(); curl_setopt($this->curl, CURLOPT_HEADERFUNCTION, array($this, 'parseHeader')); curl_setopt($this->curl, CURLOPT_WRITEFUNCTION, array($this, 'parseBody'));