You are here

function hosting_package_instance_version_compare in Hosting 5

1 call to hosting_package_instance_version_compare()
theme_hosting_task_migrate_form in migrate/hosting_migrate.module

File

package/hosting_package.instance.inc, line 159
API for mapping packages to various Hosting node types

Code

function hosting_package_instance_version_compare($from, $to) {
  if ($from->version == $to->version) {
    return 0;
  }

  #  if (isset($from->schema_version)) {

  #    if ($to->schema_version > $from->schema_version) {

  #      return 1;

  #    }

  #  }
  if (in_array($from->version, array(
    'Unknown',
    'HEAD',
  ))) {
    if (!in_array($to->version, array(
      'Unknown',
      'HEAD',
    ))) {
      return 1;
    }
  }
  _hosting_version_info_extract($from);
  _hosting_version_info_extract($to);
  $compare = version_compare($to->drupal_version, $from->drupal_version);
  if ($compare == 0) {
    $compare = version_compare($to->project_version, $from->project_version);
  }
  return $compare;
}