Bug #67996
closedProvide reasonable way to clear autoloader caches
0%
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.
Updated by Helmut Hummel over 9 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.
Updated by Joschi Kuphal over 9 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.
Updated by Wouter Wolters about 9 years ago
Meanwhile the CLI command is added to rebuild the autoload files.
Is this enough for you?
Updated by Joschi Kuphal about 9 years ago
Sorry for the late reply. Yes, sounds good. Do you have a link to some kind of documentation for this?
Updated by Alexander Opitz over 8 years ago
I think the command "./cli_dispatch.phpsh extbase extension:dumpclassloadinginformation" is the one in question here.
Updated by Joschi Kuphal over 8 years ago
Sounds good, yes. Issue can be closed.
Updated by Riccardo De Contardi over 8 years ago
- Status changed from Needs Feedback to Closed
- Assignee deleted (
Helmut Hummel)
Closed; thank you for your feedback!
Updated by Alexander Dick over 8 years ago
In my opinion, the typo3temp/autoload/ directory should at least be cleared if you "clear all cache" in the install tool.