/** * Checks ifthis range is satisfied by the given version * @param version $version * @return boolean */ public function satisfiedBy(version $version) { $version1 = $version->getVersion(); $expression = sprintf(self::$regexp_mask, self::$global_single_comparator . self::$global_single_version); $ok = false; foreach ($this->chunks as $orblocks) { //Or loop foreach ($orblocks as $ablocks) { //And loop $matches = array(); preg_match($expression, $ablocks, $matches); $comparators = $matches[1]; $version2 = $matches[2]; if ($comparators === '') { $comparators = '=='; //Use equal if no comparator is set } //If one chunk of the and-loop does not match... if (!version::cmp($version1, $comparators, $version2)) { $ok = false; //It is not okay break; //And this loop will surely fail: return to or-loop } else { $ok = true; } } if ($ok) { return true; //Only one or block has to match } } return false; //No matches found :( }
/** * Checks ifa given string is equal to another * @param string|version $v1 The first version * @param string|version $v2 The second version * @return boolean */ public static function eq($v1, $v2) { if (!$v1 instanceof version) { $v1 = new version($v1, true); } if (!$v2 instanceof version) { $v2 = new version($v2, true); } return $v1->getVersion() === $v2->getVersion(); }
/** * Checks if a given string is equal to another * @param string|version $v1 The first version * @param string|version $v2 The second version * @return boolean */ static function eq($v1, $v2) { $v1 = new version($v1, true); $v2 = new version($v2, true); return $v1->getVersion() == $v2->getVersion(); }
$sum = 0; $num = 0; if ($handle = opendir("files/")) { while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != ".." && $entry != ".DS_Store" && $entry != ".htaccess" && $entry != ".htdocs") { $sum += filesize("files/" . $entry); $num = $num + 1; //echo "<tr><td>".$entry."</td><td><small><a href='?delete=".$entry."'><i class='fa fa-trash fa-lg'></i></a></small></td></tr><br>"; } } closedir($handle); } $sum = $sum / 1024; $sum = $sum / 1024; $sum = round($sum, 3); $version["local"] = version::getVersion(); // Check version if (version::updateExists($version["local"])) { $update = true; write2logfile("Update " . $version["global"] . " availible", "index.php"); } // Ignore invalid versions if the version is a DEV version if (version::isDevVersion($version["local"])) { unset($updateerror); $version["local"] .= " - Thanks for testing the developer version!"; } // Check for messages $message = Synchro::getMessage(); if (empty($message)) { unset($message); }
} else { $data = header_SynchroUses(); } $size = $data[0]; $type = $data[1]; $number = $data[2]; } ?> <header class="header dark-bg"> <div class="toggle-nav"> <div class="icon-reorder tooltips" data-original-title="Toggle Navigation" data-placement="bottom"></div> </div> <!--Logo--> <a href="index.php" class="logo"><span class="lite">Synchro</span> v<?php echo version::getVersion(); ?> </a> <!--logo end--> <?php if (!file_exists("data/dontdhowsize")) { ?> <ul class="nav navbar-nav navbar-right"><br> You currently use <?php echo $size . $type; ?> in <?php echo $number; ?> file<?php if ($number !== 1) {