RE: [PHP-DEV] Rsync and CVS

From: Date: Tue, 06 Mar 2001 20:34:36 +0000
Subject: RE: [PHP-DEV] Rsync and CVS
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-48090@lists.php.net to get a copy of this message
Jim, >right now, there's a mix of entries in the notes database marked >using the page title and the page id. the ones identified only by >title need to get fixed in the database. Out of interest, why did we change to using the page id? >but mainly 'getting it into the rsync repository' was what was on >my to-do list. Cool. > (if you're talking about commiting the get-user-notes code, it's > already there. it needs work, but it is a good start.) Yeah, I wrote it as a stopgap before all this rsync stuff was up and working. My local version works much nicer, but I didn't want to commit it until we had rsync (a far better way than fetching notes from http://www.php.net/get-user-notes.php). Once that's done, we can write the usernotes from cron, and install the following code into shared-manual.inc Sounds simple? :) Simon function manualGetUserNotesDb($title, $id) { $host = 'localhost'; $user = 'nobody'; $pass = ''; $db_id = mysql_connect($host, $user, $pass); $query = "SELECT *,UNIX_TIMESTAMP(ts) AS xwhen FROM note WHERE sect = '$title' OR sect = '$id' ORDER BY id"; $result_id = mysql_db_query("php3", $query, $db_id); $notes = array(); if ($result_id && mysql_num_rows($result_id) > 0) { while ($row = mysql_fetch_array($result_id)) { $notes[] = $row; } } return $notes; } function manualGetUserNotesCache($sect) { global $DOCUMENT_ROOT; $cachefile = "$DOCUMENT_ROOT/manual/usernotes/" . urlencode($sect) . ".txt"; if ($fh = @fopen($cachefile,'r')) { $notes = @unserialize(fread($fh,10000000)); fclose($fh); } else { $notes = array(); } return $notes; } function manualUserNotes($title, $id) { ... if(strstr($MYSITE,"www.php.net")) { $notes = manualGetUserNotesDb($title, $id); } else { $notes = array_merge( manualGetUserNotesCache($title), manualGetUserNotesCache($id) ); } ... }

« previous php.dev (#48090) next »