Skip to content

Commit

Permalink
Moved to PSR-4 and example in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
casperbakker committed Nov 13, 2015
1 parent 66b4cd5 commit f678946
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
.idea
composer.lock
composer.phar
vendor/*
vendor
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,22 @@ This project can easily be installed through Composer.
composer require picqer/api-client
```

## Examples
## Example: Get orders
```php
<?php

require __DIR__ . '/vendor/autoload.php';

$subdomain = 'jansens-webwinkels';
$apikey = '1023ihs0edfh';

$apiclient = new Picqer\Api\Client($subdomain, $apikey);

$orders = $apiclient->getOrders();
var_dump($orders);
```

## More examples
Review the examples in the examples/ folder.

## Support
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"ext-curl": "*"
},
"autoload": {
"psr-0": {
"Picqer": "src"
"psr-4": {
"Picqer\\Api\\": "src"
}
}
}
2 changes: 1 addition & 1 deletion examples/addProduct.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require('../src/Picqer/Api/Client.php');
require('../src/Client.php');

// Start
$apiclient = new Picqer\Api\Client('--clientsubdomain--', '--apikey--');
Expand Down
2 changes: 1 addition & 1 deletion examples/getOrders.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require('../src/Picqer/Api/Client.php');
require('../src/Client.php');

// Start
$apiclient = new Picqer\Api\Client('--clientsubdomain--', '--apikey--');
Expand Down
2 changes: 1 addition & 1 deletion examples/getProducts.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require('../src/Picqer/Api/Client.php');
require('../src/Client.php');

// Start
$apiclient = new Picqer\Api\Client('--clientsubdomain--', '--apikey--');
Expand Down
2 changes: 1 addition & 1 deletion src/Picqer/Api/Client.php → src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* Picqer PHP API Client
*
* @author Casper Bakker <support@picqer.com>
* @author Casper Bakker <info@picqer.com>
* @license http://creativecommons.org/licenses/MIT/ MIT
*/

Expand Down

0 comments on commit f678946

Please sign in to comment.