Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

PHP Extension and Add-on Repository (PEAR)
PEAR Standards
Perhaps the most important part of the PEAR project is finally defining an official standard for creating reusable, well documented php packages. A standard set of guidelines are necessary to make sure all PEAR packages are available to as many developers as possible. Since PEAR is still in development, the current set of rules and guidelines are subject to discussion and change. If you take issue with any of these guidelines, or have a better solution, you should let the developers know by posting to the PHP-PEAR mailing list.
Naming Guidelines
The extension .php must be used for all files containing php code. A related set of one or more classes and functions are called a "package". These packages are organized into the PEAR package structure. The package structure maps 1:1 to the file system, but is based on the argument provided to the "use" or "import" functions.
  • DB
    • DB/common
    • DB/mysql
  • HTML
    • HTML/Form
Because PHP does not implement name-spaces, class names must be based on the package they are implemented in. The class name is derived by simply replacing the slashes in the package name with under scores. Thus, the package "DB/common" has it's code in the file "DB/common.php", and defines a class called "DB_common". This strategy should prevent any naming collisions despite the lack of separate name-spaces.
Functions should be named with underscores separating lowercase words, for example my_function. Methods should use initial lowercase studly caps, like myMethod.
[ Next Page ]

[Page 1]  [Page 2]  


Comments:
Howto configure and use PEAR with MySQLThanh To06/25/07 14:28
RE: Another levelRob04/20/03 16:19
RE: where can i get latest PEAR?Sven Zurnieden03/26/03 09:41
RE: JavadocKillerLoop01/21/03 13:01
PHP extensionSherri Golden10/18/02 11:52
RE: where can i get latest PEAR?Claudio Bustos09/14/02 16:42
To create a user with root acessSaravanan 01/02/02 01:28
hiiiiiiiiimurali10/25/01 14:47
php programming styleheadcore10/23/01 08:20
RE: where can i get latest PEAR?Shanx04/11/01 00:23
PEAR site nearly emptyJames03/06/01 01:12
Leaving out PHP3Seek3r02/28/01 23:39
where can i get latest PEAR?winnie02/05/01 07:24
RE: phpdoc (was Javadoc) Asger Henriksen01/10/01 15:30
RE: phpdoc (was Javadoc) philip olson01/06/01 01:26
RE: Another level [calling all space cadets]biolight07/19/00 02:36
RE: Another level [calling all space cadets]biolight07/19/00 02:35
Another levelSaber Karmous07/14/00 11:50
RE: JavadocSean Cazzell07/14/00 03:20
RE: JavadocMatt07/13/00 14:24
RE: JavadocIlja Hehenkamp07/13/00 12:40
RE: JavadocSean Cazzell07/13/00 03:27
JavadocVesa Nippala07/13/00 01:19
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.