Feature #23394
closedXCLASS Code looks ugly and could get a facelift
0%
Description
Since years we have the same (ugly) XCLASS statement at the end of every php class file, and we still have the same "global scope bug" if file is not included with t3lib_div::requireFile
So, the idea is to replace :
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_extfilefunc.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_extfilefunc.php']);
}
by :
t3lib_div::XCLASS;
(issue imported from #M15486)
Files
Updated by Chris topher almost 14 years ago
Oh, I see, it's not resolved. Sorry. I thought you wanted to fix the ugliness of PHP notices. My fault.
Updated by Popy no-lastname-given almost 14 years ago
It was only a part of the idea, And it fix the "global scope bug" for files not included by t3lib_div::require_once
Updated by Chris topher almost 14 years ago
Ok. The next logical step would be to implement a logic, which calculates the path inside of t3lib_div::XCLASS automatically.
That way we would never have wrong xclasses again, if files were moved (e.g. during development). In those cases adapting the xclass often is forgotten. If the code was always exactly the same, adding an xclass would become a shoot and forget issue: Copy the always same oneliner in place and you are done.
Updated by Popy no-lastname-given almost 14 years ago
I love the idea. I try something immediatly
Updated by Franz Holzinger almost 14 years ago
There is already a constant which gets replaced by the filename:
FILE
It should be possible to use this on the call.
t3lib_div::XCLASS(FILE);
Updated by Popy no-lastname-given almost 14 years ago
here it is :) @see 15486.patch
Updated by Xavier Perseguers about 13 years ago
- Status changed from Needs Feedback to Accepted
- Target version changed from 0 to 4.7.0
- Complexity set to medium
Updated by Popy no-lastname-given over 12 years ago
Is it possible to add this feature in 4.7 branch without replacing each XCLASS statement in core files, in order people would be able to use it in extensions ASAP ?
What can be done to keep this feature in 4.7 ?
Updated by Tolleiv Nietsch over 12 years ago
- Status changed from Accepted to Closed
#31893 makes this one obsolete