@@ -1865,12 +1865,40 @@ ZEND_API ZEND_COLD void zend_user_exception_handler(void) /* {{{ */
1865
1865
zval_ptr_dtor (& orig_user_exception_handler );
1866
1866
} /* }}} */
1867
1867
1868
+ ZEND_API zend_result zend_execute_script (int type , zval * retval , zend_file_handle * file_handle )
1869
+ {
1870
+ zend_op_array * op_array = zend_compile_file (file_handle , type );
1871
+ if (file_handle -> opened_path ) {
1872
+ zend_hash_add_empty_element (& EG (included_files ), file_handle -> opened_path );
1873
+ }
1874
+
1875
+ zend_result ret = SUCCESS ;
1876
+ if (op_array ) {
1877
+ zend_execute (op_array , retval );
1878
+ zend_exception_restore ();
1879
+ if (UNEXPECTED (EG (exception ))) {
1880
+ if (Z_TYPE (EG (user_exception_handler )) != IS_UNDEF ) {
1881
+ zend_user_exception_handler ();
1882
+ }
1883
+ if (EG (exception )) {
1884
+ ret = zend_exception_error (EG (exception ), E_ERROR );
1885
+ }
1886
+ }
1887
+ zend_destroy_static_vars (op_array );
1888
+ destroy_op_array (op_array );
1889
+ efree_size (op_array , sizeof (zend_op_array ));
1890
+ } else if (type == ZEND_REQUIRE ) {
1891
+ ret = FAILURE ;
1892
+ }
1893
+
1894
+ return ret ;
1895
+ }
1896
+
1868
1897
ZEND_API zend_result zend_execute_scripts (int type , zval * retval , int file_count , ...) /* {{{ */
1869
1898
{
1870
1899
va_list files ;
1871
1900
int i ;
1872
1901
zend_file_handle * file_handle ;
1873
- zend_op_array * op_array ;
1874
1902
zend_result ret = SUCCESS ;
1875
1903
1876
1904
va_start (files , file_count );
@@ -1879,32 +1907,10 @@ ZEND_API zend_result zend_execute_scripts(int type, zval *retval, int file_count
1879
1907
if (!file_handle ) {
1880
1908
continue ;
1881
1909
}
1882
-
1883
1910
if (ret == FAILURE ) {
1884
1911
continue ;
1885
1912
}
1886
-
1887
- op_array = zend_compile_file (file_handle , type );
1888
- if (file_handle -> opened_path ) {
1889
- zend_hash_add_empty_element (& EG (included_files ), file_handle -> opened_path );
1890
- }
1891
- if (op_array ) {
1892
- zend_execute (op_array , retval );
1893
- zend_exception_restore ();
1894
- if (UNEXPECTED (EG (exception ))) {
1895
- if (Z_TYPE (EG (user_exception_handler )) != IS_UNDEF ) {
1896
- zend_user_exception_handler ();
1897
- }
1898
- if (EG (exception )) {
1899
- ret = zend_exception_error (EG (exception ), E_ERROR );
1900
- }
1901
- }
1902
- zend_destroy_static_vars (op_array );
1903
- destroy_op_array (op_array );
1904
- efree_size (op_array , sizeof (zend_op_array ));
1905
- } else if (type == ZEND_REQUIRE ) {
1906
- ret = FAILURE ;
1907
- }
1913
+ ret = zend_execute_script (type , retval , file_handle );
1908
1914
}
1909
1915
va_end (files );
1910
1916
0 commit comments