You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+55-53Lines changed: 55 additions & 53 deletions
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,28 @@
1
-
Hello! Thank you for choosing to help contribute to the php-http-client. There are many ways you can contribute and help is always welcome.
2
-
1
+
Hello! Thank you for choosing to help contribute to one of the SendGrid open source projects. There are many ways you can contribute and help is always welcome. We simply ask that you follow the following contribution policies.
2
+
3
+
-[CLAs and CCLAs](#cla)
4
+
-[Roadmap & Milestones](#roadmap)
5
+
-[Feature Request](#feature_request)
6
+
-[Submit a Bug Report](#submit_a_bug_report)
7
+
-[Improvements to the Codebase](#improvements_to_the_codebase)
8
+
-[Understanding the Code Base](#understanding_the_codebase)
-[Creating a Pull Request](#creating_a_pull_request)
12
+
13
+
<aname="roadmap"></a>
3
14
We use [Milestones](https://github.com/sendgrid/php-http-client/milestones) to help define current roadmaps, please feel free to grab an issue from the current milestone. Please indicate that you have begun work on it to avoid collisions. Once a PR is made, community review, comments, suggestions and additional PRs are welcomed and encouraged.
4
15
5
-
*[Feature Request](#feature_request)
6
-
*[Submit a Bug Report](#submit_a_bug_report)
7
-
*[Improvements to the Codebase](#improvements_to_the_codebase)
8
-
*[Understanding the Code Base](#understanding_the_codebase)
*[Creating a Pull Request](#creating_a_pull_request)
16
+
<aname="cla"></a>
17
+
## CLAs and CCLAs
18
+
19
+
Before you get started, SendGrid requires that a SendGrid Contributor License Agreement (CLA) or a SendGrid Company Contributor Licensing Agreement (CCLA) be filled out by every contributor to a SendGrid open source project.
20
+
21
+
Our goal with the CLA and CCLA is to clarify the rights of our contributors and reduce other risks arising from inappropriate contributions. The CLA also clarifies the rights SendGrid holds in each contribution and helps to avoid misunderstandings over what rights each contributor is required to grant to SendGrid when making a contribution. In this way the CLA and CCLA encourage broad participation by our open source community and help us build strong open source projects, free from any individual contributor withholding or revoking rights to any contribution.
22
+
23
+
SendGrid does not merge a pull request made against a SendGrid open source project until that pull request is associated with a signed CLA (or CCLA). Copies of the CLA and CCLA are available [here](https://drive.google.com/a/sendgrid.com/file/d/0B0PlcM9qA91LN2VEUTJWU2RIVXc/view).
24
+
25
+
You may submit your completed [CLA or CCLA](https://drive.google.com/a/sendgrid.com/file/d/0B0PlcM9qA91LN2VEUTJWU2RIVXc/view) to SendGrid at [[email protected]](mailto:[email protected]). SendGrid will then confirm you are ready to begin making contributions.
12
26
13
27
There are a few ways to contribute, which we'll enumerate below:
14
28
@@ -37,29 +51,7 @@ Before you decide to create a new issue, please try the following:
37
51
38
52
### Please use our Bug Report Template
39
53
40
-
In order to make the process easier, we've included a sample bug report template (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting.
41
-
42
-
```
43
-
Short and descriptive example bug report title
44
-
45
-
#### Issue Summary
46
-
47
-
A summary of the issue and the environment in which it occurs. If suitable, include the steps required to reproduce the bug. Please feel free to include screenshots, screencasts, code examples.
48
-
49
-
50
-
#### Steps to Reproduce
51
-
52
-
1. This is the first step
53
-
2. This is the second step
54
-
3. Further steps, etc.
55
-
56
-
Any other information you want to share that is relevant to the issue being reported. Especially, why do you consider this to be a bug? What do you expect to happen instead?
In order to make the process easier, we've included a [sample bug report template](https://github.com/sendgrid/php-http-client/.github/ISSUE_TEMPLATE) (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting.
63
55
64
56
<aname="improvements_to_the_codebase"></a>
65
57
## Improvements to the Codebase
@@ -68,43 +60,55 @@ We welcome direct contributions to the php-http-client code base. Thank you!
See the [examples folder](https://github.com/sendgrid/php-http-client/tree/master/examples
92
92
<aname="understanding_the_codebase"></a>
93
93
## Understanding the Code Base
94
94
95
95
**/examples**
96
96
97
97
Working examples that demonstrate usage.
98
98
99
-
**client.php**
99
+
**/test/unit**
100
+
101
+
Unit tests.
102
+
103
+
**/lib/SendGrid/Client.php**
100
104
101
105
An HTTP client with a fluent interface using method chaining and reflection. By returning self on [__call](https://github.com/sendgrid/php-http-client/blob/master/lib/client.php#L212) and [_()](https://github.com/sendgrid/php-http-client/blob/master/lib/client.pph#L198), we can dynamically build the URL using method chaining and [__call](https://github.com/sendgrid/php-http-client/blob/master/lib/client.php#L212) allows us to dynamically receive the method calls to achieve reflection.
102
106
103
107
This allows for the following mapping from a URL to a method chain:
104
108
105
109
`/api_client/{api_key_id}/version` maps to `client->api_client().->_($api_key_id)->version-><method>()` where <method> is a [HTTP verb](https://github.com/sendgrid/php-http-client/blob/master/lib/client.php#L94).
106
110
107
-
**config.php**
111
+
**/lib/SendGrid/Config.php**
108
112
109
113
Loads the environment variables.
110
114
@@ -113,26 +117,24 @@ Loads the environment variables.
113
117
114
118
All PRs require passing tests before the PR will be reviewed.
115
119
116
-
All test files are in the `[test/unit](https://github.com/sendgrid/php-http-client/tree/master/test/unit)` directory.
120
+
All test files are in the [`/test/unit`](https://github.com/sendgrid/php-http-client/tree/master/test/unit) directory.
117
121
118
122
For the purposes of contributing to this repo, please update the [`ClientTest.php`](https://github.com/sendgrid/php-http-client/blob/master/test/unit/ClientTest.php) file with unit tests as you modify the code.
Generally, we follow the style guidelines as suggested by the official language. However, we ask that you conform to the styles that already exist in the library. If you wish to deviate, please explain your reasoning.
Copy file name to clipboardExpand all lines: README.md
+45-97Lines changed: 45 additions & 97 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,36 @@
2
2
3
3
**Quickly and easily access any REST or REST-like API.**
4
4
5
+
# Announcements
6
+
7
+
All updates to this library is documented in our [CHANGELOG](https://github.com/sendgrid/php-http-client/blob/master/CHANGELOG.md).
8
+
9
+
# Installation
10
+
11
+
Add php-http-client to your `composer.json` file. If you are not using [Composer](http://getcomposer.org), you should be. It's an excellent way to manage dependencies in your PHP application.
12
+
13
+
```json
14
+
{
15
+
"require": {
16
+
"sendgrid/php-http-client": "2.*"
17
+
}
18
+
}
19
+
```
20
+
21
+
Then at the top of your PHP script require the autoloader:
Add php-http-client to your `composer.json` file. If you are not using [Composer](http://getcomposer.org), you should be. It's an excellent way to manage dependencies in your PHP application.
39
-
40
-
```json
41
-
{
42
-
"require": {
43
-
"sendgrid/php-http-client": "2.*"
44
-
}
45
-
}
46
-
```
47
-
48
-
Then at the top of your PHP script require the autoloader:
49
-
50
-
```php
51
-
require __DIR__ . '/vendor/autoload.php';
52
-
```
53
-
54
-
Then from the command line:
55
-
56
-
```bash
57
-
composer install
58
-
```
59
-
60
-
## Usage ##
61
-
62
-
Following is an example using SendGrid. You can get your free account [here](https://sendgrid.com/free?source=php-http-client).
66
+
# Usage
63
67
64
-
First, update your .env with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys) and HOST. For this example HOST=https://api.sendgrid.com.
If you are intersted in the future direction of this project, please take a look at our [milestones](https://github.com/sendgrid/php-http-client/milestones). We would love to hear your feedback.
120
73
121
-
#Announcements
74
+
## How to Contribute
122
75
123
-
[2016.03.28] - We hit version 1!
76
+
We encourage contribution to our libraries, please see our [CONTRIBUTING](https://github.com/sendgrid/php-http-client/blob/master/CONTRIBUTING.md)) guide for details.
We encourage contribution to our libraries, please see our [CONTRIBUTING](https://github.com/sendgrid/php-http-client/blob/master/CONTRIBUTING.md) guide for details.
0 commit comments