Changeset 1347 for trunk/bin/stat_conso.php
- Timestamp:
- 12/15/04 04:17:00 (8 years ago)
- File:
-
- 1 edited
-
trunk/bin/stat_conso.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/stat_conso.php
r1345 r1347 1 1 #!/usr/bin/php4 -q 2 2 <?php 3 @set_time_limit(0); 4 5 include("/var/alternc/bureau/class/config_nochk.php"); 6 7 // Libère le bureau ! 8 alternc_shutdown(); 3 9 4 10 // Ce script lit un fichier de log apache et insère les statistiques de visite par jour et par domaine / sous-domaine dans la table stat_http. … … 18 24 echo "################################################\n"; 19 25 20 21 22 // Ne pas toucher ci-dessous.23 24 @set_time_limit(0);25 26 include("/var/alternc/bureau/class/config_nochk.php");27 28 // Libère le bureau !29 alternc_shutdown();30 26 31 27 if (substr($apache,-3)==".gz") { … … 54 50 while ($s=$gets($f,2048)) { 55 51 $s=trim($s); 56 if ( ereg('^[^ ]* [^ ]* [^ ]* \\[([0-9]*)/([a-zA-Z]*)/([0-9]*):[0-9]*:[0-9]*:[0-9]* [^ ]* "[^"]*" ([0-9-]*) ([0-9-]*) "[^"]*" "[^"]*" [0-9]* ([^ ]*)$',$s,$mat)) {52 if (preg_match('/^[^ ]* [^ ]* [^ ]* \\[([0-9]*)\\/([a-zA-Z]*)\\/([0-9]*):[0-9]*:[0-9]*:[0-9]* [^ ]* "[^"]*" ([0-9-]*) ([0-9-]*) "[^"]*" "[^"]*" [0-9]* ([^ ]*)$/',$s,$mat)) { 57 53 // ok, 1: jour 2: mois (english) 3: année 4: http result (200/404 ...) 5: taille 6: domaine 58 54 // Ligne ok. … … 77 73 $update=0; $insert=0; 78 74 foreach($domstat as $key => $val) { 79 ereg("^([^/]*)/(.*)$",$key,$mat);75 preg_match("/^([^\\/]*)\\/(.*)$/",$key,$mat); 80 76 $mat[1]=strtolower($mat[1]); 81 77 // on cherche l'uid de ce domaine … … 104 100 $update=0; $insert=0; 105 101 foreach($domstat as $key => $val) { 106 ereg("^([^/]*)/(.*)$",$key,$mat);102 preg_match("/^([^\\/]*)\\/(.*)$/",$key,$mat); 107 103 $mat[1]=strtolower($mat[1]); 108 104 // on cherche l'uid de ce domaine
Note: See TracChangeset
for help on using the changeset viewer.
