Task #88202
closed
Move typo3temp path to Environment Class
Added by Willi Wehmeier over 5 years ago.
Updated over 4 years ago.
Description
Like other paths which can already be accessed by the Environment class, the typo3temp path itself should be accessible in the same way.
Currently the path to the typo3temp folder is hardcoded in several places.
Use cases:
We have an edge case where we need to run 2 different TYPO3 instances on the same domain to realise a step-by-step relaunch of a big website based on url paths, to migrate single areas of the website from one system to another. To achieve this, we have to avoid overlapping resource urls. For the user_upload stuff this in not a big deal, we are using a different storage then the default "fileadmin", but we have to tell the core to move the typo3temp folder to another path.
With this patch we will just have to change the parameter in one place; when the Environment class initialize function is getting called.
- Description updated (diff)
- Status changed from New to Needs Feedback
good idea. you're probably talking about typo3temp/assets/, right?
Benni Mack wrote:
good idea. you're probably talking about typo3temp/assets/, right?
Yep, the assets folder with the processed files is the main reason for the demand.
But I'm not sure if adding an $assetPath property to the Environment class would bring along too many changes to the whole core.
I was thinking about adding a $tempFolder property to the Environment class to solve existing code lines like this one without changing too much logic:
return 'typo3temp/' . $pre . $filePrefix . '_' . GeneralUtility::shortMD5(serialize($this->setup)) . '.' . $this->extension();
(typo3/sysext/frontend/Classes/Imaging/GifBuilder.php Line 721)
But if you've got better ideas, I'd love to hear them. I'd also implement the changes and submit a patch :)
- Status changed from Needs Feedback to Closed
We would need to touch a lot of places for using this API in all places (thus, it would be breaking I guess). I would rather actually go and change that manually in your code (patch core) - assets is not configurable either. In the future, I would consider using something like the PHP library flysystem to deal with all paths completely, instead of expanding Environment API further.
I will close this for now, as the "make paths configurable" is already in research phase, hope this will satisfy your needs - although it looks like you would need it for v9/v10 already... If you feel otherwise, let me know, and I will reopen the issue for further discussion
Also available in: Atom
PDF