cvs: php-master-web /scripts ip-to-country update-backend

From: Date: Thu, 01 May 2003 16:04:51 +0000
Subject: cvs: php-master-web /scripts ip-to-country update-backend
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-17189@lists.php.net to get a copy of this message
goba Thu May 1 12:04:51 2003 EDT Added files: /php-master-web/scripts ip-to-country Modified files: /php-master-web/scripts update-backend Log: Move ip-to-country code into its own file, now with indexing added The indexing stuff can be moved to the rename() if section, as it only need to run if there is a new file (but now there is no index to leave there, so the indexing code will always run) Index: php-master-web/scripts/update-backend diff -u php-master-web/scripts/update-backend:1.11 php-master-web/scripts/update-backend:1.12 --- php-master-web/scripts/update-backend:1.11 Thu May 1 10:07:49 2003 +++ php-master-web/scripts/update-backend Thu May 1 12:04:51 2003 @@ -27,23 +27,10 @@ fetch_into_file("http://master.php.net/fetch/events.php?nm=3&token=$token", "$root/backend/events.csv"); -// Get last modified date of ip-to-country data -$ipdbt = "ip-to-country.db~"; -$ipdb = "$root/backend/ip-to-country.db"; -if (file_exists($ipdb)) { $lastmod = filemtime($ipdb); } -else { $lastmod = 0; } - -// Fetch data from server to local temporary file -fetch_into_file("http://www.directi.com/iptocountry/?site=php.net&dbformat=1&lastupdate=" . $lastmod, - $ipdbt); - -// If the file contains more then a 'no updates' message, -// then we expect it to be real ip-to-country data, and -// move the file to the right place -if (@filesize($ipdbt) > strlen("no updates")) { - rename($ipdbt, $ipdb); -} else { unlink($ipdbt); } - +// Run ip-to-country fetch code +include "ip-to-country"; +fetch_ip_to_country(); + // Create RSS news feed file $dest = fopen("$root/news.rss", "w"); if (!$dest) { echo "failed to open $root/news.rss for writing"; }

« previous php.mirrors (#17189) next »