Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

About correction of PEAR manual #2

Closed
hidenori-wasa opened this Issue Nov 24, 2011 · 0 comments

Comments

Projects
None yet
1 participant
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:

<?php

namespace 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:

<?php

namespace PEAR2[\<CategoryName>];
class <MainClassName>_Exception extends PEAR2\Exception {}

?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment