Should I stick with Sun's Java code conventions for PHP code?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
You have a number of options:
Zend: http://framework.zend.com/manual/en/coding-standard.html
Pear: http://pear.php.net/manual/en/standards.php
Wordpress: http://codex.wordpress.org/WordPress_Coding_Standards
But like prakash suggests, Zend is a good choice.
You should be following one of the PSR standards for PHP approved by the Framework Interop Group
LoggerInterface
exposes eight methods to write logs to the eight RFC 5424 levels.As Gordon says, the Zend and PEAR standards are the effective industry standard.
However, the company's code quite possibly pre-dates these so depending on the size of the code base there may be little value in investing the time to make the move to one of these. (That said, if they ever want to use static code analysis tools you could possibly use this as an impetus to seriously consider moving to Zend, etc.)
However, being realistic, as long as they have a sensible standard that they stick to there's no real issue here - you'll find yourself adjusting how you "see" the code accordingly.