Project

General

Profile

Actions

Story #78461

closed

VERY generically named constants in SystemEnvironmentBuilder should be removed or renamed

Added by Claus Due about 8 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Code Cleanup
Target version:
-
Start date:
2016-10-27
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Sprint Focus:

Description

In SystemEnvironmentBuilder which is used by Bootstrap to process requests, we are currently defining a set of super-generic named constants which would be obvious candidates to cause a collision.

The constants are:

// A tabulator, a linefeed, a carriage return, a CR-LF combination
define('TAB', chr(9));
define('LF', chr(10));
define('CR', chr(13));
define('CRLF', CR . LF);

While it perhaps makes sense to define these (I don't necessarily agree it does; PHP_EOL exists for 95% of the use cases and authors can reasonably be expected to manually accommodate the last 5%) they certainly at the very least should be prefixed with a TYPO3-unique prefix.

The same goes for any other constants we may be defining that I've missed here. The main goal should be to get completely rid of these; keeping our constants to an absolute minimum and whenever possible, wrapping them in a class to prevent any possibility of tainting the global state.

This would be a breaking change but one we should do before the next LTS version - or we will have to live with them for a long, long time.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Story #68113: Base data package for installation of TYPO3 (database, possibly introduction package...)Closed2015-07-14

Actions
Actions

Also available in: Atom PDF