function demo_get_info in Demonstration site (Sandbox / Snapshot) 8
Same name and namespace in other branches
- 5 demo.admin.inc \demo_get_info()
- 6 demo.admin.inc \demo_get_info()
- 7 demo.admin.inc \demo_get_info()
3 calls to demo_get_info()
- demo_get_dumps in ./
demo.module - Get all the dumps from the private directory.
- demo_set_info in ./
demo.module - _demo_reset in ./
demo.module - Reset site using snapshot.
File
- ./
demo.module, line 652
Code
function demo_get_info($filename, $field = NULL) {
$info = [];
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;
}
}