mirror of
https://github.com/standardebooks/web.git
synced 2025-07-06 06:40:33 -04:00
23 lines
473 B
PHP
23 lines
473 B
PHP
<?
|
|
|
|
class Manual{
|
|
public static function GetLatestVersion(){
|
|
$dirs = glob(MANUAL_PATH . '/*', GLOB_ONLYDIR);
|
|
sort($dirs);
|
|
return str_replace(MANUAL_PATH . '/', '', $dirs[sizeof($dirs) - 1]);
|
|
}
|
|
|
|
public static function GetRequestedVersion(){
|
|
try{
|
|
if(preg_match_all('|/manual/([0-9]+\.[0-9]+\.[0-9]+)|ius', $_SERVER['REQUEST_URI'], $matches)){
|
|
return($matches[1][0]);
|
|
}
|
|
else{
|
|
return null;
|
|
}
|
|
}
|
|
catch(\Exception $ex){
|
|
return null;
|
|
}
|
|
}
|
|
}
|