Created
December 13, 2012 04:33
-
-
Save eddieajau/4274047 to your computer and use it in GitHub Desktop.
Joomla version compatibility class.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class JVersionCompatibility | |
{ | |
/** | |
* Class constructor. | |
* | |
* @param SimpleXmlElement $node The compatibility node from a manifest file. | |
* | |
* @see https://github.com/joomla/joomla-cms/issues/598 for XML specification. | |
*/ | |
public function __construct(SimpleXmlElement $node); | |
/** | |
* Checks a version for compatibility. | |
* | |
* @param string $version The version to check. | |
* | |
* @return boolean True if the version meets the compatibility rules, false otherwise. | |
*/ | |
public function check($version); | |
/** | |
* Gets the comment, if available from the previous call to the `check` method. | |
* | |
* @return string The comment from the compatibility rule that was matched when calling `check`. | |
*/ | |
public function getComment(); | |
} | |
$vCheck = new JVersionCompatibility($xml->compatibility); | |
$vCheck->check($versionToUpdateTo); | |
$comment = $vCheck->getComment(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment