Xdebug for PHP Profile

Windows 1. Download xdebug extension : http://www.xdebug.org/files/php_xdebug-2.1.0-5.2-vc6.dll 2. Add xdebug extension into php : E:\xampp\php\ext\php_xdebug-2.1.0-5.2-vc6.dll 3. Modify php.ini : 4. Restart apache : see phpinfo() for xdebug section 5. Download winCacheGrind and start profiling : http://sourceforge.net/projects/wincachegrind/ Linux 1. Download and Install xdebug.so 2. Modify php.ini 3. Restart nginx and php-fpm (or apache) : 4. Start [...]

Posted in PHP | Tagged , | Leave a comment

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

PHP Coding Standards (1) – File Formatting

1. For PHP files the closing tag ("?>") is to be omitted. It is not required by PHP, and omitting it prevents trailing whitespace from being accidentally injected into the output.   In fact the problem comes when you don’t use gzip or output buffering in php :    // php.ini – Turn off compress [...]

Posted in Coding Standards | Tagged , | Leave a comment

PHP Coding Standards – Preview

Zend had provided the guidelines for developers and teams working on or with Zend Framework.   Details posted on : http://framework.zend.com/wiki/display/ZFDEV/Zend+Framework+Contributor+Guide.   Within the guidelines we can see 2 subjects for coding standards :   No.4 PHP Coding Standard (draft) – It’s the basic php coding standards for developers.   No.10 ZF Coding Standards (RC) [...]

Posted in Coding Standards | Tagged , | Leave a comment