You are here

function forena_query_requirements in Forena Reports 7.4

Same name and namespace in other branches
  1. 8 forena_query/forena_query.module \forena_query_requirements()
  2. 7.5 forena_query.module \forena_query_requirements()

Implmentation of hook_requirements.

Parameters

string $phase: Phase of requirement check to perform.

Return value

array Requirements analysis.

File

./forena_query.module, line 102
Provides the ability to create saved queries and to test sql data blocks.

Code

function forena_query_requirements($phase) {
  $requirements = array();
  switch ($phase) {
    case 'runtime':
      $writeable = is_writable(Frx::DataFile()->dir);
      if (!$writeable) {
        $requirements['fornea_writable'] = array(
          'title' => 'Forena Query Data Directory',
          'value' => Frx::DataFile()->dir,
          'severity' => REQUIREMENT_ERROR,
          'description' => t('The directory must be writable by the web user in order to create custom SQL data sources.') . t('Configure <a href="@private_path">private file system paths</a> or specificy a differnt <a href="@data_directory">data directory</a>."', array(
            '@private_path' => url('admin/config/media/file-system'),
            '@data_directory' => url('admin/config/content/forena'),
          )),
        );
      }
  }
  return $requirements;
}