Subversion Repositories cheapmusic

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
103 - 1
Hello! Thank you for choosing to help contribute to one of the SendGrid open source libraries. 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)
9
- [Testing](#testing)
10
- [Style Guidelines & Naming Conventions](#style_guidelines_and_naming_conventions)
11
- [Creating a Pull Request](#creating_a_pull_request)
12
 
13
<a name="roadmap"></a>
14
We use [Milestones](https://github.com/sendgrid/sendgrid-php/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.
15
 
16
<a name="cla"></a>
17
## CLAs and CCLAs
18
 
19
Before you get started, SendGrid requires that a SendGrid Contributor License Agreement (CLA) be filled out by every contributor to a SendGrid open source project.
20
 
21
Our goal with the CLA 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 encourages broad participation by our open source community and helps 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. Copies of the CLA are available [here](https://gist.github.com/SendGridDX/98b42c0a5d500058357b80278fde3be8#file-sendgrid_cla).
24
 
25
When you create a Pull Request, after a few seconds, a comment will appear with a link to the CLA. Click the link and fill out the brief form and then click the "I agree" button and you are all set. You will not be asked to re-sign the CLA unless we make a change.
26
 
27
There are a few ways to contribute, which we'll enumerate below:
28
 
29
<a name="feature_request"></a>
30
## Feature Request
31
 
32
If you'd like to make a feature request, please read this section.
33
 
34
The GitHub issue tracker is the preferred channel for library feature requests, but please respect the following restrictions:
35
 
36
- Please **search for existing issues** in order to ensure we don't have duplicate bugs/feature requests.
37
- Please be respectful and considerate of others when commenting on issues
38
 
39
<a name="submit_a_bug_report"></a>
40
## Submit a Bug Report
41
 
42
Note: DO NOT include your credentials in ANY code examples, descriptions, or media you make public.
43
 
44
A software bug is a demonstrable issue in the code base. In order for us to diagnose the issue and respond as quickly as possible, please add as much detail as possible into your bug report.
45
 
46
Before you decide to create a new issue, please try the following:
47
 
48
1. Check the Github issues tab if the identified issue has already been reported, if so, please add a +1 to the existing post.
49
2. Update to the latest version of this code and check if issue has already been fixed
50
3. Copy and fill in the Bug Report Template we have provided below
51
 
52
### Please use our Bug Report Template
53
 
54
In order to make the process easier, we've included a [sample bug report template](https://github.com/sendgrid/sendgrid-php/blob/master/.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.
55
 
56
<a name="improvements_to_the_codebase"></a>
57
## Improvements to the Codebase
58
 
59
We welcome direct contributions to the sendgrid-php code base. Thank you!
60
 
61
### Development Environment ###
62
 
63
#### Install and Run Locally ####
64
 
65
##### Prerequisites #####
66
 
67
- PHP 5.6 or 7.0
68
 
69
##### Initial setup: #####
70
 
71
```bash
72
git clone https://github.com/sendgrid/sendgrid-php.git
73
cd sendgrid-php
74
composer install
75
```
76
 
77
## Environment Variables
78
 
79
First, get your free SendGrid account [here](https://sendgrid.com/free?source=sendgrid-php).
80
 
81
Next, update your environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys).
82
 
83
```bash
84
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
85
echo "sendgrid.env" >> .gitignore
86
source ./sendgrid.env
87
```
88
 
89
##### Execute: #####
90
 
91
See the [examples folder](https://github.com/sendgrid/sendgrid-php/tree/master/examples) to get started quickly.
92
 
93
If you are using composer, replace <PATH_TO> with the path to your `vendor/autoload.php`. Otherwise, include lib/SendGrid.php and lib/helpers/mail/Mail.php.
94
 
95
<a name="understanding_the_codebase"></a>
96
## Understanding the Code Base
97
 
98
**/examples**
99
 
100
Working examples that demonstrate usage.
101
 
102
```bash
103
php examples/example.php
104
```
105
 
106
**/test/unit**
107
 
108
Unit tests for the HTTP client.
109
 
110
**/lib**
111
 
112
The interface to the SendGrid API.
113
 
114
<a name="testing"></a>
115
## Testing
116
 
117
All PRs require passing tests before the PR will be reviewed.
118
 
119
All test files are in the [`/test/unit`](https://github.com/sendgrid/sendgrid-php/tree/master/test/unit) directory.
120
 
121
For the purposes of contributing to this repo, please update the [`SendGridTest.php`](https://github.com/sendgrid/sendgrid-php/tree/master/test/unit/SendGridTest.php) file with unit tests as you modify the code.
122
 
123
```bash
124
composer install
125
cd test/unit
126
../../vendor/bin/phpunit . --bootstrap bootstrap.php --filter test*
127
```
128
 
129
<a name="style_guidelines_and_naming_conventions"></a>
130
## Style Guidelines & Naming Conventions
131
 
132
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.
133
 
134
- [PSR2 Coding Standards](http://www.php-fig.org/psr/psr-2/)
135
 
136
Please run your code through:
137
 
138
- [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer)
139
 
140
## Creating a Pull Request<a name="creating_a_pull_request"></a>
141
 
142
1. [Fork](https://help.github.com/fork-a-repo/) the project, clone your fork,
143
   and configure the remotes:
144
 
145
   ```bash
146
   # Clone your fork of the repo into the current directory
147
   git clone https://github.com/sendgrid/sendgrid-php
148
   # Navigate to the newly cloned directory
149
   cd sendgrid-php
150
   # Assign the original repo to a remote called "upstream"
151
   git remote add upstream https://github.com/sendgrid/sendgrid-php
152
   ```
153
 
154
2. If you cloned a while ago, get the latest changes from upstream:
155
 
156
   ```bash
157
   git checkout <dev-branch>
158
   git pull upstream <dev-branch>
159
   ```
160
 
161
3. Create a new topic branch (off the main project development branch) to
162
   contain your feature, change, or fix:
163
 
164
   ```bash
165
   git checkout -b <topic-branch-name>
166
   ```
167
 
168
4. Commit your changes in logical chunks. Please adhere to these [git commit
169
   message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
170
   or your code is unlikely be merged into the main project. Use Git's
171
   [interactive rebase](https://help.github.com/articles/interactive-rebase)
172
   feature to tidy up your commits before making them public.
173
 
174
4a. Create tests.
175
 
176
4b. Create or update the example code that demonstrates the functionality of this change to the code.
177
 
178
5. Locally merge (or rebase) the upstream development branch into your topic branch:
179
 
180
   ```bash
181
   git pull [--rebase] upstream master
182
   ```
183
 
184
6. Push your topic branch up to your fork:
185
 
186
   ```bash
187
   git push origin <topic-branch-name>
188
   ```
189
 
190
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
191
	with a clear title and description against the `master` branch. All tests must be passing before we will review the PR.
192
 
193
If you have any additional questions, please feel free to [email](mailto:dx@sendgrid.com) us or create an issue in this repo.