public static function setApiVersion() { if (self::$version === null && isset($_GET['__route__'])) { preg_match('#^/(v[0-9]+)#', $_GET['__route__'], $matches); if (isset($matches[1])) { self::$version = $matches[1]; } else { self::$version = self::$latestVersion; } } }