Disable extbase reflection cache during development (TYPO3 4.6+)
Written in 2012 for TYPO3 4.x and Extbase 1.x. The APIs have changed since; the article stays online as an archive.
Hey folks,
remember the annotations in Extbase and their functions? Sure, you do. And I bet you have had this error when changing an annotation, for example the validation of a field, when you reload the page or submit some data and nothing happens. Instead some strange message occurs. Something like “child object type could not be determined” or some other crazy stuff. Most probably you encountered a very common error during development, not caused by your own fault, but by the caching machanism of Extbase.
It’s very easy. Extbase uses a nice feature, called reflection, you can read PHP comments (PHP docs) with. Exactly, these annotation you make in your source code. And for sure this process takes quite a lot of cpu power, so the developers of Extbase implemented a cache for all these annotations for not doing the reflection every time. And it’s great in production environments, but if you are developing your domain models it’s just annoying because you have to delete the cache every time.
So here’s how you can disable the caching for Extbase.
<?php
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_reflection']['backend'] = 't3lib_cache_backend_NullBackend';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_object']['backend'] = 't3lib_cache_backend_NullBackend';
But be sure you are using TYPO3 4.6, means using the caching framework with the Extbase caching tables as follows:
cf_extbase_object
cf_extbase_object_tags
cf_extbase_reflection
cf_extbase_reflection_tags
Alright.
Hope that helps you saving time and pain during your coding fun.