diff --git a/config/ext.json b/config/ext.json index 19e33836b..e74f64af1 100644 --- a/config/ext.json +++ b/config/ext.json @@ -382,6 +382,11 @@ "shmop": { "type": "builtin" }, + "simdjson": { + "type": "external", + "source": "ext-simdjson", + "cpp-extension": true + }, "simplexml": { "type": "builtin", "arg-type": "custom", diff --git a/config/source.json b/config/source.json index 6b3ca4141..6ed35f5de 100644 --- a/config/source.json +++ b/config/source.json @@ -100,6 +100,16 @@ "path": "LICENSE" } }, + "ext-simdjson": { + "type": "url", + "url": "https://pecl.php.net/get/simdjson", + "path": "php-src/ext/simdjson", + "filename": "simdjson.tgz", + "license": { + "type": "file", + "path": "LICENSE" + } + }, "ext-snappy": { "type": "git", "path": "php-src/ext/snappy", diff --git a/src/SPC/builder/extension/simdjson.php b/src/SPC/builder/extension/simdjson.php new file mode 100644 index 000000000..71796ebee --- /dev/null +++ b/src/SPC/builder/extension/simdjson.php @@ -0,0 +1,34 @@ +builder->getPHPVersionID(); + FileSystem::replaceFileRegex( + SOURCE_PATH . '/php-src/ext/simdjson/config.m4', + '/php_version=(`.*`)$/m', + 'php_version=' . strval($php_ver) + ); + FileSystem::replaceFileStr( + SOURCE_PATH . '/php-src/ext/simdjson/config.m4', + 'if test -z "$PHP_CONFIG"; then', + 'if false; then' + ); + FileSystem::replaceFileStr( + SOURCE_PATH . '/php-src/ext/simdjson/config.w32', + "'yes',", + 'PHP_SIMDJSON_SHARED,' + ); + return true; + } +} diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index 9cdaaf606..e2aa441e1 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -13,8 +13,8 @@ // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). $extensions = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => 'ds', - 'Windows' => 'mbstring,pdo_sqlite,mbregex,ffi,ds', + 'Linux', 'Darwin' => 'ds,simdjson', + 'Windows' => 'mbstring,pdo_sqlite,mbregex,ffi,ds,simdjson', }; // If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`).