svn: /web/php/trunk/ error.php track_ref.php
| From: | Rasmus Lerdorf | Date: | Tue, 19 Jul 2011 05:28:36 +0000 |
| Subject: | svn: /web/php/trunk/ error.php track_ref.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-11697@lists.php.net to get a copy of this message | ||
rasmus Tue, 19 Jul 2011 05:28:36 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=313413
Log:
track refs to bad distribution links from all mirrors
Changed paths:
U web/php/trunk/error.php
A web/php/trunk/track_ref.php
Modified: web/php/trunk/error.php
===================================================================
--- web/php/trunk/error.php 2011-07-19 05:02:19 UTC (rev 313412)
+++ web/php/trunk/error.php 2011-07-19 05:28:36 UTC (rev 313413)
@@ -121,9 +121,9 @@
// If someone is looking for something in distributions/* and it isn't there,
// send them to the /releases page since that is likely to be most helpful.
if (preg_match("!^distributions/.*!", $URI, $array)) {
- // Debug: Logging referrers on www.php.net temporarily
- if($_SERVER['SERVER_NAME']=='www.php.net' &&
!empty($_SERVER['HTTP_REFERER'])) {
- file_put_contents("/var/tmp/refer.txt","$URI from
{$_SERVER['HTTP_REFERER']}\n",FILE_APPEND);
+ // Debug: Logging referrers to www.php.net temporarily
+ if(!empty($_SERVER['HTTP_REFERER'])) {
+ echo file_get_contents("http://www.php.net/track_ref.php?url=".$_SERVER['SERVER_NAME'].'/'.urlencode($URI).'&ref='.urlencode($_SERVER['HTTP_REFERER']));
}
mirror_redirect("/releases/");
}
Added: web/php/trunk/track_ref.php
===================================================================
--- web/php/trunk/track_ref.php (rev 0)
+++ web/php/trunk/track_ref.php 2011-07-19 05:28:36 UTC (rev 313413)
@@ -0,0 +1,7 @@
+<?php
+if(!empty($_GET['ref']) && !empty($_GET['url'])) {
+ file_put_contents("/var/tmp/refer.txt","{$_GET['url']} from
{$_GET['ref']}\n",FILE_APPEND);
+ echo "OK";
+}
+?>
+KO