fogproject  1.5.9
About: FOG is a Linux-based network computer cloning solution for Windows, Mac OSX and various Linux distributions that ties together a few open-source tools with a PHP-based web interface. FOG doesn’t use any boot disks, or CDs; everything is done via TFTP and PXE.
  Fossies Dox: fogproject-1.5.9.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

mainversion.php
Go to the documentation of this file.
1 <?php
22 require '../commons/base.inc.php';
23 session_write_close();
24 ignore_user_abort(true);
25 set_time_limit(0);
26 
27 $curversion = FOG_VERSION;
28 $urls = array(
29  'https://api.github.com/repos/fogproject/fogproject/tags',
30  'https://raw.githubusercontent.com/FOGProject/fogproject/dev-branch/packages/web/lib/fog/system.class.php',
31  'https://raw.githubusercontent.com/FOGProject/fogproject/working-1.6/packages/web/lib/fog/system.class.php'
32 );
33 $resp = $FOGURLRequests->process($urls);
34 
35 $tags = json_decode(array_shift($resp));
36 foreach ($tags as $tag) {
37  if (preg_match('/^[0-9]\.[0-9]\.[0-9]$/', $tag->name)) {
38  $stableversion = $tag->name;
39  break;
40  }
41 }
42 $systemclass = array_shift($resp);
43 if (preg_match("/FOG_VERSION', '([0-9.RCalphbet-]*)'/", $systemclass, $fogver)) {
44  $devversion = $fogver[1];
45 }
46 $systemclass = array_shift($resp);
47 if (preg_match("/FOG_VERSION', '([0-9.RCalphbet-]*)'/", $systemclass, $fogver)) {
48  $alphaversion = $fogver[1];
49 }
50 
51 $stablecheck = version_compare($curversion, $stableversion, '=');
52 $devcheck = version_compare($curversion, $devversion, '=');
53 $alphacheck = version_compare($curversion, $alphaversion, '=');
54 
55 if (!$stablecheck && !$devcheck && !$alphacheck) {
56  $result = '<font face="arial" color="red" size="4"><b>You are not running the most current version of FOG!</b></font>'
57  . "<p>You are currently running version: $curversion</p>"
58  . "<p>Latest stable version is " . $stableversion . "</p>"
59  . "<p>Latest dev-branch version is $devversion</p>"
60  . "<p>Latest alpha-branch version is $alphaversion</p>";
61 } else {
62  $result = "<b>Your version of FOG is up to date.</b><br/>";
63  if ($stablecheck) {
64  $result .= "You're running the latest stable version: " . $stableversion;
65  } elseif ($devcheck) {
66  $result .= "You're running the latest dev-branch version: " . $devversion;
67  } else {
68  $result .= "You're running the latest alpha-branch version: " . $alphaversion;
69  }
70 }
71 
72 
73 echo json_encode($result);
$devcheck
$devcheck
Definition: mainversion.php:52
$urls
$urls
Definition: mainversion.php:28
exit
exit
Definition: mainversion.php:73
$tags
$tags
Definition: mainversion.php:35
$stablecheck
if(preg_match("/FOG_VERSION', '( $stablecheck[0-9.RCalphbet-] *)'/", $systemclass, $fogver))
Definition: mainversion.php:51
$alphacheck
$alphacheck
Definition: mainversion.php:53
$resp
$resp
Definition: mainversion.php:33
$curversion
$curversion
Definition: mainversion.php:27
$systemclass
foreach($tags as $tag) $systemclass
Definition: mainversion.php:42