function piwik_requirements in Piwik Web Analytics 5
Same name and namespace in other branches
- 8 piwik.install \piwik_requirements()
- 6.2 piwik.install \piwik_requirements()
- 6 piwik.install \piwik_requirements()
- 7.2 piwik.install \piwik_requirements()
- 7 piwik.install \piwik_requirements()
Implementation of hook_requirements().
File
- ./
piwik.install, line 42 - Installation file for Piwik - Web analytics module.
Code
function piwik_requirements($phase) {
$requirements = array();
$t = get_t();
switch ($phase) {
case 'runtime':
// Raise warning if Piwik user account has not been set yet.
if (!preg_match('/^\\d{1,}$/', variable_get('piwik_site_id', ''))) {
$requirements['piwik'] = array(
'title' => $t('Piwik module'),
'description' => $t('Piwik module has not been configured yet. Please configure its settings from the <a href="@url">Piwik settings page</a>.', array(
'@url' => url('admin/settings/piwik'),
)),
'severity' => REQUIREMENT_ERROR,
'value' => $t('Not configured'),
);
}
break;
}
return $requirements;
}