Skip to content

Commit

Permalink
Merge branch 'PHP-7.3' into PHP-7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Jul 15, 2019
2 parents 93b3d2f + 3eb057c commit a520c24
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ext/opcache/tests/get_configuration_matches_ini.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--TEST--
Test that the directives listed with `opcache_get_configuration` include all those from the ini settings.
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.opt_debug_level=0
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$opts = opcache_get_configuration()['directives'];
$inis = ini_get_all('zend opcache');
var_dump(array_diff_key($inis, $opts));
?>
--EXPECT--
array(0) {
}
13 changes: 13 additions & 0 deletions ext/opcache/zend_accelerator_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -753,11 +753,24 @@ static ZEND_FUNCTION(opcache_get_configuration)

#ifndef ZEND_WIN32
add_assoc_string(&directives, "opcache.lockfile_path", STRING_NOT_NULL(ZCG(accel_directives).lockfile_path));
#else
add_assoc_string(&directives, "opcache.mmap_base", STRING_NOT_NULL(ZCG(accel_directives).mmap_base));
#endif

add_assoc_string(&directives, "opcache.file_cache", ZCG(accel_directives).file_cache ? ZCG(accel_directives).file_cache : "");
add_assoc_bool(&directives, "opcache.file_cache_only", ZCG(accel_directives).file_cache_only);
add_assoc_bool(&directives, "opcache.file_cache_consistency_checks", ZCG(accel_directives).file_cache_consistency_checks);
#if ENABLE_FILE_CACHE_FALLBACK
add_assoc_bool(&directives, "opcache.file_cache_fallback", ZCG(accel_directives).file_cache_fallback);
#endif

add_assoc_long(&directives, "opcache.file_update_protection", ZCG(accel_directives).file_update_protection);
add_assoc_long(&directives, "opcache.opt_debug_level", ZCG(accel_directives).opt_debug_level);
add_assoc_string(&directives, "opcache.restrict_api", STRING_NOT_NULL(ZCG(accel_directives).restrict_api));
#ifdef HAVE_HUGE_CODE_PAGES
add_assoc_bool(&directives, "opcache.huge_code_pages", ZCG(accel_directives).huge_code_pages);
#endif
add_assoc_string(&directives, "opcache.preload", STRING_NOT_NULL(ZCG(accel_directives).preload));

add_assoc_zval(return_value, "directives", &directives);

Expand Down

0 comments on commit a520c24

Please sign in to comment.