pear:rfc:pear2_standards:controversial_changes

Controversial Changes to PEAR2 Standards

Summary

Information

Document Information

  • Title: PEAR2 Coding Standards Controversial Changes
  • Version: 0.4.0
  • Status: Draft
  • Type: Standards
  • Last updated: September 3rd, 2007

Author(s) Information

  • Name: Gregory Beaver
  • Email: cellog@php.net

Discussion List

Introduction

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:

  1. those contained within the current package
  2. external package dependencies

This recommendation defines how to handle both

Summary

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

Definition

Handling dependencies

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
  • /

namespace PEAR2;

 use ::PEAR2::PackageName::Exception as Exception;
 use ::PEAR2::SomeotherPackage as PEAR2::SomeotherPackage;
 ?>

Requirement

No Exceptions to this rule

pear/rfc/pear2_standards/controversial_changes.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1