cvs: docweb /scripts grab_livedocs_db.php

[email protected] ("Nuno Lopes")
Newsgroups php.doc.web
Message-ID <cvsnlopess1106678001@cvsserver>
nlopess		Tue Jan 25 13:33:21 2005 EDT

  Modified files:              
    /docweb/scripts	grab_livedocs_db.php 
  Log:
  life is simpler... :)
  
http://cvs.php.net/diff.php/docweb/scripts/grab_livedocs_db.php?r1=1.1&r2=1.2&ty=u
Index: docweb/scripts/grab_livedocs_db.php
diff -u docweb/scripts/grab_livedocs_db.php:1.1 docweb/scripts/grab_livedocs_db.php:1.2
--- docweb/scripts/grab_livedocs_db.php:1.1	Tue Jan 25 00:42:49 2005
+++ docweb/scripts/grab_livedocs_db.php	Tue Jan 25 13:33:21 2005
@@ -15,7 +15,7 @@
 +----------------------------------------------------------------------+
 | Authors: Sean Coates <[email protected]>                                  |
 +----------------------------------------------------------------------+
-$Id: grab_livedocs_db.php,v 1.1 2005/01/25 05:42:49 sean Exp $
+$Id: grab_livedocs_db.php,v 1.2 2005/01/25 18:33:21 nlopess Exp $
 */
 
 /* Note: If someone has a more efficient way of doing this,
@@ -32,25 +32,7 @@
 
 echo "Grabbing livedocs DB...\n";
 
-// open local file
-if (!$fw = @fopen(ENTITY_SQLITE_FILE, 'w')) {
-    die("Error opening local file: " . ENTITY_SQLITE_FILE ."\n");
-}
-
-// open remote livedocs DB file
-if (!$fr = @fopen(REMOTE_ENTITY_SQLITE_FILE, 'r')) {
-    die("Error opening remote file: " . REMOTE_ENTITY_SQLITE_FILE ."\n");
-}
-
-$bytesRead = 0;
-$chunkSize = 32 * 1024; // read (up to) 32k chunks
-while ($d = fread($fr, $chunkSize)) {
-    $bytesRead += strlen($d);
-    fwrite($fw, $d);
-}
-
-fclose($fw);
-fclose($fr);
+copy(REMOTE_ENTITY_SQLITE_FILE, ENTITY_SQLITE_FILE); 
 
 $scriptTime = time() - $scriptBegin;
 $bytesSec = number_format(round($bytesRead / $scriptTime));
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.