beingsane
5/13/2014 - 3:01 PM

libraries_cms_version_compatibility.php

<?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();