Feature: #84545 - Allow temporary files to be stored outside the document root¶
See forge#84545
Description¶
The environment variable called TYPO3_
, which was previously introduced with the Environment API, is now used
to allow to store data outside of the document root.
All regular composer-based installations now benefit from this functionality directly, as data which was previously
stored and hard-coded within typo3temp/
is now stored within the project root folder var/
.
For non-composer installations, it is possible to set the environment variable to a folder usually one level upwards than the regular web root. This increases security for any TYPO3 installation as files are not publicly accessible (for example via web browser) anymore.
A typical example:
TYPO3_
is set toPATH_ APP /var/
.www/ my- project - The web folder is then set to
TYPO3_
PATH_ ROOT /var/
.www/ my- project/ public
Non-public files are then put to
/var/
(like Maintenance Tool Session files)www/ my- project/ var/ session /var/
(Caching Framework data)www/ my- project/ var/ cache /var/
(Files related to locking)www/ my- project/ var/ lock /var/
(Files related to logging)www/ my- project/ var/ log /var/
(Files related to extension manager data)www/ my- project/ var/ extensionmanager /var/
(Files related to import/export, core updater, FAL)www/ my- project/ var/ transient
If the option is not set, the typo3temp/
folder is still used, but with some minor differences
regarding the naming scheme of the folders.
Impact¶
For installations having the environment variable set, the folder is now not within typo3temp/
anymore
but outside of the document root in a folder called var/
.
For installations without this setting in use, there are minor differences in the folder structure:
typo3temp/
is now used instead ofvar/ cache typo3temp/
var/ Cache typo3temp/
is now used instead ofvar/ log typo3temp/
var/ logs typo3temp/
is now used instead ofvar/ lock typo3temp/
var/ locks typo3temp/
is now used instead ofvar/ session typo3temp/
var/ Install Tool Sessions typo3temp/
is now used instead ofvar/ extensionmanager typo3temp/
var/ Extension Manager
Although it is a most common understanding in the TYPO3 world that typo3temp/
can be removed at any time,
it is considered bad practice to remove the whole folder. Only folders relevant for the current development
changes should selectively be removed.