Re: com php-src: Added function opcache_compile_file() to load PHP scripts into cache without execution.: NEWS ext/opcache/ZendAccelerator.c
ext/opcache/ZendAccelerator.h ext/opcache/zend_accelerator_module.c
| From: | Adam Harvey | Date: | Wed, 25 Sep 2013 16:06:48 +0000 |
| Subject: | Re: com php-src: Added function opcache_compile_file() to load PHP scripts into cache without execution.: NEWS ext/opcache/ZendAccelerator.c ext/opcache/ZendAccelerator.h ext/opcache/zend_accelerator_module.c |
||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-73283@lists.php.net to get a copy of this message | ||
On 25 September 2013 01:14, Dmitry Stogov <dmitry@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