Project

General

Profile

Actions

Bug #21143

closed

Add some constants

Added by Oliver Klee over 14 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2009-09-25
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
4.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

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
Actions #1

Updated by Georg Ringer over 14 years ago

great idea - looking forward to patch in core list

Actions #2

Updated by Oliver Klee over 14 years ago

Actually, the patch is already pending in the core list and just waiting for a +1 by a core dev. :-)

Actions #3

Updated by Oliver Klee about 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

Actions #4

Updated by Benni Mack about 14 years ago

committed to trunk (rev #18071).

Actions #5

Updated by Susanne Moog about 13 years ago

  • Target version deleted (4.4.0)
Actions

Also available in: Atom PDF