Project

General

Profile

Actions

Task #88202

closed

Move typo3temp path to Environment Class

Added by Willi Wehmeier almost 5 years ago. Updated about 4 years ago.

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

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Sprint Focus:

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.

Actions #1

Updated by Willi Wehmeier almost 5 years ago

  • Description updated (diff)
Actions #2

Updated by Benni Mack almost 5 years ago

  • Status changed from New to Needs Feedback

good idea. you're probably talking about typo3temp/assets/, right?

Actions #3

Updated by Willi Wehmeier almost 5 years ago

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 :)

Actions #4

Updated by Benni Mack about 4 years ago

  • 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

Actions

Also available in: Atom PDF