浏览代码

Fixes #38

You'd imagine that the `opcache_get_configuration` method would return all of the settings, but no.  So now we get the opcache config and the relevant ini settings for the extension and bring in any missing ones.  Not using the ini settings for everything as it returns the values as strings and not the various scalar types as befitting the value.
Andrew Collington 6 年之前
父节点
当前提交
e5695945e9
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      index.php

+ 4 - 0
index.php

@@ -157,6 +157,10 @@ class OpCacheService
     {
     {
         $status = opcache_get_status();
         $status = opcache_get_status();
         $config = opcache_get_configuration();
         $config = opcache_get_configuration();
+        $missingConfig = array_diff_key(ini_get_all('zend opcache', false), $config['directives']);
+        if (!empty($missingConfig)) {
+            $config['directives'] = array_merge($config['directives'], $missingConfig);
+        }
 
 
         $files = [];
         $files = [];
         if (!empty($status['scripts']) && $this->getOption('allow_filelist')) {
         if (!empty($status['scripts']) && $this->getOption('allow_filelist')) {