Skip to content

Commit 1f9f18e

Browse files
Composer/Packagist tested
1 parent db86af5 commit 1f9f18e

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Add php-http-client to your `composer.json` file. If you are not using [Composer
4040
```json
4141
{
4242
"require": {
43-
"sendgrid/php-http-client": "~1"
43+
"sendgrid/php-http-client": "1.*"
4444
}
4545
}
4646
```
@@ -67,8 +67,8 @@ Following is an abridged example, here is the [full working code](https://github
6767

6868
```php
6969
<?php
70-
include 'php-http-client';
71-
$config = new SendGrid\Config(dirname(__DIR__), '.env');
70+
require __DIR__ . '/vendor/autoload.php';
71+
$config = new SendGrid\Config(getcwd(), '.env');
7272
$api_key = getenv('SENDGRID_API_KEY');
7373
$headers = array(
7474
'Content-Type: application/json',

examples/example.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
<?php
2-
include(dirname(__DIR__).'/lib/client.php');
3-
include(dirname(__DIR__).'/lib/config.php');
4-
$config = new SendGrid\Config(dirname(__DIR__), '.env');
2+
// If running this outside of this context, use the following include and
3+
// comment out the two includes below
4+
// require __DIR__ . '/vendor/autoload.php';
5+
include(dirname(__DIR__).'/lib/SendGrid/client.php');
6+
include(dirname(__DIR__).'/lib/SendGrid/config.php');
7+
// This gets the parent directory, for your current directory use getcwd()
8+
$path_to_config = dirname(__DIR__);
9+
$config = new SendGrid\Config($path_to_config, '.env');
510
$api_key = getenv('SENDGRID_API_KEY');
611
$headers = array(
712
'Content-Type: application/json',
813
'Authorization: Bearer '.$api_key
914
);
10-
$client = new SendGrid\Client('https://e9sk3d3bfaikbpdq7.stoplight-proxy.io', $headers, '/v3', null);
15+
$client = new SendGrid\Client('https://api.sendgrid.com', $headers, '/v3', null);
1116

1217
// GET Collection
1318
$query_params = array('limit' => 100, 'offset' => 0);

test/unit/bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
2-
include(dirname(dirname(__FILE__)) . '/../lib/client.php');
3-
include(dirname(dirname(__FILE__)) . '/../lib/config.php');
2+
include(dirname(dirname(__FILE__)) . '/../lib/SendGrid/client.php');
3+
include(dirname(dirname(__FILE__)) . '/../lib/SendGrid/config.php');
44
require __DIR__ . '/../../vendor/autoload.php';
55
function autoload_tests($class)
66
{

0 commit comments

Comments
 (0)