DarkGhostHunter/Preloader

Using `exclude()` isn't sufficient

oojacoboo opened this issue · 1 comments

Using exclude() the way it's currently designed isn't sufficient to prevent issues. Currently I have a preload file that causes PHP to crash due to an Exception being thrown. I've tried catching these Exceptions, but it's still terminating PHP.

It would be far better if the exclude logic was used as a blacklist for the array of files and when iterating over the array, it checked to see if the file in question is on the blacklist. The reason for this is that you may exclude a file explicitly, but another file might attempt to require it. So then you have to exclude that file and so on. This results in having to exclude more files than necessary, which you may just want to exclude a single file.

Seems like an edge case.

Currently exclude works over the Opcache file list, so if you exclude a file that is required by another, then you should exclude that file too. There is no workaround, it's the nature of PHP unless there is an advantage of preloading that file alone withouts it's links.