@@ -23,7 +23,7 @@ |
||
| 23 | 23 | |
| 24 | 24 | class ShopifyInstallShell extends Shell { |
| 25 | 25 | |
| 26 | - public function main() { |
|
| 26 | + public function main() { |
|
| 27 | 27 | |
| 28 | 28 | //Lets Make This FANCY |
| 29 | 29 | $this->clear(); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $first_run = ((Configure::check('Shopify')) ? false : true); |
| 35 | 35 | |
| 36 | 36 | //Activate Plugin |
| 37 | - if ((($first_run) ? (strtolower($this->in('Install Shopify Plugin?', ['y','n'])) == 'y') : (strtolower($this->in('Update Configuration?', ['y','n'])) == 'y'))) { |
|
| 37 | + if ((($first_run) ? (strtolower($this->in('Install Shopify Plugin?', ['y', 'n'])) == 'y') : (strtolower($this->in('Update Configuration?', ['y', 'n'])) == 'y'))) { |
|
| 38 | 38 | |
| 39 | 39 | $this->out(); |
| 40 | 40 | $this->out('Please enter your API credentials from your Shopify App page.', 2); |
@@ -72,12 +72,12 @@ discard block |
||
| 72 | 72 | $this->_io->out('<error>Invalid Scope. Try again, or leave blank to continue.</error>'); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - } while((count($scope)) && (strlen(trim(implode("", $scope))) > 0) && (count(array_diff($scope, $scope_array)) > 0)); |
|
| 75 | + } while ((count($scope)) && (strlen(trim(implode("", $scope))) > 0) && (count(array_diff($scope, $scope_array)) > 0)); |
|
| 76 | 76 | |
| 77 | - Configure::write('Shopify.' . $api_key . '.scope',implode(',', $scope)); |
|
| 77 | + Configure::write('Shopify.' . $api_key . '.scope', implode(',', $scope)); |
|
| 78 | 78 | |
| 79 | 79 | $this->out(''); |
| 80 | - $is_private_app = strtolower($this->in('Is this a private app?', ['y','n'])); |
|
| 80 | + $is_private_app = strtolower($this->in('Is this a private app?', ['y', 'n'])); |
|
| 81 | 81 | |
| 82 | 82 | if ($is_private_app == 'y') { |
| 83 | 83 | $is_private_app = 'true'; |
@@ -85,10 +85,10 @@ discard block |
||
| 85 | 85 | $is_private_app = 'false'; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - Configure::write('Shopify.' . $api_key . '.is_private_app',$is_private_app); |
|
| 88 | + Configure::write('Shopify.' . $api_key . '.is_private_app', $is_private_app); |
|
| 89 | 89 | |
| 90 | 90 | if ($is_private_app == 'true') { |
| 91 | - Configure::write('Shopify.' . $api_key . '.private_app_password',$this->in('Private App Password:')); |
|
| 91 | + Configure::write('Shopify.' . $api_key . '.private_app_password', $this->in('Private App Password:')); |
|
| 92 | 92 | } else { |
| 93 | 93 | Configure::write('Shopify.' . $api_key . '.private_app_password', NULL); |
| 94 | 94 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | $this->out(''); |
| 101 | 101 | |
| 102 | - if (($first_run) || (strtolower($this->in('Update Database?', ['y','n'])) == 'y')) { |
|
| 102 | + if (($first_run) || (strtolower($this->in('Update Database?', ['y', 'n'])) == 'y')) { |
|
| 103 | 103 | |
| 104 | 104 | $this->out(''); |
| 105 | 105 | |
@@ -109,16 +109,16 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | if ((is_array($status)) && (count($status))) { |
| 111 | 111 | |
| 112 | - $this->out('Updating Databases',2); |
|
| 112 | + $this->out('Updating Databases', 2); |
|
| 113 | 113 | |
| 114 | 114 | if ($migrations->migrate()) { |
| 115 | - $this->out('Success!',2); |
|
| 115 | + $this->out('Success!', 2); |
|
| 116 | 116 | } else { |
| 117 | 117 | $this->_io->out('<error>Update Failed!</error>', 2); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | } else { |
| 121 | - $this->out('Shopify Database Files Not Found',2); |
|
| 121 | + $this->out('Shopify Database Files Not Found', 2); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | } |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | |
| 100 | 100 | $this->out(''); |
| 101 | 101 | |
| 102 | - if (($first_run) || (strtolower($this->in('Update Database?', ['y','n'])) == 'y')) { |
|
| 102 | + if (($first_run) || (strtolower($this->in('Update Database?', ['y','n'])) == 'y')) { |
|
| 103 | 103 | |
| 104 | 104 | $this->out(''); |
| 105 | 105 | |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | |
| 114 | 114 | $shop = $this->ShopifyDatabase->getShopDataFromAccessToken($accessToken, $this->api_key); |
| 115 | 115 | |
| 116 | - if($shop && is_array($shop)){ |
|
| 116 | + if ($shop && is_array($shop)) { |
|
| 117 | 117 | return ['id' => $shop['id'], 'username' => $shop['myshopify_domain']]; |
| 118 | 118 | } |
| 119 | 119 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | if (isset($request->query['code'])) { |
| 98 | 98 | $accessToken = $this->ShopifyAPI->getAccessToken($shopDomain, $request->query['code']); |
| 99 | - } else { |
|
| 99 | + } else { |
|
| 100 | 100 | $accessToken = $this->ShopifyDatabase->getAccessTokenFromShopDomain($shopDomain, $this->api_key); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | $shop = $this->ShopifyDatabase->getShopDataFromAccessToken($accessToken, $this->api_key); |
| 115 | 115 | |
| 116 | - if($shop && is_array($shop)){ |
|
| 116 | + if($shop && is_array($shop)) { |
|
| 117 | 117 | return ['id' => $shop['id'], 'username' => $shop['myshopify_domain']]; |
| 118 | 118 | } |
| 119 | 119 | |