Bug #21143
closed
Added by Oliver Klee about 15 years ago.
Updated over 13 years ago.
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
constants.diff (206 KB)
constants.diff |
|
Administrator Admin, 2009-10-16 17:17
|
|
12066_v2.diff (206 KB)
12066_v2.diff |
|
Administrator Admin, 2009-10-21 00:06
|
|
constants-20091028.diff (193 KB)
constants-20091028.diff |
|
Administrator Admin, 2009-10-28 15:15
|
|
12066-basic.diff (2.39 KB)
12066-basic.diff |
|
Administrator Admin, 2010-02-21 16:09
|
|
12066-v4.diff (2.23 KB)
12066-v4.diff |
|
Administrator Admin, 2010-03-03 15:16
|
|
12066-v5-div.diff (13.2 KB)
12066-v5-div.diff |
|
Administrator Admin, 2010-04-06 15:19
|
|
12066-v5-tests.diff (3.62 KB)
12066-v5-tests.diff |
|
Administrator Admin, 2010-04-06 15:19
|
|
12066-v5-use-in-core.diff (204 KB)
12066-v5-use-in-core.diff |
|
Administrator Admin, 2010-04-06 15:19
|
|
12066-v6-div.diff (13.9 KB)
12066-v6-div.diff |
|
Administrator Admin, 2010-04-12 13:15
|
|
12066-v6-tests.diff (3.62 KB)
12066-v6-tests.diff |
|
Administrator Admin, 2010-04-12 13:16
|
|
12066-v6-use-in-core.diff (203 KB)
12066-v6-use-in-core.diff |
|
Administrator Admin, 2010-04-12 13:16
|
|
great idea - looking forward to patch in core list
Actually, the patch is already pending in the core list and just waiting for a +1 by a core dev. :-)
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
committed to trunk (rev #18071).
- Target version deleted (
4.4.0)
Also available in: Atom
PDF