@@ -264,7 +264,6 @@ function verify_config()
264
264
'log_errors_max_len=0 ' ,
265
265
'opcache.fast_shutdown=0 ' ,
266
266
'opcache.file_update_protection=0 ' ,
267
- 'opcache.preload= ' ,
268
267
'zend.assertions=1 ' ,
269
268
);
270
269
@@ -510,6 +509,7 @@ function save_or_mail_results()
510
509
$ conf_passed = null ;
511
510
$ no_clean = false ;
512
511
$ slow_min_ms = INF ;
512
+ $ preload = false ;
513
513
514
514
$ cfgtypes = array ('show ' , 'keep ' );
515
515
$ cfgfiles = array ('skip ' , 'php ' , 'clean ' , 'out ' , 'diff ' , 'exp ' , 'mem ' );
@@ -625,6 +625,9 @@ function save_or_mail_results()
625
625
case 'e ' :
626
626
$ pass_options .= ' -e ' ;
627
627
break ;
628
+ case '--preload ' :
629
+ $ preload = true ;
630
+ break ;
628
631
case '--no-clean ' :
629
632
$ no_clean = true ;
630
633
break ;
@@ -1256,6 +1259,7 @@ function run_test($php, $file, $env)
1256
1259
global $ SHOW_ONLY_GROUPS ;
1257
1260
global $ no_file_cache ;
1258
1261
global $ slow_min_ms ;
1262
+ global $ preload ;
1259
1263
$ temp_filenames = null ;
1260
1264
$ org_file = $ file ;
1261
1265
@@ -1496,6 +1500,7 @@ function run_test($php, $file, $env)
1496
1500
$ test_skipif = $ test_dir . DIRECTORY_SEPARATOR . $ main_file_name . 'skip.php ' ;
1497
1501
$ temp_clean = $ temp_dir . DIRECTORY_SEPARATOR . $ main_file_name . 'clean.php ' ;
1498
1502
$ test_clean = $ test_dir . DIRECTORY_SEPARATOR . $ main_file_name . 'clean.php ' ;
1503
+ $ preload_filename = $ temp_dir . DIRECTORY_SEPARATOR . $ main_file_name . 'preload.php ' ;
1499
1504
$ tmp_post = $ temp_dir . DIRECTORY_SEPARATOR . uniqid ('/phpt. ' );
1500
1505
$ tmp_relative_file = str_replace (__DIR__ . DIRECTORY_SEPARATOR , '' , $ test_file ) . 't ' ;
1501
1506
@@ -1546,6 +1551,7 @@ function run_test($php, $file, $env)
1546
1551
@unlink ($ tmp_post );
1547
1552
@unlink ($ temp_clean );
1548
1553
@unlink ($ test_clean );
1554
+ @unlink ($ preload_filename );
1549
1555
1550
1556
// Reset environment from any previous test.
1551
1557
$ env ['REDIRECT_STATUS ' ] = '' ;
@@ -1790,6 +1796,14 @@ function run_test($php, $file, $env)
1790
1796
1791
1797
$ args = isset ($ section_text ['ARGS ' ]) ? ' -- ' . $ section_text ['ARGS ' ] : '' ;
1792
1798
1799
+ if ($ preload ) {
1800
+ save_text ($ preload_filename , "<?php \nerror_reporting(0); \nopcache_compile_file(' " . $ test_file . "'); " );
1801
+ $ local_pass_options = $ pass_options ;
1802
+ unset($ pass_options );
1803
+ $ pass_options = $ local_pass_options ;
1804
+ $ pass_options .= " -d opcache.preload= " . $ preload_filename ;
1805
+ }
1806
+
1793
1807
if (array_key_exists ('POST_RAW ' , $ section_text ) && !empty ($ section_text ['POST_RAW ' ])) {
1794
1808
1795
1809
$ post = trim ($ section_text ['POST_RAW ' ]);
@@ -1975,6 +1989,7 @@ function run_test($php, $file, $env)
1975
1989
}
1976
1990
1977
1991
@unlink ($ tmp_post );
1992
+ @unlink ($ preload_filename );
1978
1993
1979
1994
$ leaked = false ;
1980
1995
$ passed = false ;
0 commit comments