PHP Coding Standard and 50+ Programming Skills

  PHP Coding Standard and 50+ Programming Skills from Ho Kim   @see http://www.kimbs.cn/category/coding-standards/ @see http://framework.zend.com/wiki/display/ZFDEV/PHP+Coding+Standard+(draft) @see http://framework.zend.com/manual/en/coding-standard.html   Cheers~  

Posted in Coding Standards, Optimization, PHP, Training | Tagged , , , , | 3 Comments

PHP Coding Standards (5) – Errors and Exceptions

1. The Zend Framework codebase must be E_STRICT compliant. Zend Framework code should not emit PHP warning (E_WARNING, E_USER_WARNING), notice (E_NOTICE, E_USER_NOTICE), or strict (E_STRICT) messages when error_reporting is set to E_ALL | E_STRICT .   That is to say, there are no errors in code writing. Only logic fault will shut down the application. […]

Posted in Coding Standards | Tagged , | Leave a comment

PHP Coding Standards (4) – Inline Documentation

1. Docblocks start always with "/*" or "/**". The use of "#" is not allowed. The "//" is only allowed for comments within functions.   For example :         2. A docblock must contain a short description and minimum one parameter. Optionally a long description and multiple parameters can be added.   […]

Posted in Coding Standards | Tagged , | 1 Comment

PHP Coding Standards (3) – Coding Style

1. PHP code must always be delimited by the full-form, standard PHP tags. Short tags are only allowed within view scripts.   For example :          2. When a string is literal (contains no variable substitutions), the apostrophe or "single quote" must always used to demarcate the string.   For example :    […]

Posted in Coding Standards | Tagged , | Leave a comment

PHP Coding Standards (2) – Naming Conventions

1. The Zend Framework employs a class naming convention whereby the names of the classes directly map to the directories in which they are stored.   Based on PEAR Coding Standards, we can easily find the right place where the file stored from the class name.   For example : Zend_Acl_Role stands for Zend/Acl/Role.php     […]

Posted in Coding Standards | Tagged , | Leave a comment