| Server IP : 23.254.227.96 / Your IP : 216.73.216.183 Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64 User : viralblo ( 1001) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/self/root/usr/local/src/imagick/util/ |
Upload File : |
<?php
$headerFilename = __DIR__."/../php_imagick.h";
$phpImagickLines = file($headerFilename);
if ($phpImagickLines === false) {
echo "Failed to read $headerFilename\n";
exit(-1);
}
$versionPackage = false;
$extNumPackage = false;
foreach ($phpImagickLines as $phpImagickLine) {
if (strpos($phpImagickLine, "#define PHP_IMAGICK_VERSION") === 0) {
$versionPackage = trim(substr($phpImagickLine, strlen("#define PHP_IMAGICK_VERSION")));
}
if (strpos($phpImagickLine, "#define PHP_IMAGICK_EXTNUM") === 0) {
$extNumPackage = trim(substr($phpImagickLine, strlen("#define PHP_IMAGICK_EXTNUM")));
}
}
$sxe = simplexml_load_file (__DIR__ . "/../package.xml");
$versionRelease = (string) $sxe->version->release;
$versionApi = (string) $sxe->version->api;
$stabilityRelease = (string) $sxe->stability->release;
$stabilityApi = (string) $sxe->stability->api;
$rc_position = stripos($versionApi, "RC");
if ($rc_position !== false) {
$versionApi = substr($versionApi, 0, $rc_position);
}
$versionReleaseNumber = preg_replace('/[^\d\.]/', '', $versionApi);
$parts = explode('.', $versionReleaseNumber);
if (count($parts) != 3) {
echo "Version number doesn't have 3 parts.";
exit(-1);
}
list($major, $minor, $bug) = $parts;
$extNum = sprintf("%d%02d%02d", $major, $minor, $bug);
if (strcasecmp($extNumPackage, $extNum) !== 0) {
echo "Error: package.xml and php_imagick.h EXTNUM mismatch: $extNumPackage, $extNum\n";
exit (-1);
}
if (strcasecmp($stabilityRelease, "beta") === 0) {
if (strpos($versionRelease, 'b') === false && strpos($versionRelease, 'RC') === false) {
echo "Error: release is marked 'beta' but version [$versionRelease] doesn't include b or RC\n";
exit(-1);
}
}
else if (strcasecmp($stabilityRelease, "stable") === 0) {
if (strpos($versionRelease, 'b') !== false) {
echo "Error: release is marked 'stable' but version [$versionRelease] includes b\n";
exit(-1);
}
if (strpos($versionRelease, 'RC') !== false) {
echo "Error: release is marked 'stable' but version [$versionRelease] includes RC \n";
exit(-1);
}
}
else {
echo "unknown stability $stabilityRelease\n";
exit(-1);
}
if (strcmp($stabilityRelease, $stabilityApi) !== 0) {
echo "Warning: API and release stability differ\n";
exit(-1);
}