You are here

querypath.install in QueryPath 7.2

Same filename and directory in other branches
  1. 6 querypath.install
  2. 7.3 querypath.install

The installer file for querypath.

File

querypath.install
View source
<?php

/**
 * The installer file for querypath.
 * @file
 */

/**
 * Implements hook_requirements().
 * Checks to see if the QueryPath library has been installed.
 */
function querypath_requirements($phase) {
  $requirements = array();
  switch ($phase) {
    case 'install':
    case 'runtime':
      @(include_once 'QueryPath/QueryPath.php');
      if (function_exists('qp')) {
        $requirements['querypath_lib'] = array(
          'title' => t('QueryPath library'),
          'severity' => REQUIREMENT_OK,
          'value' => 'Present',
        );
      }
      else {
        $params = array(
          '!path' => drupal_get_path('module', 'querypath') . '/QueryPath',
          '!link' => l('http://querypath.org', 'http://querypath.org', array(
            'html' => TRUE,
          )),
        );
        $requirements['querypath_lib'] = array(
          'title' => t('QueryPath library'),
          'severity' => REQUIREMENT_ERROR,
          'description' => t('You must install the QueryPath library from !link. This library must be in the module\\s include path. Typically, putting this in !path is fine. You may also include it elsewhere in the PHP include paths.', array(
            '!path' => drupal_get_path('module', 'querypath') . '/QueryPath',
            l('http://querypath.org', 'http://querypath.org'),
          )),
          'value' => 'Not present',
        );
      }
  }
  return $requirements;
}

Functions

Namesort descending Description
querypath_requirements Implements hook_requirements(). Checks to see if the QueryPath library has been installed.