pear2/Autoload — Issue #2: About the correction of the PEAR manual
Author: hidenori-wasa
Created: 2011-11-24 20:05:32+00:00
State: open

I thinks that we had better correct PEAR manual as follows.

http://pear.php.net/manual/en/pear2cs.rules.php

--------------------------------------------------------------------------------
from:

Class-to-file convention
All public classes must be in their own file with underscores (_) or namespace separators (\) replaced by directory separator, so that PEAR2_PackageName_Base class or PEAR2\PackageName\Base class is always located in PEAR2/PackageName/Base.php (this is required to make autoload work)

to:

Class-to-file convention
All public classes must be in their own file with underscores (_) or namespace separators (\) replaced by directory separator, so that PEAR2_[CategoryName_]MainClassName class or PEAR2\[CategoryName\]MainClassName class is always located in PEAR2/[CategoryName/]MainClassName.php (this is required to make autoload work)
As supplement, PEAR2_[CategoryName_]MainClassName is PackageName.

--------------------------------------------------------------------------------
from:

Base Exception class
PEAR2\Exception is used as base class for all exception classes. Each package must define a base class that is packagename_Exception. For example, the PEAR2\PackageName class defines an exception as follows in PEAR2/PackageName/Exception.php:

PEAR2\PackageName;
class Exception extends PEAR2\Exception {}

?>

to:

Base Exception class
PEAR2\Exception is used as base class for all exception classes. Each package must define a base class that is MainClassName_Exception. For example, the PEAR2\[CategoryName\]MainClassName class defines an exception as follows in PEAR2/[CategoryName/]MainClassName/Exception.php:

PEAR2[\CategoryName];
class MainClassName_Exception extends PEAR2\Exception {}

?>