| 1 |
<?php |
<?php |
| 2 |
/* $Id: robotstxt.install,v 1.1.4.4 2009/01/03 17:20:34 hass Exp $ */ |
/* $Id: robotstxt.install,v 1.1.4.5 2009/03/07 10:49:20 hass Exp $ */ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Implementation of hook_install(). |
* Implementation of hook_install(). |
| 29 |
|
|
| 30 |
switch ($phase) { |
switch ($phase) { |
| 31 |
case 'install' : |
case 'install' : |
|
case 'runtime' : |
|
| 32 |
// Module cannot work without Clean URLs. |
// Module cannot work without Clean URLs. |
| 33 |
if (!variable_get('clean_url', 0)) { |
if (!variable_get('clean_url', 0)) { |
| 34 |
$requirements['robotstxt_cleanurl'] = array( |
$requirements['robotstxt_cleanurl'] = array( |
| 37 |
'value' => $t('<a href="!clean_url">Clean URLs</a> are mandatory for this module.', array('!clean_url' => url('admin/settings/clean-urls'))), |
'value' => $t('<a href="!clean_url">Clean URLs</a> are mandatory for this module.', array('!clean_url' => url('admin/settings/clean-urls'))), |
| 38 |
); |
); |
| 39 |
} |
} |
| 40 |
|
break; |
| 41 |
|
|
| 42 |
|
case 'runtime' : |
| 43 |
// Webservers prefer the robots.txt file on disk and does not allow menu path overwrite. |
// Webservers prefer the robots.txt file on disk and does not allow menu path overwrite. |
| 44 |
if (file_exists('./robots.txt')) { |
if (file_exists('./robots.txt')) { |
| 45 |
$requirements['robotstxt_file'] = array( |
$requirements['robotstxt_file'] = array( |
| 48 |
'value' => $t('RobotsTxt module works only if you remove the existing robots.txt file in your website root.'), |
'value' => $t('RobotsTxt module works only if you remove the existing robots.txt file in your website root.'), |
| 49 |
); |
); |
| 50 |
} |
} |
| 51 |
|
break; |
| 52 |
} |
} |
| 53 |
return $requirements; |
return $requirements; |
| 54 |
} |
} |