Repository: pimcore/pimcore (language: php)

Issue:
Do not care about Symfony environments
### Improvement description

Currently there are multiple locations where Pimcore is dealing with Symfony environments directly, e.g.: 
```
\Pimcore\Tool::getCachedSymfonyEnvironments()
```

This is sometimes also used by bundles, e.g. here: 
https://github.com/pimcore/portal-engine/blob/3.x/src/Service/PortalConfig/FrontendBuildService.php#L207

In general Pimcore shouldn't care about environments and so we need to check how we can get rid of those code pieces. 
Either by providing better UI feedback and/or documentation. 
Do not care about Symfony environments
### Improvement description

Currently there are multiple locations where Pimcore is dealing with Symfony environments directly, e.g.: 
```
\Pimcore\Tool::getCachedSymfonyEnvironments()
```

This is sometimes also used by bundles, e.g. here: 
https://github.com/pimcore/portal-engine/blob/3.x/src/Service/PortalConfig/FrontendBuildService.php#L207

In general Pimcore shouldn't care about environments and so we need to check how we can get rid of those code pieces. 
Either by providing better UI feedback and/or documentation. 


Discussion / hints:
@brusch In the core, this is only used to provide options to clear cache for specific environments (based on which env folders are available in the cache dir).
![image](https://github.com/pimcore/pimcore/assets/5137917/759a6c4a-0a8c-4892-8b3e-3ab9eb0f8232)

Should we get rid of these options in Admin UI and always clear current environment cache?
I never cleared the cache for the not used environment, so I don't really see a point of having the option to do that.
@dvesh3 I'd remove the entire `Cache` menu from the UI. 
There are already commands for clearing the Symfony and the Pimcore data cache, that's the way how it should be used. 
For clearing temporary files, I'd create a section in our docs, how to clear them using system tools (`rm -r` on traditional filesystems or other tools for object storages like S3, ...)   and also explain the possible impacts when doing so (high load on server because of regenerating thumbnails, ...) 
@brusch Sometimes it is necessary to clear the Pimcore Data Cache due to inconsistencies in the data-model between deployments or just having some odd behaviour. we have to do that quite often honestly (more often than I want it to)
Even if running `./console pimcore:cache:clear` after deployment? 🤔 It's actually doing the same. 
@brusch we don't wanna clear the cache each time we have a deployment, we sometimes do 10-20 deployments a day, and clearing the cache each time has a negative effect on runtime performance. 
@brusch I think removing the options with minor release is not a good idea. I guess we just need to trigger the deprecation, if someone is using these options from the UI and also mark them deprecated in API. Also, need to consider user permissions `clear_cache`, `clear_fullpage_cache` & `clear_temp_files` for removal afterwards.
Agree, but maybe we should create a follow-up ticket for v12 then 😊 
Thanks! 
@brusch In the core, this is only used to provide options to clear cache for specific environments (based on which env folders are available in the cache dir).
![image](https://github.com/pimcore/pimcore/assets/5137917/759a6c4a-0a8c-4892-8b3e-3ab9eb0f8232)

Should we get rid of these options in Admin UI and always clear current environment cache?
I never cleared the cache for the not used environment, so I don't really see a point of having the option to do that.
@dvesh3 I'd remove the entire `Cache` menu from the UI. 
There are already commands for clearing the Symfony and the Pimcore data cache, that's the way how it should be used. 
For clearing temporary files, I'd create a section in our docs, how to clear them using system tools (`rm -r` on traditional filesystems or other tools for object storages like S3, ...)   and also explain the possible impacts when doing so (high load on server because of regenerating thumbnails, ...) 
@brusch Sometimes it is necessary to clear the Pimcore Data Cache due to inconsistencies in the data-model between deployments or just having some odd behaviour. we have to do that quite often honestly (more often than I want it to)
Even if running `./console pimcore:cache:clear` after deployment? 🤔 It's actually doing the same. 
@brusch we don't wanna clear the cache each time we have a deployment, we sometimes do 10-20 deployments a day, and clearing the cache each time has a negative effect on runtime performance. 
@brusch I think removing the options with minor release is not a good idea. I guess we just need to trigger the deprecation, if someone is using these options from the UI and also mark them deprecated in API. Also, need to consider user permissions `clear_cache`, `clear_fullpage_cache` & `clear_temp_files` for removal afterwards.
Agree, but maybe we should create a follow-up ticket for v12 then 😊 
Thanks! 

Fix patch:
diff --git a/doc/22_Administration_of_Pimcore/02_Cleanup_Data_Storage.md b/doc/22_Administration_of_Pimcore/02_Cleanup_Data_Storage.md
index b88dc2efdcb..df7d3db9b28 100644
--- a/doc/22_Administration_of_Pimcore/02_Cleanup_Data_Storage.md
+++ b/doc/22_Administration_of_Pimcore/02_Cleanup_Data_Storage.md
@@ -54,7 +54,17 @@ Used for uploads, imports, exports, page, previews, ...
 **Public temporary directory**: `public/var/tmp/`  
 Used for image/video/document thumbnails used in the web-application. 
   
- 
+### Clearing Temporary Files
+```php
+// clear public files
+Tool\Storage::get('thumbnail')->deleteDirectory('/');
+Db::get()->executeQuery('TRUNCATE TABLE assets_image_thumbnail_cache');
+
+Tool\Storage::get('asset_cache')->deleteDirectory('/');
+
+// clear system files
+recursiveDelete(PIMCORE_SYSTEM_TEMP_DIRECTORY, false);
+```
 All temporary files can be deleted at any time.   
 **WARNING: Deleting all files in `public/var/tmp/` can have a huge impact on performance until all needed thumbnails are generated again.**
 
@@ -74,3 +84,15 @@ rm -r var/recyclebin
 
 **WARNING: The recycle bin is an administrative tool that displays any user's deleted elements. 
 Due to the nature and complexity of the elements deletion and restoration process, this tool should be reserved for administrator and advanced users**
+
+## Output Cache
+When enabled, the full page cache stores the whole frontend request response including the headers from a request and stores it into the cache. 
+
+The output cache can be cleared with the following snippet:
+```php
+// remove "output" out of the ignored tags, if a cache lifetime is specified
+Cache::removeIgnoredTagOnClear('output');
+
+// empty document cache
+Cache::clearTags(['output', 'output_lifetime']);
+```
diff --git a/lib/Tool.php b/lib/Tool.php
index e93eb14b85b..40887f0b975 100644
--- a/lib/Tool.php
+++ b/lib/Tool.php
@@ -549,6 +549,8 @@ private static function classInterfaceExists(string $class, string $type): bool
      * @internal
      *
      * @return string[]
+     *
+     * @deprecated. Removed in Pimcore 12
      */
     public static function getCachedSymfonyEnvironments(): array
     {


Test patch: