rpicms

A CMS for the Raspberry Pi
git clone git://archive.git.mtrnord.blog/RpicmsTeam/rpicms.git
Log | Files | Refs | README | LICENSE

index.php (832B)


      1 <?php 
      2 #######################
      3 # flush browser cache #
      4 #######################
      5 header("Cache-Control: no-cache, must-revalidate, no-store");
      6 
      7 require('update.php');
      8 
      9 $update = new AutoUpdate(true);
     10 $update->currentVersion = 1; //Must be an integer - you can't compare strings
     11 $update->updateUrl = 'http://media.nordgedanken.de/rpicms/server'; //Replace with your server update directory
     12 
     13 //Check for a new update
     14 $latest = $update->checkUpdate();
     15 if ($latest !== false) {
     16 	if ($latest > $update->currentVersion) {
     17 		//Install new update
     18 		echo "New Version: ".$update->latestVersionName."<br>";
     19 		echo "Installing Update...<br>";
     20 		if ($update->update()) {
     21 			echo "Update successful!";
     22 		}
     23 		else {
     24 			echo "Update failed!";
     25 		}
     26 		
     27 	}
     28 	else {
     29 		echo "Current Version is up to date";
     30 	}
     31 }
     32 else {
     33 	echo $update->getLastError();
     34 }
     35 
     36 ?>