MCPcopy Create free account
hub / github.com/error311/FileRise / fr_pro_api_level_from_version

Function fr_pro_api_level_from_version

config/config.php:832–845  ·  view source on GitHub ↗
(?string $version)

Source from the content-addressed store, hash-verified

830
831if (!function_exists('fr_pro_api_level_from_version')) {
832 function fr_pro_api_level_from_version(?string $version): int
833 {
834 $v = trim((string)$version);
835 if ($v === '') return 0;
836 $v = ltrim($v, "vV");
837 $parts = explode('.', $v);
838 $major = (isset($parts[0]) && ctype_digit($parts[0])) ? (int)$parts[0] : 0;
839 $minor = (isset($parts[1]) && ctype_digit($parts[1])) ? (int)$parts[1] : 0;
840 if ($major <= 0) return 0;
841 if ($major === 1) {
842 return max(0, $minor);
843 }
844 return ($major * 100) + max(0, $minor);
845 }
846}
847
848if (!defined('FR_PRO_API_LEVEL')) {

Callers 1

config.phpFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected