Adding to the pile of "it's an edge case", since the preload scripts will
be procedural, wouldn't it be sufficient to call
`opcache_invalidate(__FILE__)` at the end of them?


On Sat, 24 Nov 2018, 20:57 Stanislav Malyshev <smalys...@gmail.com wrote:

> Hi!
>
> >> I'm not sure if you're missing anything fundamental - it's just that
> >> the preload.php file Dmitry's referring to (the one that's responsible
> >> to loading all the other files) - is one file that's pretty much by
> >> definition, will be of no use at any later point in the lifetime of
> >> the server.  It preloads other files (which of course, should very
> >> much persist in the opcache memory) - but once it's done, it's done.
> >> That's why it kind of makes sense not to cache it.
>
> Ah, ok, this makes sense. Though usually such file would be rather small
> and adding whole new directive just for it may not be that necessary, I
> think.
>
> > Thinking about it, I'm not clear exactly what a "do not cache" directive
> > would mean in a preloaded file, since preloading is more than just
> > caching. For instance, if "class A" is declared in a preloaded file with
> > declare(cache=0), then "class B extends A" is declared in a preloaded
> > file with caching enabled, how will class B be treated? Will the file
>
> Yes, that's what I am wondering too - how things defined directly in
> preload file then will be treated? While file itself is not useful later
> in server's lifetime, the things defined in it - like classes or
> functions - can be?
> --
> Stas Malyshev
> smalys...@gmail.com
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Reply via email to