Skip to content

Commit 02f64e8

Browse files
authored
Fix old files (#13)
- Fix a bunch of unresolved issues - Fix instantiation of core Api / PrivateApi classes - Add a large amount of missing tests
1 parent 0ee7ac8 commit 02f64e8

File tree

189 files changed

+5792
-678
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+5792
-678
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ clover.xml
1414
.phplint-cache
1515

1616
.auth
17+
18+
test.php

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ $client = new Shopify\Api(array(
2626
));
2727
```
2828

29+
If you are using a Private App for use on an individual store:
30+
```php
31+
$client = new Shopify\PrivateApi(array(
32+
'api_key' => '<api-key>',
33+
'password' => '<password>',
34+
'shared_secret' => '<shared-secret>',
35+
'myshopify_domain' => '<store>.myshopify.com'
36+
));
37+
```
38+
2939
Once the client is initialized, you can then create a service, and use it to communicate with the api
3040

3141
### Reading
@@ -84,7 +94,6 @@ header("Location: {$authorizationUrl}");
8494
```
8595

8696
At your `redirect_uri`, instantiate the helper again to get an access token
87-
8897
```php
8998
$client = new Shopify\Api($params);
9099
$helper = $client->getOAuthHelper();
@@ -94,6 +103,10 @@ echo $token->access_token;
94103
echo $token->scopes;
95104
```
96105

106+
By default, this uses simple session storage. You can implement a custom class that implements `PersistentStorageInterface`,
107+
pass that to `new Shopify\Api()`, and `OAuthHelper` will use that instead. This will be required if authorization requests and
108+
redirects may be directed to different servers.
109+
97110
### Using objects
98111

99112
Object properties can be accessed using `object->property`. Nested objects are instantiated classes. All timestamp fields are instances of `\DateTime`.

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
},
3434
"scripts" : {
3535
"lint" : "./vendor/bin/phplint ./ --exclude=vendor",
36-
"test" : "./vendor/bin/phpunit",
3736
"phpcs" : "./vendor/bin/phpcs ./lib"
3837
}
3938
}

0 commit comments

Comments
 (0)