View Source

h1. Contributing to Zend Framework


h2. Read the license

Zend Framework is licensed under the New BSD License. It can be found [here|].

h2. Sign the Contributor License Agreement (CLA)

To contribute source code or documentation at any level (from a few lines, to a patch, to a proposal, to an entirely new component), you must first sign the [Contributor License Agreement|]. This will also give you access as a developer in the issue tracking system and the wiki.

h2. Subscribe to the appropriate mailing lists

Please join the Zend Framework community by subscribing to the mailing lists that interest you, using the e-mail account you wish to send messages from.

You can also view all messages through our [searchable mailing list archive|].
||List||Subscribe||Unsubscribe||Digest Subscribe||Digest Unsubscribe||Archives||
|Announcements|[Subscribe|]|[Unsubscribe|]|[Digest Subscribe|]|[Digest Unsubscribe|]|[]|
|Authentication and authorization|[Subscribe|]|[Unsubscribe|]|[Digest Subscribe|]|[Digest Unsubscribe|]|[]|
|Core|[Subscribe|]|[Unsubscribe|]|[Digest Subscribe|]|[Digest Unsubscribe|]|[]|
|Database|[Subscribe|]|[Unsubscribe|]|[Digest Subscribe|]|[Digest Unsubscribe|]|[]|
|Documentation|[Subscribe|]|[Unsubscribe|]|[Digest Subscribe|]|[Digest Unsubscribe|]|[]|
|General|[Subscribe|]|[Unsubscribe|]|[Digest Subscribe|]|[Digest Unsubscribe|]|[]|
|Google Gdata|[Subscribe|]|[Unsubscribe|]|[Digest Subscribe|]|[Digest Unsubscribe|]|[]|
|Internationalization|[Subscribe|]|[Unsubscribe|]|[Digest Subscribe|]|[Digest Unsubscribe|]|[]|
|Formats|[Subscribe|]|[Unsubscribe|]|[Digest Subscribe|]|[Digest Unsubscribe|]|[]|
|MVC|[Subscribe|]|[Unsubscribe|]|[Digest Subscribe|]|[Digest Unsubscribe|]|[]|
|Server|[Subscribe|]|[Unsubscribe|]|[Digest Subscribe|]|[Digest Unsubscribe|]|[]|
|Web Services|[Subscribe|]|[Unsubscribe|]|[Digest Subscribe|]|[Digest Unsubscribe|]|[]|

h3. How to subscribe

Please remember to subscribe using the e-mail address you use to post messages. Using a different e-mail address may result in substantial delays or a lost message, since we manually review and approve non-spam messages received from e-mail addresses not subscribed to a mailing list.

You may subscribe to each list individually, according to your preference, or you may use a shortcut to subscribe to all the lists, except fw-announce, fw-general, fw-docs, fw-svn. The shortcut is [|].

{warning}Do not subscribe to both fw-all and any of the other lists (other than fw-announce, fw-general, fw-docs, or fw-svn), or you will get duplicate messages.{warning}

In general, to subscribe, send a mail to (listname) (e.g.,

h3. How to unsubscribe

Every mail sent by a list contains mail headers. (To view them in Thunderbird, use Ctrl-U.) For example:

* List-Post: <>
* List-Help: <>
* List-Unsubscribe: <>
* List-Subscribe: <>

In general, to unsubscribe, send a mail to (listname) (e.g.,

h3. RSS
[RSS feeds and custom event notifications|RSS Feeds and Notifications] are also available from our website.

h2. Contribute to the wiki

|End-user wiki|[]|

h2. Report, work on, and resolve issues in the issue tracker

The [issue tracker|] is the place to submit issues of all types. This includes bugs, change requests, feature requests, and small patches. See [$1523]. If large enough, feature requests should be [submitted as a proposal|]. The issue tracker is also the place to track the [release roadmap|] and view the current status of framework components.

If you find yourself constantly submitting patches and having the need for direct access to the Subversion repository, ask and your request will be considered. Please read the [Subversion Standards] before submitting code via Subversion.

To be assigned an issue, you must sign the CLA.

Please read [Issue Tracker Etiquette] before working on issues.

h2. Review Subversion commits

As code comes into Subversion, it is displayed in our [Fisheye browser|] with the changesets listed with full diffs. Review commits and double-check the work of others&mdash;the more eyes, the better. This is also a great way to get a feel for the framework coding style and culture.

h2. Review and submit a proposal

Proposals are contributed by developers and end-users of the Zend Framework. Our [proposal wiki space|] shows the current status of proposals and manages the review process. Submit new proposals here, or help review other submissions as part of our collective intelligence.

h2. Learn PHPUnit

Zend Framework development is backed by extensive unit testing. We use [PHPUnit|] extensively as our testing framework. For code to be accepted, it *must* be tested and covered by a unit test. Please see our [testing standards guide and tutorial|$2673] for more information.

Developers are expected to keep documentation and unit tests in sync with changes to code.

h2. Review the coding standards

All framework code is covered by the [PHP Coding Standard (draft)]. Learn it, love it, live it.

Please "watch" the page above using the "envelope" icon on the top-right side of the page. Confluence (the wiki system we use) has a robust e-mail notification system, accessed through "Preferences" after logging in. From there, click on the "Watches" folder tab, and see the link to "E-mail preferences".

h2. Learn best practices

h3. Common sense

API changes should be committed in parallel with updated documentation.

h3. Factory methods, classes, and patterns

For the following, we define "factory" as a class or method that creates instance objects of one or more classes other than the class of the factory.

Direct instantiation is the preferred choice, and factory classes should be avoided if at all possible. Only when sufficient need exists should they be considered. Sometimes the code in a factory method could be moved to a common, shared superclass.

h3. Container API guidelines

For the time being, we have decided to avoid trying to micromanage implementation details of framework components with containers to suit potential points of reuse throughout the framework. Zend_Session, for example, must wrap a nested PHP array ({{$_SESSION}}), not the recursive data structure found in Zend_Config. In a few months, we can revisit this issue and discuss whether implementations of existing components with container data structures should be refactored.

However, we would like to propose API conventions to help maintain consistency in style for accessing and manipulating container objects, without requiring complicated refactoring of container interfaces, classes, and implementations across diverse components.

When getting and setting data in a random-access container using keys, we suggest the following required, basic operations:

* {{__get()}}
* {{__set()}}
* {{__isset()}}
* {{__unset()}}

When appropriate, containers should also implement the standard PHP Countable and Iterator interfaces, if only to facilitate debugging by those using the container class.

If the keys used for getting and setting use characters not permitted in PHP identifiers, then use methods named {{get()}}, {{set()}}, {{isset()}}, and {{unset()}} instead of the magic methods. Due to the international flavor of Zend Framework, please carefully consider whether those speaking other languages will need to use {{get($propName)}} and {{set($propName, $value)}}. Using consistently-named methods for the same purpose across multiple classes increases readability and ease of use. Mixing the {{$object->propName}} and {{$object->get('propName')}} styles, on the other hand, can lead to confusion. Pick one and be consistent.

Only implement ArrayAccess and {{__call()}} if they are relevant and do not overlap in functionality with the other accessors.

{note:title=Please note}This section discusses accessing items in a container data structure, not other properties of the object wrapping the container. Accessor methods for these other properties might have different requirements. Defined extension points should be represented by normal functions to access the properties they encapsulate.{note}

h2. Join a project team

Zend Framework development is done on the basis of large teams working together on related components. It is our experience that having these discussions in bigger groups (which previously were held most directly with Zend) fosters an environment where ideas and proposals are more mature, and also where less work needs to be done afterward due to a significantly shortened peer review process.

h3. Project team wiki pages

* Team members (add yourself if your name is missing)
* Team's components
* Who is working on which components, including coordinators
* Major milestones
* Tasks needed to accomplish milestones
* What help is needed (very important!)

h3. Project team responsibilities

Each project team is responsible for producing status updates in the form of newsletters.

* Zend project team members help and work with community members on each team
* Newsletters are to be mailed to fw-general and the team-specific mailing list
* Updates are to be published every two weeks to the wiki
* All team members can help update the team's wiki page
* All team members can help author a wiki page containing the status update

We need each team to study the other team's wiki pages and borrow ideas to improve their wiki team page. The pages don't need to be identical, and some things will work better for different teams. Don't be afraid to improve something someone else edited. Be creative!

Also, coordinators and everyone else should help identify tasks to list under "Help Wanted" sections. We are an open community, and each project team should be receptive and open to finding areas for community members to help.

h2. Contribute code

Component leads and significant contributors will be granted direct access to the Subversion repository. Please read the [Subversion Standards] before submitting new code via Subversion.