Project

General

Profile

Actions

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.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2010-08-18
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.3
Tags:
Complexity:
medium
Sprint Focus:

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

t3lib_div.patch (781 Bytes) t3lib_div.patch Administrator Admin, 2010-08-18 10:35
15486.patch (1.42 KB) 15486.patch Administrator Admin, 2010-12-10 14:40

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #24210: PHP notices from XCLASS inclusionsClosedSusanne Moog2010-11-26

Actions
Actions #1

Updated by Popy no-lastname-given over 13 years ago

Resolved ??

Actions #2

Updated by Chris topher over 13 years ago

Oh, I see, it's not resolved. Sorry. I thought you wanted to fix the ugliness of PHP notices. My fault.

Actions #3

Updated by Popy no-lastname-given over 13 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

Actions #4

Updated by Chris topher over 13 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.

Actions #5

Updated by Popy no-lastname-given over 13 years ago

I love the idea. I try something immediatly

Actions #6

Updated by Franz Holzinger over 13 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);

Actions #7

Updated by Popy no-lastname-given over 13 years ago

here it is :) @see 15486.patch

Actions #8

Updated by Xavier Perseguers over 12 years ago

  • Status changed from Needs Feedback to Accepted
  • Target version changed from 0 to 4.7.0
  • Complexity set to medium
Actions #9

Updated by Steffen Ritter about 12 years ago

  • Target version deleted (4.7.0)
Actions #10

Updated by Popy no-lastname-given about 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 ?

Actions #11

Updated by Tolleiv Nietsch about 12 years ago

  • Status changed from Accepted to Closed

#31893 makes this one obsolete

Actions

Also available in: Atom PDF