|
| 1 | +# Contributing to Cloudinary PHP library |
| 2 | + |
| 3 | +Contributions are welcome and greatly appreciated! |
| 4 | + |
| 5 | +## Reporting a bug |
| 6 | + |
| 7 | +- Make sure that the bug was not already reported by searching in GitHub under [Issues](https://github.com/cloudinary/cloudinary_php) and the Cloudinary [Support forms](https://support.cloudinary.com). |
| 8 | +- If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/cloudinary/cloudinary_php/issues/new). |
| 9 | + Be sure to include a **title and clear description**, as relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring. |
| 10 | +- If you require assistance in the implementation of cloudinary_php please [submit a request](https://support.cloudinary.com/hc/en-us/requests/new) on Cloudinary's site. |
| 11 | + |
| 12 | +## Requesting a feature |
| 13 | + |
| 14 | +We would love to receive your requests! |
| 15 | +Please be aware that the library is used in a wide variety of environments and that some features may not be applicable to all users. |
| 16 | + |
| 17 | +- Open a GitHub [issue](https://github.com/cloudinary/cloudinary_php) describing the benefits (and possible drawbacks) of the requested feature |
| 18 | + |
| 19 | +## Fixing a bug / Implementing a new feature |
| 20 | + |
| 21 | +- Follow the instructions detailed in [Code contribution](#code-contribution) |
| 22 | +- Open a new GitHub pull request |
| 23 | +- Ensure the PR description clearly describes the bug / feature. Include relevant issue number if applicable. |
| 24 | +- Provide test code that covers the new code |
| 25 | +- The code should support: |
| 26 | + - PHP >= 5.6 |
| 27 | + |
| 28 | +## Code contribution |
| 29 | + |
| 30 | +When contributing code, either to fix a bug or to implement a new feature, please follow these guidelines: |
| 31 | + |
| 32 | +#### Fork the Project |
| 33 | + |
| 34 | +Fork [project on Github](https://github.com/cloudinary/cloudinary_php) and check your copy. |
| 35 | + |
| 36 | +``` |
| 37 | +git clone https://github.com/contributor/cloudinary_php.git |
| 38 | +cd cloudinary_php |
| 39 | +git remote add upstream https://github.com/cloudinary/cloudinary_php.git |
| 40 | +``` |
| 41 | + |
| 42 | +#### Create a Topic Branch |
| 43 | + |
| 44 | +Make sure your fork is up-to-date and create a topic branch for your feature or bug fix. |
| 45 | + |
| 46 | +``` |
| 47 | +git checkout master |
| 48 | +git pull upstream master |
| 49 | +git checkout -b my-feature-branch |
| 50 | +``` |
| 51 | +#### Rebase |
| 52 | + |
| 53 | +If you've been working on a change for a while, rebase with upstream/master. |
| 54 | + |
| 55 | +``` |
| 56 | +git fetch upstream |
| 57 | +git rebase upstream/master |
| 58 | +git push origin my-feature-branch -f |
| 59 | +``` |
| 60 | + |
| 61 | + |
| 62 | +#### Write Tests |
| 63 | + |
| 64 | +Try to write a test that reproduces the problem you're trying to fix or describes a feature you would like to build. |
| 65 | + |
| 66 | +We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix. |
| 67 | + |
| 68 | +#### Write Code |
| 69 | + |
| 70 | +Implement your feature or bug fix. |
| 71 | +Follow the following PHP coding standards, described in [PSR-0](http://www.php-fig.org/psr/psr-0/), [PSR-1](http://www.php-fig.org/psr/psr-1/), [PSR-2](http://www.php-fig.org/psr/psr-2/) and [PSR-4](http://www.php-fig.org/psr/psr-4/) documentation. |
| 72 | +The code should support: |
| 73 | + |
| 74 | + - PHP >= 5.6 |
| 75 | + |
| 76 | +Make sure that `phpunit` completes without errors. |
| 77 | + |
| 78 | +#### Write Documentation |
| 79 | + |
| 80 | +Document any external behavior in the [README](README.md). |
| 81 | + |
| 82 | +#### Commit Changes |
| 83 | + |
| 84 | +Make sure git knows your name and email address: |
| 85 | + |
| 86 | +``` |
| 87 | +git config --global user.name "Your Name" |
| 88 | +git config --global user.email "contributor@example.com" |
| 89 | +``` |
| 90 | + |
| 91 | +Writing good commit logs is important. A commit log should describe what changed and why. |
| 92 | + |
| 93 | +``` |
| 94 | +git add ... |
| 95 | +git commit |
| 96 | +``` |
| 97 | + |
| 98 | + |
| 99 | +> Please squash your commits into a single commit when appropriate. This simplifies future cherry picks and keeps the git log clean. |
| 100 | +
|
| 101 | +#### Push |
| 102 | + |
| 103 | +``` |
| 104 | +git push origin my-feature-branch |
| 105 | +``` |
| 106 | + |
| 107 | +#### Make a Pull Request |
| 108 | + |
| 109 | +Go to https://github.com/contributor/cloudinary_php and select your feature branch. Click the 'Pull Request' button and fill out the form. Pull requests are normally reviewed within a few days. |
| 110 | +Ensure the PR description clearly describes the problem and solution. Include relevant issue number if applicable. |
| 111 | + |
| 112 | +#### Rebase |
| 113 | + |
| 114 | +If you've been working on a change for a while, rebase with upstream/master. |
| 115 | + |
| 116 | +``` |
| 117 | +git fetch upstream |
| 118 | +git rebase upstream/master |
| 119 | +git push origin my-feature-branch -f |
| 120 | +``` |
| 121 | + |
| 122 | +#### Check on Your Pull Request |
| 123 | + |
| 124 | +Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI. Everything should look green, otherwise - fix issues and amend your commit as described above. |
| 125 | + |
| 126 | +#### Be Patient |
| 127 | + |
| 128 | +It's likely that your change will not be merged and that the nitpicky maintainers will ask you to do more, or fix seemingly benign problems. Hang on there! |
| 129 | + |
| 130 | +#### Thank You |
| 131 | + |
| 132 | +Please do know that we really appreciate and value your time and work. We love you, really. |
0 commit comments