idea-php-typo3-plugin icon indicating copy to clipboard operation
idea-php-typo3-plugin copied to clipboard

CacheManager->getCache type helper aware of TYPO3_CONF_VARS

Open NamelessCoder opened this issue 7 years ago • 5 comments

It would be pretty great if there was a way to read the relevant cache configuration based on the cache ID passed to getCache to use the frontend class defined in global TYPO3 configuration, so it understands the difference between VariableFrontend and StringFrontend and others automatically.

Note, this probably would need to parse ext_localconf.php files and global configuration as described in https://github.com/cedricziel/idea-php-typo3-plugin/issues/29, but it would be a powerful little helper when dealing when cache API.

NamelessCoder avatar Mar 04 '17 23:03 NamelessCoder

Yeah - I think it requires multi-level parsing. Once on the extension local config and second on the cached version of ext_localconf. The latter is, by nature, only available in already-compiled projects.

Secondly, the cache responsible for cache_core doesn't seem to evict old entries, which is a PITA.

cedricziel avatar Mar 06 '17 11:03 cedricziel

Let it be said: I think the existing insight for GeneralUtility::makeInstance already makes the usual cache getting aware that FrontendInterface is returned - which is 95% of what you actually need to know about the cache. The global configuration parsing I think is much, much more important.

Feel free to close this one with an "already covered via makeInstance to be aware of FrontendInterface", I'd be as happy with that :)

NamelessCoder avatar Mar 06 '17 18:03 NamelessCoder

Hmm, yes. Knowing the return type of the service locator is one half of the rent, as we say in germany, but more introspection is always better :)

Sorry if the comment earlier seemed a bit grumpy. - I think we need to parse the core caches anyways to get deeper knowledge of the available configuration. - More knowledge about the cache configurations will be kind of available, once we start parsing the configuration.

Do you think it's acceptable to have certain insights only available if the configuration was compiled at least once?

cedricziel avatar Mar 06 '17 21:03 cedricziel

Do you think it's acceptable to have certain insights only available if the configuration was compiled at least once?

It's reasonable and works for most of my own use cases, but I'm guessing the average user would prefer if configuration was also consistently read without having executed TYPO3 from the project folder.

NamelessCoder avatar Mar 08 '17 11:03 NamelessCoder

Exactly my thoughts. Thank you.

cedricziel avatar Mar 08 '17 12:03 cedricziel