| 12345 |
anikendra |
1 |
# How to contribute
|
|
|
2 |
|
|
|
3 |
CakePHP loves to welcome your contributions. There are several ways to help out:
|
|
|
4 |
* Create an [issue](https://github.com/cakephp/cakephp/issues) on GitHub, if you have found a bug
|
|
|
5 |
* Write test cases for open bug issues
|
|
|
6 |
* Write patches for open bug/feature issues, preferably with test cases included
|
|
|
7 |
* Contribute to the [documentation](https://github.com/cakephp/docs)
|
|
|
8 |
|
|
|
9 |
There are a few guidelines that we need contributors to follow so that we have a
|
|
|
10 |
chance of keeping on top of things.
|
|
|
11 |
|
|
|
12 |
## Getting Started
|
|
|
13 |
|
|
|
14 |
* Make sure you have a [GitHub account](https://github.com/signup/free).
|
|
|
15 |
* Submit an [issue](https://github.com/cakephp/cakephp/issues), assuming one does not already exist.
|
|
|
16 |
* Clearly describe the issue including steps to reproduce when it is a bug.
|
|
|
17 |
* Make sure you fill in the earliest version that you know has the issue.
|
|
|
18 |
* Fork the repository on GitHub.
|
|
|
19 |
|
|
|
20 |
## Making Changes
|
|
|
21 |
|
|
|
22 |
* Create a topic branch from where you want to base your work.
|
|
|
23 |
* This is usually the master branch.
|
|
|
24 |
* Only target release branches if you are certain your fix must be on that
|
|
|
25 |
branch.
|
|
|
26 |
* To quickly create a topic branch based on master; `git branch
|
|
|
27 |
master/my_contribution master` then checkout the new branch with `git
|
|
|
28 |
checkout master/my_contribution`. Better avoid working directly on the
|
|
|
29 |
`master` branch, to avoid conflicts if you pull in updates from origin.
|
|
|
30 |
* Make commits of logical units.
|
|
|
31 |
* Check for unnecessary whitespace with `git diff --check` before committing.
|
|
|
32 |
* Use descriptive commit messages and reference the #issue number.
|
|
|
33 |
* Core test cases should continue to pass. You can run tests locally or enable
|
|
|
34 |
[travis-ci](https://travis-ci.org/) for your fork, so all tests and codesniffs
|
|
|
35 |
will be executed.
|
|
|
36 |
* Your work should apply the [CakePHP coding standards](http://book.cakephp.org/2.0/en/contributing/cakephp-coding-conventions.html).
|
|
|
37 |
|
|
|
38 |
## Which branch to base the work
|
|
|
39 |
|
|
|
40 |
* Bugfix branches will be based on master.
|
|
|
41 |
* New features that are backwards compatible will be based on next minor release
|
|
|
42 |
branch.
|
|
|
43 |
* New features or other non backwards compatible changes will go in the next major release branch.
|
|
|
44 |
|
|
|
45 |
## Submitting Changes
|
|
|
46 |
|
|
|
47 |
* Push your changes to a topic branch in your fork of the repository.
|
|
|
48 |
* Submit a pull request to the repository in the cakephp organization, with the
|
|
|
49 |
correct target branch.
|
|
|
50 |
|
|
|
51 |
## Test cases and codesniffer
|
|
|
52 |
|
|
|
53 |
CakePHP tests requires [PHPUnit](http://www.phpunit.de/manual/current/en/installation.html)
|
|
|
54 |
3.7, version 4 is not compatible. To run the test cases locally use the following command:
|
|
|
55 |
|
|
|
56 |
./lib/Cake/Console/cake test core AllTests --stderr
|
|
|
57 |
|
|
|
58 |
To run the sniffs for CakePHP coding standards:
|
|
|
59 |
|
|
|
60 |
phpcs -p --extensions=php --standard=CakePHP ./lib/Cake
|
|
|
61 |
|
|
|
62 |
Check the [cakephp-codesniffer](https://github.com/cakephp/cakephp-codesniffer)
|
|
|
63 |
repository to setup the CakePHP standard. The [README](https://github.com/cakephp/cakephp-codesniffer/blob/master/README.mdown) contains installation info
|
|
|
64 |
for the sniff and phpcs.
|
|
|
65 |
|
|
|
66 |
# Additional Resources
|
|
|
67 |
|
|
|
68 |
* [CakePHP coding standards](http://book.cakephp.org/2.0/en/contributing/cakephp-coding-conventions.html)
|
|
|
69 |
* [Existing issues](https://github.com/cakephp/cakephp/issues)
|
|
|
70 |
* [Development Roadmaps](https://github.com/cakephp/cakephp/wiki#roadmaps)
|
|
|
71 |
* [General GitHub documentation](https://help.github.com/)
|
|
|
72 |
* [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
|
|
|
73 |
* #cakephp IRC channel on freenode.org
|