You are here

function rdfx_requirements in RDF Extensions 7.2

Implements hook_requirements().

File

./rdfx.module, line 357
Extends the RDF API of Drupal core to support more RDF seralizations formats other RDF capabilities.

Code

function rdfx_requirements($phase) {
  $requirements = array();
  if ($phase == 'runtime') {
    if (class_exists('ARC2')) {
      $value = t('Installed (version @version)', array(
        '@version' => ARC2::getVersion(),
      ));
      $severity = REQUIREMENT_OK;
      $description = '';
    }
    else {
      $value = t('Not installed');
      $severity = REQUIREMENT_ERROR;
      $path = module_exists('libraries') ? libraries_get_path('ARC2') . '/arc/ARC2.php' : drupal_get_path('module', 'rdfx') . '/vendor/arc/ARC2.php';
      $description = t('The RDFx module requires the ARC2 library to function properly. The simplest way to install ARC2 is by using the Drush command "drush rdf-download". Alternatively, you can !download the latest package, unzip it, and move/rename the folder so that the path to ARC2.php is %path', array(
        '!download' => l('download', 'http://github.com/semsol/arc2/tarball/master'),
        '%path' => $path,
      ));
    }
    $requirements['rdfx_arc'] = array(
      'title' => t('RDFx ARC2 Library'),
      'value' => $value,
      'severity' => $severity,
      'description' => $description,
    );

    // If there were any conflicting namespaces...
    if (rdfx_get_conflicting_namespaces()) {

      // Add a requirement warning and break.
      $requirements['rdfx_ns_conflict'] = array(
        'title' => t('RDFx Namespace Conflict'),
        'severity' => REQUIREMENT_ERROR,
        'value' => '',
        'description' => t('One or more namespaces has conflicts.  See this page for more information:') . ' ' . l(t('RDF publishing settings'), 'admin/config/services/rdf/namespaces'),
      );
    }
  }
  return $requirements;
}