| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* .install file for pathcache module.
|
| 7 |
*/
|
| 8 |
|
| 9 |
/**
|
| 10 |
* Implementation of hook_requirements().
|
| 11 |
*/
|
| 12 |
function pathcache_requirements($phase) {
|
| 13 |
// Ensure translations don't break at install time.
|
| 14 |
$t = get_t();
|
| 15 |
|
| 16 |
$aliases_exist = (int)db_result(db_query('SELECT pid FROM {url_alias} LIMIT 1'));
|
| 17 |
$requirements['pathcache'] = array(
|
| 18 |
'title' => $t('Path Cache'),
|
| 19 |
'value' => $aliases_exist ? t('URL aliases present') : t('No URL aliases exist'),
|
| 20 |
'severity' => $aliases_exist ? REQUIREMENT_OK : REQUIREMENT_ERROR,
|
| 21 |
'description' => $aliases_exist ? '' : $t('The path cache module expects to have URL aliases in your url_aliases database table. Currently that table is empty. If you are not using path aliases (by using the Path module, for example) the Path Cache module will actually slow down your site instead of speeding it up.'),
|
| 22 |
);
|
| 23 |
|
| 24 |
return $requirements;
|
| 25 |
}
|