From: Steve W. <wai...@us...> - 2000-12-12 21:53:23
|
Update of /cvsroot/phpwiki/phpwiki In directory slayer.i.sourceforge.net:/tmp/cvs-serv9329 Modified Files: DBLIB.txt Log Message: Updated against the mysql.php file. This should be accurate and finished for 1.2. Index: DBLIB.txt =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/DBLIB.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** DBLIB.txt 2000/10/21 04:14:02 1.7 --- DBLIB.txt 2000/12/12 21:53:20 1.8 *************** *** 7,12 **** * While most functions specify a "db reference" as the first value passed in, this can be any kind of data type that your functions ! know about. For example, in the DBM implementation this is an ! integer that refers to an open database handle, but in the MySQL version it's an associative array that contains the DB information. --- 7,12 ---- * While most functions specify a "db reference" as the first value passed in, this can be any kind of data type that your functions ! know about. For example, in the DBM implementation this is a hash of ! integers that refer to open database files, but in the MySQL version it's an associative array that contains the DB information. *************** *** 46,51 **** ! RetrievePage($dbi, $pagename) ! takes: db reference, string which is the name of a page returns: a PHP associative array containing the page data (text, version, author, etc) --- 46,63 ---- ! MakeDBHash($pagename, $pagehash) ! takes: page name, page array ! returns: an encoded version of the $pagehash suitable for ! insertion into the data store. This is an internal helper ! function used mainly for the RDBMSs. ! ! MakePageHash($dbhash) ! takes: an array that came from the database ! returns: the $pagehash data structure used by the ! application. This function undoes what MakeDBHash does. ! ! RetrievePage($dbi, $pagename, $pagestore) ! takes: db reference, string which is the name of a page, and a ! string indicating which store to fetch the page from (live or archive). returns: a PHP associative array containing the page data (text, version, author, etc) *************** *** 57,65 **** returns: nothing (hmm. It should probably return true/false) IsWikiPage($dbi, $pagename) takes: db reference, string containing page name ! returns: true or false, if the page already exists InitTitleSearch($dbi, $search) --- 69,86 ---- returns: nothing (hmm. It should probably return true/false) + SaveCopyToArchive($dbi, $pagename, $pagehash) + Similar to InsertPage but for handling the archive store. The + goal here was to separate the two (live db and archive db) in + case there were different storage formats (for example, the + archive might only store diffs of the pages). However this is + not the case in the implementations. IsWikiPage($dbi, $pagename) takes: db reference, string containing page name ! returns: true or false, if the page already exists in the live db. + IsInArchive($dbi, $pagename) + takes: db reference, string containing page name + returns: true or false, if the page already exists in the archive. InitTitleSearch($dbi, $search) *************** *** 68,71 **** --- 89,96 ---- within the result set. + RemovePage($dbi, $pagename) + takes: db reference, name of the page + returns: nothing + This deletes a page from both the live and archive page stores. TitleSearchNextMatch($dbi, &$pos) *************** *** 75,78 **** --- 100,106 ---- (advances $pos to next result field as well) + MakeSQLSearchClause($search, $column) + takes: a search string, column name + returns: a SQL query string suitable for a database query InitFullSearch($dbi, $search) *************** *** 113,118 **** --- 141,159 ---- GetAllWikiPageNames($dbi) + takes: db reference + returns: an array containing all page names + GetWikiPageLinks($dbi, $pagename) + takes: db reference, page name + returns: a two-dimensional array containing outbound links + ordered by score desc ('out'); inbound links ordered by score + desc ('in'); inbound or outbound links ordered by most number of + page views ('popular'). + SetWikiPageLinks($dbi, $pagename, $linklist) + takes: db reference, page name, list of pages linking to this + one + This deletes the existing list of linking pages and inserts all + the page names in $linklist. $Id$ |