Bug #21143
closedAdd some constants
0%
Description
There's lots of chr(10), chr(9) as well as magic numbers like 3600 and 86400 strewn all over the code. Let's define some constants for this which
1. make the code a lot more readable
2. make the code a tiny bit shorter
3. will improve performance a tiny little bit because it removed 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
The patch is mostly 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).
(issue imported from #M12066)
Files
Updated by Georg Ringer about 15 years ago
great idea - looking forward to patch in core list
Updated by Oliver Klee about 15 years ago
Actually, the patch is already pending in the core list and just waiting for a +1 by a core dev. :-)
Updated by Oliver Klee over 14 years ago
I've moved the constants now from a separate file to t3lib_div. config_default wouldn't have worked because index_ts.php and init.php include the files in this order:
0. timetracker (only index_ts)
1. t3lib_div
2. t3lib_extgmg
3. then config_default