-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Hi, I enabled PHP class preloading for my Symfony based app. But when it comes to creating files with TBS/OpenTBS, I get an error "Undefined constant 'TBS_INSTALL'". After digging in, I realized that preloading and global constants defined at runtime with define() won't work together: they are simply not defined when their class is preloaded.
Can anyone confirm that? Any ideas to solve that (besides refactoring the constants-system of TBS/OpenTBS creating a BC break)?
I tried to exclude the (service) class using the TBS_INSTALL constant from preloading, but that doesn't solve the problem (as it and the TBS classes are still preloaded as a dependency).
How to reproduce
Just try to use TBS/OpenTBS in an application with PHP preloading. In opcache_get_status()['preload_statistics']['classes'] you get a list of preloaded classes where clsTinyButStrong, clsTbsDataSource and clsTbsLocator are included, provoking the error.