Controversial Changes to PEAR2 Standards
- Title: PEAR2 Coding Standards Controversial Changes
- Version: 0.4.0
- Status: Draft
- Type: Standards
- Last updated: September 3rd, 2007
- Name: Gregory Beaver
- Email: email@example.com
- This proposal is under CC-By-Sharealike ([http://creativecommons.org/licenses/by-sa/3.0/]) licensing.
- Mailing List: http://news.php.net/php.pear.dev
This document itemizes changes to the coding standards that refer to loading of external files containing classes.
These have been extracted from the general PEAR2 Standards.
Documenting the location of external classes (classes not contained within a file) is an important problem to solve within PEAR2. There are two kinds of external classes:
- those contained within the current package
- external package dependencies
This recommendation defines how to handle both
This document describes the coding standards and coding conventions for the new PEAR2 repository.
Approach & Requirements
Packages that wish to be accepted into the PEAR2 repository must conform to these standards
File dependencies (required and optional) should be registered at the top of the file using / */ documentation comments as well as with full import statements: <?php /
- My Package
- @uses PEAR2::SomeotherPackage in PEAR2/SomeotherPackage.php (package PEAR2::Someotherpackage must be installed)
- @uses PEAR2::PackageName::Exception in PEAR2/PackageName/Exception.php
- @package PEAR2_PackageName
use ::PEAR2::PackageName::Exception as Exception; use ::PEAR2::SomeotherPackage as PEAR2::SomeotherPackage; ?>
No Exceptions to this rule