1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| private function load_local_file(){
return magixcjquery_html_helpersHtml::getUrl().'/version.xml';
}
private function read_local_version(){
try {
$xml = new SimpleXMLElement(self::load_local_file(),0, TRUE);
$v = $xml->number;
} catch(Exception $e) {
$log = magixcjquery_error_log::getLog();
$log->logfile = $_SERVER['DOCUMENT_ROOT'].'/error.log';
$log->write('An error has occured :'. $e->getMessage(),__FILE__, $e->getLine());
magixcjquery_debug_magixfire::magixFireError($e);
}
return $v;
}
private function read_local_phase(){
try {
$xml = new SimpleXMLElement(self::load_local_file(),0, TRUE);
$v = $xml->phase;
} catch(Exception $e) {
$log = magixcjquery_error_log::getLog();
$log->logfile = $_SERVER['DOCUMENT_ROOT'].'/error.log';
$log->write('An error has occured :'. $e->getMessage(),__FILE__, $e->getLine());
magixcjquery_debug_magixfire::magixFireError($e);
}
return $v;
}
private function compare_version(){
try {
$file = fopen('http://www.monsite.com/version.xml', "r");
if(!$file){
$compare = 'Serveur indisponible';
return exit();
}else{
$xml = new SimpleXMLElement('http://www.monsite.com/version.xml',0, TRUE);
$magixv = $xml->number;
$localv = self::read_local_version();
if(strcmp($localv , $magixv)){
$compare = '
Une nouvelle version est disponible';
}else{
$compare = 'Vous utilisez la dernière version';
}
}
} catch(Exception $e) {
$log = magixcjquery_error_log::getLog();
$log->logfile = $_SERVER['DOCUMENT_ROOT'].'/error.log';
$log->write('An error has occured :'. $e->getMessage(),__FILE__, $e->getLine());
magixcjquery_debug_magixfire::magixFireError($e);
}
return $compare;
} |
Partager