function fontawesome_iconpicker_get_version in Font Awesome Iconpicker 7
Same name and namespace in other branches
- 8 fontawesome_iconpicker.module \fontawesome_iconpicker_get_version()
Reads version of installed fontawesome iconpicker library.
See also
fontawesome_iconpicker_libraries_info()
1 string reference to 'fontawesome_iconpicker_get_version'
File
- ./
fontawesome_iconpicker.module, line 58 - Integrates fontawesome-iconpicker plugin with Drupal.
Code
function fontawesome_iconpicker_get_version($library, $options) {
// Provide defaults.
$options += array(
'file' => '',
);
$file = DRUPAL_ROOT . '/' . $library['library path'] . '/' . $options['file'];
if (empty($options['file']) || !file_exists($file)) {
return;
}
$f = file_get_contents($file);
$data = json_decode($f);
return isset($data->version) ? $data->version : NULL;
}