[TYPO3-core] RFC #12066: Code cleanup: Add some constants
Oliver Klee
typo3-german-02 at oliverklee.de
Fri Sep 25 21:34:14 CEST 2009
This is an SVN patch request.
Type: Code cleanup, mostly a nobrainer
Bugtracker references:
http://bugs.typo3.org/view.php?id=12066
Branches:
trunk
Problem:
There's lots of chr(10), chr(9) etc. as well as magic numbers like 3600
or 86400 strewn all over the code.
Solution:
Let's define some constants for commonly used thing which
1. makes the code a lot more readable
2. makes the code a tiny bit shorter
3. will improve performance a tiny little bit because it removes the PHP
function calls to chr()
These are the constants which this patch adds and includes them in
init.php and index_ts.php:
CR
LF
TAB
CRLF
ONE_HOUR
ONE_DAY
ONE_WEEK
Notes:
The patch is mostly automatic search'n'replace with the manual
corrections and improvements (e.g. 24*ONE_HOUR has been changed to
ONE_DAY, and 7*ONE_DAY has been changed to ONE_WEEK). So I haven't added
any missing CGL spaces.
The name of the new file has no "class." at the beginning because the
file is no class.
Oliver
More information about the TYPO3-team-core
mailing list