This function is going to be used only for cache warm-up (to load files into cache without execution). I don't think it may be useful in application code. It 's not a big problem having warning and hiding it with @ if necessary.
Thanks. Dmitry. On Wed, Sep 25, 2013 at 8:06 PM, Adam Harvey <ahar...@php.net> wrote: > On 25 September 2013 01:14, Dmitry Stogov <dmi...@php.net> wrote: > > + zend_try { > > + op_array = persistent_compile_file(&handle, ZEND_INCLUDE > TSRMLS_CC); > > + } zend_catch { > > + EG(current_execute_data) = orig_execute_data; > > + zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME " could > not compile file %s" TSRMLS_CC, handle.filename); > > + } zend_end_try(); > > I'm writing the documentation for this, and I'm wondering: does the > warning serve any purpose here? Is there an intended situation where > opcache_compile_file() would return false and wouldn't generate a > warning? (I can see some code paths in persistent_compile_file() that > probably result in that, but I don't know how intentional that is.) > > If there isn't, I'm thinking it would be better to just return false > without the warning — users who are doing error handling and have > error reporting on don't need to use @ in that case. I know that's a > constant irritant for me when I'm writing code that uses fopen(), for > instance. :) > > Adam >