[TYPO3-core] Stay alert on code quality!
Jigal van Hemert
jigal.van.hemert at typo3.org
Mon Apr 30 20:20:53 CEST 2012
Hi,
In new parts we introduce in the core we should check our code for
various quality related issues before pushing it. I noticed some
troublesome things in the FAL code.
- use of deprecated functions; if functions are marked as deprecated in
PHP we should not use them in new code. Example: mime_content_type()
- locale aware functions; a number of PHP functions such as
escape_shell_arg(), basename(), etc. are locale aware. We introduced the
[SYS][systemLocale] setting for this. I'll make a patch for a utility
function to temporarily switch to and back from this locale for such
functions
- hardcoded text; a few versions ago we hunted untranslated hardcoded
text. Example: in t3lib_file_Utility_FileInfo::renderFileInfo() some
English texts are introduced
- dependencies on PHP extensions; if we need to use functions which are
provided by PHP extensions those extensions must be listed in the checks
for mandatory extensions in the Install Tool and Reports. Example:
t3lib_file_Driver_LocalDriver::extractFileInformation() uses the
(deprecated) function mime_content_type() which is according to the PHP
documentation part of the Fileinfo extension.
Of course these things can be fixed "later", but the best moment is of
course when you write the code!
--
Jigal van Hemert
TYPO3 Core Team member
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the TYPO3-team-core
mailing list