- Simplified regexps to work with EPrints 3.
1 parent ffeaf31 commit 0f55f7d9fbb7ac9c7a9a31915d5e6a17597cfe81
nstanger authored on 24 Jul 2007
Showing 1 changed file
View
4
Repositories/statistics/scripts/eprints-usage_src.php
Plus any of the above with a domain name substituted for the IP
address (e.g., foo.bar.com instead of 168.192.1.1).
*/
if (preg_match("/^(\S+(?:\.\S+)+) - - \[(.*?)\] \"GET \/(?:archive\/0{1,8})?(\d{1,4}).*? HTTP\/1..\" 200 .*?(\"[^\"]+\")?$/i",$buffer,$matches))
if (preg_match("/^(\S+(?:\.\S+)+) - - \[(.*?)\] \"GET \/(?:archive\/0+)?(\d+).*? HTTP\/1..\" 200 .*?(\"[^\"]+\")?$/i",$buffer,$matches))
{
$counter++;
$country_code = '';
$country_name = '';
$uniquebits = $buffer;
// NJS 2005-11-25 Added regexp for EPrints short URLs.
// NJS 2007-01-31 Refactored into one regexp for both styles.
if (preg_match("/GET \/(?:archive\/0{1,8})?\d{1,4}\/\d\d\//i",$buffer)) {
if (preg_match("/GET \/(?:archive\/0+)?\d+\/\d+\//i",$buffer)) {
$view_type = "download";
} else {
$view_type = "abstract";
}