Bug #67996

Provide reasonable way to clear autoloader caches

Added by Joschi Kuphal over 6 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2015-07-09
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

As a follow up to #67972, I'd vote for providing a reasonable way of flushing (or temporarily disabling) the autoloader cache other than manually clearing `typo3temp/autoload`. Just stating "it doesn't work anymore" seems as much of an option as "changing the extension list" after each creation of a new class during extension development. Including the autoloader cache into "clear system caches" (for example) would surely save quite some hours of helpless frustration.


Related issues

Related to TYPO3 Core - Bug #67972: New custom viewhelpers only work after manually clearing typo3temp/ directoryClosed2015-07-08

Actions
Related to TYPO3 Core - Bug #68589: Add CLI command to dump class loading informationClosedHelmut Hummel2015-07-28

Actions
Has duplicate TYPO3 Core - Bug #68387: New Classes were not found while developingRejected2015-07-20

Actions
#1

Updated by Markus Klein over 6 years ago

  • Assignee set to Helmut Hummel
#2

Updated by Helmut Hummel over 6 years ago

  • Status changed from New to Needs Feedback

Joschi Kuphal wrote:

As a follow up to #67972, I'd vote for providing a reasonable way of flushing (or temporarily disabling) the autoloader cache other than manually clearing `typo3temp/autoload`. Just stating "it doesn't work anymore" seems as much of an option as "changing the extension list" after each creation of a new class during extension development. Including the autoloader cache into "clear system caches" (for example) would surely save quite some hours of helpless frustration.

Thank you for your report and suggestion.

The class loading information written to typo3temp/autoload however is no cache and thus should not be flushed with system caches.

To avoid frustration, you should add a composer.json to the extension you are developing and add a autoload/psr-4 section to it.
By doing so (and (re-)activating your extension in the extension manager, you can add as many psr-4 compliant classes as you like during development without the need to flush any class loading information at all.

Would you be fine if I'd close this ticket, once I added documentation for this fact in a prominent place?

What would be doable however, is a CLI command, which re-builds the autoload information (not flushing it).

If you think these steps are not enough, please explain the cases where you need more than that.

#3

Updated by Joschi Kuphal about 6 years ago

Hi Helmut,

thanks for your feedback. Yes, personally I'd be fine with both your suggestions (composer.json + builtin CLI command) as long as they are well documented somewhere. I must however say that this isn't really what I consider comfortable. At least half of my developers aren't exactly CLI-savvy, and in a certain way I think the tools we use should serve us instead of the other way round ... just my 2 cents. ;)

Thanks for working on in.

Cheers.

#4

Updated by Wouter Wolters almost 6 years ago

Meanwhile the CLI command is added to rebuild the autoload files.
Is this enough for you?

#5

Updated by Joschi Kuphal almost 6 years ago

Sorry for the late reply. Yes, sounds good. Do you have a link to some kind of documentation for this?

#6

Updated by Alexander Opitz over 5 years ago

I think the command "./cli_dispatch.phpsh extbase extension:dumpclassloadinginformation" is the one in question here.

https://docs.typo3.org/typo3cms/extensions/core/Changelog/7.4/Feature-68589-AddCLICommandToDumpClassLoadingInformation.html

#7

Updated by Alexander Opitz over 5 years ago

Can we close this issue?

#8

Updated by Joschi Kuphal over 5 years ago

Sounds good, yes. Issue can be closed.

#9

Updated by Riccardo De Contardi over 5 years ago

  • Status changed from Needs Feedback to Closed
  • Assignee deleted (Helmut Hummel)

Closed; thank you for your feedback!

#10

Updated by Alexander Dick about 5 years ago

In my opinion, the typo3temp/autoload/ directory should at least be cleared if you "clear all cache" in the install tool.

Also available in: Atom PDF