You are here

function demo_get_info in Demonstration site (Sandbox / Snapshot) 6

Same name and namespace in other branches
  1. 8 demo.module \demo_get_info()
  2. 5 demo.admin.inc \demo_get_info()
  3. 7 demo.admin.inc \demo_get_info()
4 calls to demo_get_info()
demo_drush_snapshots in ./demo.drush.inc
Callback for drush command demo-snapshot.
demo_get_dumps in ./demo.admin.inc
demo_set_info in ./demo.admin.inc
_demo_reset in ./demo.admin.inc
Reset site using snapshot.

File

./demo.admin.inc, line 448
Demonstration Site administrative pages

Code

function demo_get_info($filename, $field = NULL) {
  $info = array();
  if (file_exists($filename)) {
    $info = parse_ini_file($filename);
    if (isset($info['modules'])) {
      $info['modules'] = explode(" ", $info['modules']);
    }
    else {
      $info['modules'] = NULL;
    }
    if (!isset($info['version'])) {
      $info['version'] = '1.0';
    }
  }
  if (isset($field)) {
    return isset($info[$field]) ? $info[$field] : NULL;
  }
  else {
    return $info;
  }
}