public static function isInstalledStandard($standard)
{
$path = self::getInstalledStandardPath($standard);
if ($path !== null && strpos($path, 'ruleset.xml') !== false) {
return true;
} else {
// This could be a custom standard, installed outside our
// standards directory.
$standard = self::realPath($standard);
// Might be an actual ruleset file itself.
// If it has an XML extension, let's at least try it.
if (is_file($standard) === true && (substr(strtolower($standard), -4) === '.xml' || substr(strtolower($standard), -9) === '.xml.dist')) {
return true;
}
// If it is a directory with a ruleset.xml file in it,
// it is a standard.
$ruleset = rtrim($standard, ' /\\') . DIRECTORY_SEPARATOR . 'ruleset.xml';
if (is_file($ruleset) === true) {
return true;
}
}
//end if
return false;
}