Throw proper exception when PHP source is not available

This commit is contained in:
Joseph Bielawski
2023-09-30 08:56:37 +02:00
committed by Jerry Ma
parent 8f43a09533
commit 8636f2e7c9
4 changed files with 15 additions and 24 deletions

View File

@@ -1,18 +0,0 @@
<?php
declare(strict_types=1);
namespace SPC\util;
class Util
{
/**
* Get current PHP version ID (downloaded)
*/
public static function getPHPVersionID(): int
{
$file = file_get_contents(SOURCE_PATH . '/php-src/main/php_version.h');
preg_match('/PHP_VERSION_ID (\d+)/', $file, $match);
return intval($match[1]);
}
}