If you wish to contribute to Zend Framework, please be sure to read/subscribe to the following resources:
If you are working on new features or refactoring create a proposal.
If you have encountered a potential security vulnerability, please DO NOT report it on the public issue tracker: send it to us at zf-security@zend.com instead. We will work with you to verify the vulnerability and patch it as soon as possible.
When reporting issues, please provide the following information:
We request that you contact us via the email address above and give the project contributors a chance to resolve the vulnerability and issue a new release prior to any public exposure; this helps protect users and provides them with a chance to upgrade and/or update in order to protect their applications.
For sensitive email communications, please use our PGP key.
Documentation is in GitHub Flavored Markdown, and rendered using bookdown. Please read and follow the general documentation guidelines when providing documentation.
All new features must include documentation before they may be accepted and merged.
To run tests:
$ git clone git@github.com:zendframework/zend-diactoros.git
$ cd
$ curl -sS https://getcomposer.org/installer | php --
$ ./composer.phar install
If you don't have curl
installed, you can also download composer.phar
from https://getcomposer.org/
phpunit
and the provided PHPUnit config, like in this example: $ ./vendor/bin/phpunit
This component uses phpcs for coding
standards checks, and provides configuration for our selected checks.
phpcs
is installed by default via Composer.
To run checks only:
$ composer cs-check
phpcs
also installs a tool named phpcbf
which can attempt to fix problems
for you:
$ composer cs-fix
If you allow phpcbf to fix CS issues, please re-run the tests to ensure they pass, and make sure you add and commit the changes after verification.
Your first step is to establish a public repository from which we can pull your work into the master repository. We recommend using GitHub, as that is where the component is already hosted.
$ git clone git://github.com/zendframework/zend-diactoros.git
$ cd zend-diactoros
$ git remote add {username} git@github.com:{username}/zend-diactoros.git
$ git fetch {username}
Periodically, you should update your fork or personal repository to match the canonical repository. Assuming you have setup your local repository per the instructions above, you can do the following:
$ git checkout master
$ git fetch origin
$ git rebase origin/master
# OPTIONALLY, to keep your remote up-to-date -
$ git push {username} master:master
If you're tracking other branches -- for example, the "develop" branch, where new feature development occurs -- you'll want to do the same operations for that branch; simply substitute "develop" for "master".
We recommend you do each new feature or bugfix in a new branch. This simplifies the task of code review as well as the task of merging your changes into the canonical repository.
A typical workflow will then consist of the following:
git checkout -b
.)The mechanics of this process are actually quite trivial. Below, we will create a branch for fixing an issue in the tracker.
$ git checkout -b hotfix/9295
Switched to a new branch 'hotfix/9295'
... do some work ...
$ git commit
... write your log message ...
$ git push {username} hotfix/9295:hotfix/9295
Counting objects: 38, done.
Delta compression using up to 2 threads.
Compression objects: 100% (18/18), done.
Writing objects: 100% (20/20), 8.19KiB, done.
Total 20 (delta 12), reused 0 (delta 0)
To ssh://git@github.com/{username}/zend-diactoros.git
b5583aa..4f51698 HEAD -> master
To send a pull request, you have two options.
If using GitHub, you can do the pull request from there. Navigate to your repository, select the branch you just created, and then select the "Pull Request" button in the upper right. Select the user/organization "zendframework" as the recipient.
If using your own repository - or even if using GitHub - you can use git
format-patch
to create a patchset for us to apply; in fact, this is
recommended for security-related patches. If you use format-patch
, please
send the patches as attachments to:
Which branch should you issue a pull request against?
As you might imagine, if you are a frequent contributor, you'll start to get a ton of branches both locally and on your remote.
Once you know that your changes have been accepted to the master repository, we suggest doing some cleanup of these branches.
$ git branch -d <branchname>
$ git push {username} :<branchname>
Please see our CONDUCT.md to understand expected behavior when interacting with others in the project.