Feature #23394
closed
XCLASS Code looks ugly and could get a facelift
Added by Popy no-lastname-given over 13 years ago.
Updated about 12 years ago.
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
Oh, I see, it's not resolved. Sorry. I thought you wanted to fix the ugliness of PHP notices. My fault.
It was only a part of the idea, And it fix the "global scope bug" for files not included by t3lib_div::require_once
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.
I love the idea. I try something immediatly
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);
here it is :) @see 15486.patch
- Status changed from Needs Feedback to Accepted
- Target version changed from 0 to 4.7.0
- Complexity set to medium
- Target version deleted (
4.7.0)
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 ?
- Status changed from Accepted to Closed
#31893 makes this one obsolete
Also available in: Atom
PDF