[Openfirst-cvscommit] base/config first.php,1.33,1.34 dbase.php,1.8,1.9
Brought to you by:
xtimg
From: Tim G. <xt...@us...> - 2004-04-09 20:13:31
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3499 Modified Files: first.php dbase.php Log Message: Begin steps toward adding full support for PEAR Database Abstraction Layer. What needs to be done before full support will exist is dbase.php must actually use PEAR if it's present (ie, mappings have to be updated to accomodate the new PEAR options). As of this commit, PEAR isn't actually used, however, it is checked for, and setup-- but uses the openFIRST mappings, rather than the PEAR DB mappings. Soon someone should add the PEAR logo to the openFIRST site :-) Index: first.php =================================================================== RCS file: /cvsroot/openfirst/base/config/first.php,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** first.php 9 Apr 2004 17:50:46 -0000 1.33 --- first.php 9 Apr 2004 20:00:09 -0000 1.34 *************** *** 67,70 **** --- 67,73 ---- $allowreg='$regenabled=false;'; } + + if(! isset($_POST["peardb"])) { $_POST["peardb"] = false; } + fputs($of, "<?php /* *************** *** 77,80 **** --- 80,84 ---- */ \$dbasetype = \"" . $_POST["dbasetype"] . "\"; + \$peardb = \"" . $_POST["peardb"] . "\"; \$ostype = '" . $_POST["ostype"] . "'; if (\$ostype == \"windows\") { *************** *** 253,262 **** </tr> <tr> ! <td>Database Type</td> ! <td><select name="dbasetype"> <option value="mysql" selected="selected">MySQL</option> <option value="mssql">Microsoft SQL</option> <option value="odbc">ODBC</option> </select> <tr> <td>Title of Website</td> --- 257,298 ---- </tr> <tr> ! <td>Database Type ! <?php ! $fd = explode(";", ini_get('include_path')); ! $peardb = false; ! foreach($fd as $d) { ! if(file_exists($d . "/DB.php")) { ! echo ("<br>The PEAR Database Abstraction layer exists and will be used."); ! $peardb = true; ! } ! } ! ?> ! </td> ! <td><?php if(! $peardb) { ?> ! <input type='hidden' name='peardb' value='false'> ! <select name="dbasetype"> <option value="mysql" selected="selected">MySQL</option> <option value="mssql">Microsoft SQL</option> <option value="odbc">ODBC</option> </select> + + <?php } else { ?> + <input type='hidden' name='peardb' value='true'> + <select name="dbasetype"> + <option value="dbase">dBase (through PEAR DB)</option> + <option value="fbsql">FrontBase (through PEAR DB)</option> + <option value="ibase">InterBase (through PEAR DB)</option> + <option value="ifx">Informix (through PEAR DB)</option> + <option value="msql">Mini SQL (through PEAR DB)</option> + <option value="mssql">Microsoft SQL Server (through PEAR DB)</option> + <option value="mysql">MySQL (for servers running MySQL <= 4.0) (through PEAR DB)</option> + <option value="mysqli">MySQL (for servers running MySQL >= 4.1) (through PEAR DB)</option> + <option value="oci8">Oracle 7/8/9 (through PEAR DB)</option> + <option value="odbc">ODBC (Open Database Connectivity) (through PEAR DB)</option> + <option value="pgsql">PostgreSQL (through PEAR DB)</option> + <option value="sqlite">SQLite (through PEAR DB)</option> + <option value="sybase">Sybase (through PEAR DB)</option> + </select> + <?php } ?> <tr> <td>Title of Website</td> *************** *** 268,272 **** </tr> <tr> ! <td>Database Server Address</td> <td><input type="text" name="sqlserver" value="<?php if(ini_get("mysql.default_host") != "") { --- 304,308 ---- </tr> <tr> ! <td>Database Server Address</td> <td><input type="text" name="sqlserver" value="<?php if(ini_get("mysql.default_host") != "") { Index: dbase.php =================================================================== RCS file: /cvsroot/openfirst/base/config/dbase.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dbase.php 24 Aug 2003 18:51:04 -0000 1.8 --- dbase.php 9 Apr 2004 20:00:10 -0000 1.9 *************** *** 32,39 **** if(isset($dbasetype) == false) { $dbasetype = "mysql"; } // Wrapper for database selection. function ofirst_dbconnect($server = "", $username = "", $password = "", $newlink = "", $intclientflags = "") { ! global $dbasetype; if($dbasetype == "mysql") { if(function_exists("mysql_connect") == false) { --- 32,44 ---- if(isset($dbasetype) == false) { $dbasetype = "mysql"; } + if($peardb) { + // Include the PEAR Database Abstraction Layer + include_once("DB.php"); + } + // Wrapper for database selection. function ofirst_dbconnect($server = "", $username = "", $password = "", $newlink = "", $intclientflags = "") { ! global $dbasetype, $peardb; if($dbasetype == "mysql") { if(function_exists("mysql_connect") == false) { *************** *** 66,70 **** function ofirst_select_db($databasename, $linkidentifier = "") { ! global $dbasetype; if($dbasetype == "mysql") { if(function_exists("mysql_select_db") == false) { --- 71,75 ---- function ofirst_select_db($databasename, $linkidentifier = "") { ! global $dbasetype, $peardb; if($dbasetype == "mysql") { if(function_exists("mysql_select_db") == false) { *************** *** 90,94 **** function ofirst_dberrno($linkidentifier = "") { ! global $dbasetype; if($dbasetype == "mysql") { if(function_exists("mysql_errno") == false) { --- 95,99 ---- function ofirst_dberrno($linkidentifier = "") { ! global $dbasetype, $peardb; if($dbasetype == "mysql") { if(function_exists("mysql_errno") == false) { *************** *** 119,123 **** function ofirst_dberror($linkidentifier = "") { ! global $dbasetype; if($dbasetype == "mysql") { if(function_exists("mysql_error") == false) { --- 124,128 ---- function ofirst_dberror($linkidentifier = "") { ! global $dbasetype, $peardb; if($dbasetype == "mysql") { if(function_exists("mysql_error") == false) { *************** *** 148,152 **** function ofirst_dbquery($string, $linkidentifier = "", $batchsize = "") { ! global $dbasetype; if($dbasetype == "mysql") { if(function_exists("mysql_query") == false) { --- 153,157 ---- function ofirst_dbquery($string, $linkidentifier = "", $batchsize = "") { ! global $dbasetype, $peardb; if($dbasetype == "mysql") { if(function_exists("mysql_query") == false) { *************** *** 180,184 **** function ofirst_dbfetch_object($resource, $rownumber = "") { ! global $dbasetype; if($dbasetype == "mysql") { if(function_exists("mysql_fetch_object") == false) { --- 185,189 ---- function ofirst_dbfetch_object($resource, $rownumber = "") { ! global $dbasetype, $peardb; if($dbasetype == "mysql") { if(function_exists("mysql_fetch_object") == false) { *************** *** 206,210 **** function ofirst_dbnum_rows($resource) { ! global $dbasetype; if($dbasetype == "mysql") { if(function_exists("mysql_num_rows") == false) { --- 211,215 ---- function ofirst_dbnum_rows($resource) { ! global $dbasetype, $peardb; if($dbasetype == "mysql") { if(function_exists("mysql_num_rows") == false) { |