@@ -30,7 +30,6 @@ if [ "$ASYNC_MODE" != "jspi" ]; then
3030fi
3131
3232case " $PHP_VERSION " in
33- 7.4) PHP_API_VERSION=20190902 ;;
3433 8.0) PHP_API_VERSION=20200930 ;;
3534 8.1) PHP_API_VERSION=20210902 ;;
3635 8.2) PHP_API_VERSION=20220829 ;;
@@ -142,31 +141,6 @@ docker run --rm -i \
142141 REG=$(find /root/cargo/registry/src -maxdepth 1 -type d -name "index.crates.io-*" | head -1)
143142 chmod -R u+w "$REG"
144143
145- if [ "${PHP_VERSION:-}" = "7.4" ]; then
146- # ext-php-rs 0.15's runtime APIs still cover the pieces this extension
147- # uses, but its build-time version table starts at PHP 8.0. Add the
148- # PHP 7.4 Zend API so bindgen can run against Playground's 7.4 headers.
149- perl -0pi -e 's|pub enum ApiVersion \{\n|pub enum ApiVersion {\n /// PHP 7.4\n Php74 = 2019_09_02,\n|' \
150- "$REG/ext-php-rs-build-0.1.1/src/lib.rs"
151- sed -i 's/ApiVersion::Php80,/ApiVersion::Php74,/' \
152- "$REG/ext-php-rs-0.15.12/build.rs"
153- sed -i '/vec!\[/a \ ApiVersion::Php74,' \
154- "$REG/ext-php-rs-build-0.1.1/src/lib.rs"
155- perl -0pi -e 's/(pub fn cfg_name\(self\).*?match self \{\n)/$1 ApiVersion::Php74 => "php74",\n/s' \
156- "$REG/ext-php-rs-build-0.1.1/src/lib.rs"
157- perl -0pi -e 's/(pub fn define_name\(self\).*?match self \{\n)/$1 ApiVersion::Php74 => "EXT_PHP_RS_PHP_74",\n/s' \
158- "$REG/ext-php-rs-build-0.1.1/src/lib.rs"
159- sed -i '/match version {/a \ x if ((ApiVersion::Php74 as u32)..(ApiVersion::Php80 as u32)).contains(&x) => Ok(ApiVersion::Php74),' \
160- "$REG/ext-php-rs-build-0.1.1/src/lib.rs"
161- sed -i 's/cfg(php80, php81/cfg(php74, php80, php81/' \
162- "$REG/ext-php-rs-build-0.1.1/src/lib.rs"
163- sed -i '1i #include <stdbool.h>' \
164- "$REG/ext-php-rs-0.15.12/src/wrapper.h"
165- grep -q 'Php74 = 2019_09_02' "$REG/ext-php-rs-build-0.1.1/src/lib.rs"
166- grep -q 'ApiVersion::Php74,' "$REG/ext-php-rs-0.15.12/build.rs"
167- grep -q '#include <stdbool.h>' "$REG/ext-php-rs-0.15.12/src/wrapper.h"
168- fi
169-
170144 sed -i "s/12 \* std::mem::size_of::<usize>/24 * std::mem::size_of::<usize>/" \
171145 "$REG/ext-php-rs-0.15.12/src/internal/property.rs"
172146
0 commit comments