-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1cdf3fa
commit 97eff1b
Showing
7 changed files
with
208 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--TEST-- | ||
GH-16551: opcache file cache read only: generate file cache | ||
--INI-- | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.jit=disable | ||
opcache.jit_buffer_size=0 | ||
opcache.file_cache="{TMP}" | ||
--EXTENSIONS-- | ||
opcache | ||
--CONFLICTS-- | ||
opcache_file_cache | ||
--FILE-- | ||
<?php | ||
|
||
$file = __DIR__ . '/gt16551_998.inc'; | ||
$uncached_file = __DIR__ . '/gt16551_999.inc'; | ||
|
||
opcache_compile_file($file); | ||
|
||
var_dump( | ||
opcache_is_script_cached($file) | ||
); | ||
|
||
var_dump( | ||
opcache_is_script_cached_in_file_cache($file) | ||
); | ||
|
||
var_dump( | ||
opcache_is_script_cached($uncached_file) | ||
); | ||
|
||
var_dump( | ||
opcache_is_script_cached_in_file_cache($uncached_file) | ||
); | ||
|
||
?> | ||
--EXPECT-- | ||
bool(true) | ||
bool(true) | ||
bool(false) | ||
bool(false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--TEST-- | ||
GH-16551: opcache file cache read only: read file cache | ||
--INI-- | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.jit=disable | ||
opcache.jit_buffer_size=0 | ||
opcache.file_cache="{TMP}" | ||
opcache.file_cache_read_only=1 | ||
--EXTENSIONS-- | ||
opcache | ||
--CONFLICTS-- | ||
opcache_file_cache | ||
--FILE-- | ||
<?php | ||
|
||
$file = __DIR__ . '/gt16551_998.inc'; | ||
$uncached_file = __DIR__ . '/gt16551_999.inc'; | ||
|
||
var_dump( | ||
opcache_is_script_cached_in_file_cache($file) | ||
); | ||
|
||
require $file; | ||
|
||
var_dump( | ||
opcache_is_script_cached_in_file_cache($uncached_file) | ||
); | ||
|
||
require $uncached_file; | ||
|
||
?> | ||
--EXPECT-- | ||
bool(true) | ||
9 | ||
bool(false) | ||
8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--TEST-- | ||
GH-16551: opcache file cache read only: read file cache with limited checks | ||
--INI-- | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.jit=disable | ||
opcache.jit_buffer_size=0 | ||
opcache.file_cache="{TMP}" | ||
opcache.file_cache_read_only=1 | ||
opcache.revalidate_freq=0 | ||
opcache.enable_file_override=true | ||
opcache.validate_timestamps=false | ||
opcache.file_cache_consistency_checks=false | ||
--EXTENSIONS-- | ||
opcache | ||
--CONFLICTS-- | ||
opcache_file_cache | ||
--FILE-- | ||
<?php | ||
|
||
$file = __DIR__ . '/gt16551_998.inc'; | ||
$uncached_file = __DIR__ . '/gt16551_999.inc'; | ||
|
||
var_dump( | ||
opcache_is_script_cached_in_file_cache($file) | ||
); | ||
|
||
require $file; | ||
|
||
var_dump( | ||
opcache_is_script_cached_in_file_cache($uncached_file) | ||
); | ||
|
||
require $uncached_file; | ||
|
||
?> | ||
--EXPECT-- | ||
bool(true) | ||
9 | ||
bool(false) | ||
8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--TEST-- | ||
GH-16551: opcache file cache read only: ensure we can't invalidate | ||
--INI-- | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.jit=disable | ||
opcache.jit_buffer_size=0 | ||
opcache.file_cache="{TMP}" | ||
opcache.file_cache_read_only=1 | ||
--EXTENSIONS-- | ||
opcache | ||
--CONFLICTS-- | ||
opcache_file_cache | ||
--FILE-- | ||
<?php | ||
|
||
$file = __DIR__ . '/gt16551_998.inc'; | ||
|
||
var_dump( | ||
opcache_is_script_cached_in_file_cache($file) | ||
); | ||
|
||
// invalidate SHM, but silently ignore file cache. | ||
opcache_invalidate($file, true); | ||
|
||
var_dump( | ||
opcache_is_script_cached_in_file_cache($file) | ||
); | ||
|
||
require $file; | ||
|
||
?> | ||
--EXPECT-- | ||
bool(true) | ||
bool(true) | ||
8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--TEST-- | ||
GH-16551: opcache file cache read only: ensure cache files aren't created | ||
--INI-- | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.jit=disable | ||
opcache.jit_buffer_size=0 | ||
opcache.file_cache="{TMP}" | ||
opcache.file_cache_read_only=1 | ||
--EXTENSIONS-- | ||
opcache | ||
--CONFLICTS-- | ||
opcache_file_cache | ||
--FILE-- | ||
<?php | ||
|
||
$uncached_file = __DIR__ . '/gt16551_999.inc'; | ||
|
||
var_dump( | ||
opcache_is_script_cached($uncached_file) | ||
); | ||
|
||
var_dump( | ||
opcache_is_script_cached_in_file_cache($uncached_file) | ||
); | ||
|
||
opcache_compile_file($uncached_file); | ||
|
||
var_dump( | ||
opcache_is_script_cached($uncached_file) | ||
); | ||
|
||
var_dump( | ||
opcache_is_script_cached_in_file_cache($uncached_file) | ||
); | ||
|
||
?> | ||
--EXPECT-- | ||
bool(false) | ||
bool(false) | ||
bool(true) | ||
bool(false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
$a = 4+5; | ||
|
||
echo $a . "\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
$a = 3+5; | ||
|
||
echo $a . "\n"; |