Skip to content

Instantly share code, notes, and snippets.

@KalleZ
Created December 4, 2017 16:17
Show Gist options
  • Save KalleZ/17ba35075d76fb04bab405098e6668be to your computer and use it in GitHub Desktop.
Save KalleZ/17ba35075d76fb04bab405098e6668be to your computer and use it in GitHub Desktop.
ext/opcache/config.w32 | 2 +-
win32/build/confutils.js | 52 +++++++++++++++++++++++++++++++++++++++++-------
2 files changed, 46 insertions(+), 8 deletions(-)
diff --git a/ext/opcache/config.w32 b/ext/opcache/config.w32
index 8a33fd9..a545694 100644
--- a/ext/opcache/config.w32
+++ b/ext/opcache/config.w32
@@ -10,7 +10,7 @@ if (PHP_OPCACHE != "no") {
AC_DEFINE('HAVE_OPCACHE_FILE_CACHE', 1, 'Define to enable file based caching (experimental)');
}
- EXTENSION('opcache', "\
+ ZEND_EXTENSION('opcache', "\
ZendAccelerator.c \
zend_accelerator_blacklist.c \
zend_accelerator_debug.c \
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index 7fb28d0..d49f530 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -1373,6 +1373,13 @@ function ADD_EXTENSION_DEP(extname, dependson, optional)
var static_pgo_enabled = false;
+function ZEND_EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
+{
+ EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir);
+
+ extensions_enabled[extensions_enabled.length - 1][2] = true;
+}
+
function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
{
var objs = null;
@@ -1509,7 +1516,8 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
}
ADD_FLAG("CFLAGS_" + EXT, cflags);
- extensions_enabled[extensions_enabled.length] = [extname, shared ? 'shared' : 'static'];
+ // [extname, shared, zend]
+ extensions_enabled[extensions_enabled.length] = [extname, shared ? 'shared' : 'static', false];
}
function ADD_SOURCES(dir, file_list, target, obj_dir)
@@ -1870,14 +1878,42 @@ function output_as_table(header, ar_out)
STDOUT.WriteLine(sep);
}
+function write_extensions_summary()
+{
+ var exts = new Array();
+ var zend_exts = new Array();
+
+ for(var x = 0; x < extensions_enabled.length; ++x)
+ {
+ var l = extensions_enabled[x];
+
+ if(l[2])
+ {
+ zend_exts.push([l[0], l[1]]);
+ }
+ else
+ {
+ exts.push([l[0], l[1]]);
+ }
+ }
+
+ STDOUT.WriteLine('Enabled extensions:');
+ output_as_table(['Extension', 'Mode'], exts.sort());
+
+ if(zend_exts.length)
+ {
+ STDOUT.WriteBlankLines(2);
+ STDOUT.WriteLine('Enabled Zend extensions:');
+ output_as_table(['Extension', 'Mode'], zend_exts.sort());
+ }
+}
+
function write_summary()
{
var ar = new Array();
STDOUT.WriteBlankLines(2);
-
- STDOUT.WriteLine("Enabled extensions:");
- output_as_table(["Extension", "Mode"], extensions_enabled.sort());
+ write_extensions_summary();
STDOUT.WriteBlankLines(2);
if (!MODE_PHPIZE) {
STDOUT.WriteLine("Enabled SAPI:");
@@ -1947,8 +1983,10 @@ function generate_tmp_php_ini()
continue;
}
- var directive = "extension";
- if ("opcache" == extensions_enabled[i][0] || "xdebug" == extensions_enabled[i][0]) {
+ var directive = (extensions_enabled[i][2] ? 'zend_extension' : 'extension');
+
+ // FIXME: Remove this once ZEND_EXTENSION() is merged to XDEBUG
+ if ("xdebug" == extensions_enabled[i][0]) {
directive = "zend_extension";
}
@@ -1962,7 +2000,7 @@ function generate_tmp_php_ini()
}
}
- INI.Close();;
+ INI.Close();
}
function generate_files()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment