function acquai_spi_get_404s in Acquia Connector 6.2
Same name and namespace in other branches
- 7.3 acquia_spi/acquia_spi.module \acquai_spi_get_404s()
- 7.2 acquia_spi/acquia_spi.module \acquai_spi_get_404s()
Grabs the last 404 errors in logs, excluding the checks we run for drupal files like README
Parameters
n/a:
Return value
An array of the pages not found and some associated data
1 call to acquai_spi_get_404s()
- acquia_spi_get in acquia_spi/
acquia_spi.module - Gather site profile information about this site.
File
- acquia_spi/
acquia_spi.module, line 1093 - Send site profile information (NSPI) and system data to Acquia Insight.
Code
function acquai_spi_get_404s() {
$data = array();
$row = 0;
if (module_exists('dblog')) {
$results = db_query_range('SELECT message, hostname, referer, timestamp FROM {watchdog} WHERE type = "page not found" AND timestamp > UNIX_TIMESTAMP()-3600 AND message NOT IN("UPGRADE.txt", "MAINTAINERS.txt", "README.txt", "INSTALL.pgsql.txt", "INSTALL.txt", "LICENSE.txt", "INSTALL.mysql.txt", "COPYRIGHT.txt", "CHANGELOG.txt") ORDER BY timestamp DESC', 0, 10);
while ($result = db_fetch_array($results)) {
$data[$row]['message'] = $result['message'];
$data[$row]['hostname'] = $result['hostname'];
$data[$row]['referer'] = $result['referer'];
$data[$row]['timestamp'] = $result['timestamp'];
$row++;
}
}
return $data;
}