File tree Expand file tree Collapse file tree 10 files changed +22
-65
lines changed Expand file tree Collapse file tree 10 files changed +22
-65
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,13 @@ $sig1 = $phar->getSignature();
21
21
include $ pname . '/a.php ' ;
22
22
23
23
if (function_exists ("opcache_get_status " )) {
24
- $ status = opcache_get_status ();
25
- if ($ status ["opcache_enabled " ] || (isset ($ status ["file_cache_only " ]) && $ status ["file_cache_only " ])) {
26
- ini_set ("opcache.revalidate_freq " , "0 " );
27
- sleep (2 );
28
- }
24
+ $ status = opcache_get_status ();
25
+ if (is_array ($ status ) && ($ status ["opcache_enabled " ] || (isset ($ status ["file_cache_only " ]) && $ status ["file_cache_only " ]))) {
26
+ opcache_invalidate ($ pname . '/a.php ' , true );
27
+ // opcache_invalidate is buggy and doesn't work as expected so we add a
28
+ // minor delay here.
29
+ sleep (2 );
30
+ }
29
31
}
30
32
31
33
file_put_contents ($ pname .'/a.php ' , "modified! \n" );
Original file line number Diff line number Diff line change @@ -16,14 +16,6 @@ $files['a.php'] = '<?php echo "This is a\n"; ?>';
16
16
$ files ['b.php ' ] = '<?php echo "This is b\n"; ?> ' ;
17
17
$ files ['b/c.php ' ] = '<?php echo "This is b/c\n"; ?> ' ;
18
18
19
- if (function_exists ("opcache_get_status " )) {
20
- $ status = opcache_get_status ();
21
- if ($ status ["opcache_enabled " ]) {
22
- ini_set ("opcache.revalidate_freq " , "0 " );
23
- sleep (2 );
24
- }
25
- }
26
-
27
19
include 'files/phar_test.inc ' ;
28
20
29
21
include $ pname . '/a.php ' ;
@@ -54,4 +46,3 @@ Warning: include(%sdelete_in_phar.phar.php/b/c.php): failed to open stream: phar
54
46
Warning: include(): Failed opening 'phar://%sdelete_in_phar.phar.php/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar.php on line %d
55
47
56
48
===DONE===
57
-
Original file line number Diff line number Diff line change @@ -16,14 +16,6 @@ $files['a.php'] = '<?php echo "This is a\n"; ?>';
16
16
$ files ['b.php ' ] = '<?php echo "This is b\n"; ?> ' ;
17
17
$ files ['b/c.php ' ] = '<?php echo "This is b/c\n"; ?> ' ;
18
18
19
- if (function_exists ("opcache_get_status " )) {
20
- $ status = opcache_get_status ();
21
- if ($ status ["opcache_enabled " ]) {
22
- ini_set ("opcache.revalidate_freq " , "0 " );
23
- sleep (2 );
24
- }
25
- }
26
-
27
19
include 'files/phar_test.inc ' ;
28
20
29
21
include $ pname . '/a.php ' ;
Original file line number Diff line number Diff line change @@ -15,11 +15,13 @@ $pname = 'phar://' . $fname;
15
15
file_put_contents ($ pname . '/a.php ' , "brand new! \n" );
16
16
17
17
if (function_exists ("opcache_get_status " )) {
18
- $ status = opcache_get_status ();
19
- if ($ status ["opcache_enabled " ] || (isset ($ status ["file_cache_only " ]) && $ status ["file_cache_only " ])) {
20
- ini_set ("opcache.revalidate_freq " , "0 " );
21
- sleep (2 );
22
- }
18
+ $ status = opcache_get_status ();
19
+ if (is_array ($ status ) && ($ status ["opcache_enabled " ] || (isset ($ status ["file_cache_only " ]) && $ status ["file_cache_only " ]))) {
20
+ opcache_invalidate ($ pname . '/a.php ' , true );
21
+ // opcache_invalidate is buggy and doesn't work as expected so we add a
22
+ // minor delay here.
23
+ sleep (2 );
24
+ }
23
25
}
24
26
25
27
$ phar = new Phar ($ fname );
Original file line number Diff line number Diff line change @@ -18,14 +18,6 @@ $phar['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
18
18
$ phar ->setStub ('<?php __HALT_COMPILER(); ?> ' );
19
19
$ phar ->stopBuffering ();
20
20
21
- if (function_exists ("opcache_get_status " )) {
22
- $ status = opcache_get_status ();
23
- if ($ status ["opcache_enabled " ]) {
24
- ini_set ("opcache.revalidate_freq " , "0 " );
25
- sleep (2 );
26
- }
27
- }
28
-
29
21
include $ alias . '/a.php ' ;
30
22
include $ alias . '/b.php ' ;
31
23
include $ alias . '/b/c.php ' ;
Original file line number Diff line number Diff line change @@ -18,14 +18,6 @@ $phar['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
18
18
$ phar ->setStub ('<?php __HALT_COMPILER(); ?> ' );
19
19
$ phar ->stopBuffering ();
20
20
21
- if (function_exists ("opcache_get_status " )) {
22
- $ status = opcache_get_status ();
23
- if ($ status ["opcache_enabled " ]) {
24
- ini_set ("opcache.revalidate_freq " , "0 " );
25
- sleep (2 );
26
- }
27
- }
28
-
29
21
include $ alias . '/a.php ' ;
30
22
include $ alias . '/b.php ' ;
31
23
include $ alias . '/b/c.php ' ;
Original file line number Diff line number Diff line change @@ -15,11 +15,13 @@ $pname = 'phar://' . $fname;
15
15
file_put_contents ($ pname . '/a.php ' , "brand new! \n" );
16
16
17
17
if (function_exists ("opcache_get_status " )) {
18
- $ status = opcache_get_status ();
19
- if ($ status ["opcache_enabled " ] || (isset ($ status ["file_cache_only " ]) && $ status ["file_cache_only " ])) {
20
- ini_set ("opcache.revalidate_freq " , "0 " );
21
- sleep (2 );
22
- }
18
+ $ status = opcache_get_status ();
19
+ if (is_array ($ status ) && ($ status ["opcache_enabled " ] || (isset ($ status ["file_cache_only " ]) && $ status ["file_cache_only " ]))) {
20
+ opcache_invalidate ($ pname . '/a.php ' , true );
21
+ // opcache_invalidate is buggy and doesn't work as expected so we add a
22
+ // minor delay here.
23
+ sleep (2 );
24
+ }
23
25
}
24
26
25
27
$ phar = new Phar ($ fname );
Original file line number Diff line number Diff line change @@ -18,14 +18,6 @@ $phar['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
18
18
$ phar ->setStub ('<?php __HALT_COMPILER(); ?> ' );
19
19
$ phar ->stopBuffering ();
20
20
21
- if (function_exists ("opcache_get_status " )) {
22
- $ status = opcache_get_status ();
23
- if ($ status ["opcache_enabled " ]) {
24
- ini_set ("opcache.revalidate_freq " , "0 " );
25
- sleep (2 );
26
- }
27
- }
28
-
29
21
include $ alias . '/a.php ' ;
30
22
include $ alias . '/b.php ' ;
31
23
include $ alias . '/b/c.php ' ;
@@ -54,4 +46,3 @@ Warning: include(%sdelete_in_phar.phar.zip/b/c.php): failed to open stream: phar
54
46
Warning: include(): Failed opening 'phar://%sdelete_in_phar.phar.zip/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar.php on line %d
55
47
56
48
===DONE===
57
-
Original file line number Diff line number Diff line change @@ -18,14 +18,6 @@ $phar['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
18
18
$ phar ->setStub ('<?php __HALT_COMPILER(); ?> ' );
19
19
$ phar ->stopBuffering ();
20
20
21
- if (function_exists ("opcache_get_status " )) {
22
- $ status = opcache_get_status ();
23
- if ($ status ["opcache_enabled " ]) {
24
- ini_set ("opcache.revalidate_freq " , "0 " );
25
- sleep (2 );
26
- }
27
- }
28
-
29
21
include $ alias . '/a.php ' ;
30
22
include $ alias . '/b.php ' ;
31
23
include $ alias . '/b/c.php ' ;
Original file line number Diff line number Diff line change @@ -258,6 +258,7 @@ function main()
258
258
'log_errors_max_len=0 ' ,
259
259
'opcache.fast_shutdown=0 ' ,
260
260
'opcache.file_update_protection=0 ' ,
261
+ 'opcache.revalidate_freq=0 ' ,
261
262
'zend.assertions=1 ' ,
262
263
);
263
264
You can’t perform that action at this time.
0 commit comments