public function evaluateVersionCondition($type, $condition)
{
$operator = null;
$operators = array("<=", ">=", "!=", "<>", "<", ">", "=");
// preserve order
foreach ($operators as $oneOperator) {
if (strpos($condition, $oneOperator) === 0) {
$operator = $oneOperator;
$version = substr($condition, strlen($oneOperator));
break;
}
}
$myVersion = null;
if ($type == 'PHP') {
$myVersion = $this->getPHPVersion();
} elseif ($type == 'MySQL') {
$myVersion = $this->getMySQLVersion();
}
if ($myVersion != null && $operator != null) {
return version_compare($myVersion, $version, $operator);
}
return false;
}