New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Track non-php files for workers restart? #376
Comments
For this use-case we have Lines 5 to 17 in 21e8a0a
We use this method for Twig's template files. |
Interesting, I guess this is something that could be added to the Symfony bootstrap class along with the twig files tracking @marcj ? |
It could probably not in a general case- we simply don't know what config files you'd like to have watched. Or should we add any type of yaml? |
Any file that lives within /config should trigger a reload, it could be yaml or xml or plain php. The bad thing is that there's no "getConfigDir" within the kernel interface, the "/config" is hardcoded in the standard Kernel.php file. Maybe an additional "track-files-dir" config option? For now the best option is to extend the Symfony bootstrap class and manually register the config files using the method marc said |
We should not implement a glob-like file watcher now. Instead, what we do with Twig is to hook into the postRequest handler and read in the twig-cache which template files it touched and register those using the method above. We should try to do the same with configuration files of any kind used by Symfony. However, I don't know if Symfony tracks them somewhere. |
Actually, we could go the route with an argument like "--watch-dir config" which can be used multiple times. Then we need to figure out how to watch for changes on any OS which probably requires users to install some php extension. Not really great for UX tbh. |
--watch-dir would be ideal, yes |
This looks interesting for Linux: https://github.com/tsufeki/react-filesystem-monitor, I've also opened a ticket for OSX (tsufeki/react-filesystem-monitor#2) |
This a follow-up question to #348
Sometimes keeping track of PHP files is not enough. For example, a yaml config change in a symfony app does not trigger a restart of the slave workers, the yaml file change will indirectly trigger a change in the compiled php DI container (it checks for its freshnes at the beginning of a normal FPM request) but PHP-PM is obviously not able to notice it because it is already running. Maybe @AntonTyutin can help here?
The text was updated successfully, but these errors were encountered: