You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
x if(2020_09_30..2021_09_02).contains(&x) => Ok(ApiVersion::Php80),
328
+
x if(2021_09_02..2022_08_29).contains(&x) => Ok(ApiVersion::Php81),
329
+
x if(2022_08_29..2023_08_31).contains(&x) => Ok(ApiVersion::Php82),
330
+
x if(2023_08_31..2024_09_24).contains(&x) => Ok(ApiVersion::Php83),
331
+
2024_09_24 => Ok(ApiVersion::Php84),
332
+
version => Err(anyhow!(
333
+
"The current version of PHP is not supported. Current PHP API version: {}, requires a version between {} and {}",
334
+
version,
335
+
ApiVersion::min()asu32,
336
+
ApiVersion::max()asu32
337
+
))
338
+
}
339
+
}
340
+
}
341
+
252
342
/// Checks the PHP Zend API version for compatibility with ext-php-rs, setting
253
343
/// any configuration flags required.
254
344
fncheck_php_version(info:&PHPInfo) -> Result<()>{
255
-
constPHP_81_API_VER:u32 = 2021_09_02;
256
-
constPHP_82_API_VER:u32 = 2022_08_29;
257
-
constPHP_83_API_VER:u32 = 2023_08_31;
258
-
constPHP_84_API_VER:u32 = 2024_09_24;
259
-
260
345
let version = info.zend_version()?;
261
-
262
-
if !(MIN_PHP_API_VER..=MAX_PHP_API_VER).contains(&version){
263
-
bail!("The current version of PHP is not supported. Current PHP API version: {}, requires a version between {} and {}", version,MIN_PHP_API_VER,MAX_PHP_API_VER);
264
-
}
346
+
let version:ApiVersion = version.try_into()?;
265
347
266
348
// Infra cfg flags - use these for things that change in the Zend API that don't
267
349
// rely on a feature and the crate user won't care about (e.g. struct field
println!("cargo:warning=PHP version 8.0 is EOL and will no longer be supported in a future release. Please upgrade to a supported version of PHP. See https://www.php.net/supported-versions.php for information on version support timelines.");
282
-
}
283
-
284
-
if version >= PHP_81_API_VER{
285
-
println!("cargo:rustc-cfg=php81");
286
-
}
287
-
288
-
if version >= PHP_82_API_VER{
289
-
println!("cargo:rustc-cfg=php82");
290
-
}
291
360
292
-
if version >= PHP_83_API_VER{
293
-
println!("cargo:rustc-cfg=php83");
361
+
if version == ApiVersion::Php80{
362
+
println!("cargo:warning=PHP 8.0 is EOL and will no longer be supported in a future release. Please upgrade to a supported version of PHP. See https://www.php.net/supported-versions.php for information on version support timelines.");
294
363
}
295
364
296
-
if version >= PHP_84_API_VER{
297
-
println!("cargo:rustc-cfg=php84");
365
+
for supported_version in version.supported_apis(){
0 commit comments