Project

General

Profile

Actions

Feature #31893

closed

Allow XCLASSes to be defined via ext_autoload.php

Added by Benni Mack over 12 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2012-04-16
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
PHP Version:
5.3
Tags:
Complexity:
Sprint Focus:

Description

For XCLASSes to work currently, one needs to

a) set the according XCLASS statement in every PHP file that can/should be subclassed
b) use this XCLASS statement in an extensions' ext_localconf.php to include the subclass statement

This process is somehow unflexible, produces code, and as it is somehow incomplete for some classes, a hassle to maintain.

The attached change does the following:
1) It makes use of the autoloader to search for classes of the XCLASS prefix "ux_*" as well.
2) It provides a way to also include the XCLASS paths via the "old way", but sends a deprecation warning for that.

There is one drawback however right now: There is no how an admin can see which XCLASSes are currently in use with "the new way" as the admin cannot browse the ext_autoload.php files of all extensions through the backend in a nice way.

Also: Beware that you might need to clear your autoload cache when trying out this feature, which you can do with a simple "rm -rf Cache/Code/cache_phpcode/*"

There is a small extension that I've built that you can use to try out. This extension should work without the patch on a plain introduction package as it just includes the XCLASS statement in ext_localconf.php. The extension XCLASSes tslib_fe and replaces the title "Introduction Package" before outputting the content. Now, you should remove the XCLASS statement in typo3/sysext/cms/tslib/class.tslib_fe.php at the very last lines. Now, the XCLASS (of course) does not work anymore. However, the extension itself has a ext_autoload.php, so after applying the patchset the XCLASS will work again, as the autoloader loads the XCLASS now. Maybe you need to clear your autoloader-cache for that though (see above).

Everything works as before now, even the limitation that only one XCLASS can be used of course still applies. The XCLASS to use is of course the one of the last extension installed, same principle as before, just not in the ext_localconf.php anymore, but in ext_autoload.php.

The advantages of "the new XCLASS way":

  • "faster?" - Less initialization in ext_localconf.php, only when it is needed
  • "more flexible" - XCLASS every class in use now
  • "more transparent" - no XCLASS statement on the bottom of each core class anymore

I'm also interested how this affects the overall performance.

Further jobs once this is included in the TYPO3 Core:

- Update documentation properly, add it to the release notes of TYPO3 4.7
- Remove XCLASS statements from all core files
- Create a Status Report about it that an installation still uses wrong XCLASS syntax
- Talk about it, Blog about it

Files


Subtasks 6 (0 open6 closed)

Bug #36184: Remove XCLASS blocks from t3libClosedTolleiv Nietsch2012-04-16

Actions
Bug #36183: Make dbal compatible with the new XCLASS schema.ClosedTolleiv Nietsch2012-04-16

Actions
Bug #36821: Remove XCLASS definitions from typo3/Closed2012-05-03

Actions
Task #36825: Remove XCLASS definitionsClosed2012-05-03

Actions
Feature #38123: Add check to Reports module for usage of old XCLASS methodClosedJigal van Hemert2012-06-16

Actions
Feature #38129: Provide overview for admins of new XCLASS usageClosed2012-06-17

Actions

Related issues 6 (0 open6 closed)

Related to TYPO3 Core - Bug #36690: Add unit tests to new autoloader XCLASS handlingClosed2012-04-28

Actions
Related to TYPO3 Core - Bug #36698: Clean up XCLASS handling and commentsClosed2012-04-29

Actions
Related to TYPO3 Core - Bug #36826: Remove XCLASS definitions in ext:versionClosed2012-05-03

Actions
Related to TYPO3 Core - Bug #38271: Remove XCLASS definitions in ext:workspaceClosed2012-06-21

Actions
Related to TYPO3 Core - Bug #38273: Remove last XCLASS statementsClosed2012-06-21

Actions
Related to TYPO3 Core - Bug #36703: Fix old XCLASS deprecation logClosed2012-04-29

Actions
Actions #1

Updated by Mr. Hudson over 12 years ago

Patch set 1 of change I4af4116108fecd9df0874c3e07e10b86f74d556e has been pushed to the review server.
It is available at http://review.typo3.org/6717

Actions #2

Updated by Steffen Ritter over 12 years ago

  • Target version set to 4.7.0-alpha2
Actions #3

Updated by Gerrit Code Review over 12 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/6717

Actions #4

Updated by Oliver Hader over 12 years ago

  • Target version changed from 4.7.0-alpha2 to 4.7.0-alpha3
Actions #5

Updated by Steffen Ritter about 12 years ago

  • Target version changed from 4.7.0-alpha3 to 4.7.0-beta1
Actions #6

Updated by Steffen Ritter about 12 years ago

  • Target version deleted (4.7.0-beta1)
Actions #7

Updated by Gerrit Code Review about 12 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/6717

Actions #8

Updated by Gerrit Code Review about 12 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/6717

Actions #9

Updated by Gerrit Code Review about 12 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/6717

Actions #10

Updated by Michael Stucki about 12 years ago

Regarding backwards compatibility:

Let's add an update wizard to scan all ext_localconf.php files in loaded extensions.
Additionally, extdeveval might be used to convert these inclusions automatically.

Actions #11

Updated by Gerrit Code Review about 12 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/6717

Actions #12

Updated by Gerrit Code Review about 12 years ago

Patch set 7 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/6717

Actions #13

Updated by Benni Mack about 12 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #14

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF