From f06935f594f163f6b3e5f8c24e3b58eba624253f Mon Sep 17 00:00:00 2001 From: soranzo Date: Mon, 15 Jan 2007 15:48:17 +0000 Subject: [PATCH] Incrementally use ->fields for recordsets, ->f is not supported by upstream adodb. --- aggregates.php | 24 ++++++++++++------------ colproperties.php | 34 +++++++++++++++++----------------- constraints.php | 26 +++++++++++++------------- dataexport.php | 18 +++++++++--------- groups.php | 10 +++++----- indexes.php | 16 ++++++++-------- operators.php | 30 +++++++++++++++--------------- privileges.php | 10 +++++----- tablespaces.php | 12 ++++++------ triggers.php | 12 ++++++------ 10 files changed, 96 insertions(+), 96 deletions(-) diff --git a/aggregates.php b/aggregates.php index 575ddfcb..3ee6480f 100644 --- a/aggregates.php +++ b/aggregates.php @@ -3,7 +3,7 @@ /** * Manage aggregates in a database * - * $Id: aggregates.php,v 1.16 2007/01/02 17:24:44 soranzo Exp $ + * $Id: aggregates.php,v 1.17 2007/01/15 15:48:17 soranzo Exp $ */ // Include application functions @@ -150,19 +150,19 @@ // Display aggregate's name, owner and schema echo "\t\n\t\t"; - echo "f['usename']), "\" />"; + echo "fields['usename']), "\" />"; echo "\n\t\n"; echo "\t\n\t\t{$lang['strcomment']}\n"; echo "\t\t\n\t\n"; + htmlspecialchars($aggrdata->fields['aggrcomment']), "\n\t\n"; echo "\n"; echo "

\n"; echo $misc->form; echo "\n"; echo "\n"; - echo "f['usename']), "\" />\n"; + echo "fields['usename']), "\" />\n"; echo "\n"; - echo "f['aggrcomment']), "\" />\n"; + echo "fields['aggrcomment']), "\" />\n"; echo "\n"; echo "

\n"; } else { @@ -232,19 +232,19 @@ echo "\n\t{$lang['straggrbasetype']}\n"; echo "\t", htmlspecialchars($_REQUEST['aggrtype']), "\n\n"; echo "\n\t{$lang['straggrsfunc']}\n"; - echo "\t", htmlspecialchars($aggrdata->f['aggtransfn']), "\n\n"; + echo "\t", htmlspecialchars($aggrdata->fields['aggtransfn']), "\n\n"; echo "\n\t{$lang['straggrstype']}\n"; - echo "\t", htmlspecialchars($aggrdata->f['aggstype']), "\n\n"; + echo "\t", htmlspecialchars($aggrdata->fields['aggstype']), "\n\n"; echo "\n\t{$lang['straggrffunc']}\n"; - echo "\t", htmlspecialchars($aggrdata->f['aggfinalfn']), "\n\n"; + echo "\t", htmlspecialchars($aggrdata->fields['aggfinalfn']), "\n\n"; echo "\n\t{$lang['straggrinitcond']}\n"; - echo "\t", htmlspecialchars($aggrdata->f['agginitval']), "\n\n"; + echo "\t", htmlspecialchars($aggrdata->fields['agginitval']), "\n\n"; echo "\n\t{$lang['straggrsortop']}\n"; - echo "\t", htmlspecialchars($aggrdata->f['aggsortop']), "\n\n"; + echo "\t", htmlspecialchars($aggrdata->fields['aggsortop']), "\n\n"; echo "\n\t{$lang['strowner']}\n"; - echo "\t", htmlspecialchars($aggrdata->f['usename']), "\n\n"; + echo "\t", htmlspecialchars($aggrdata->fields['usename']), "\n\n"; echo "\n\t{$lang['strcomment']}\n"; - echo "\t", $misc->printVal($aggrdata->f['aggrcomment']), "\n\n"; + echo "\t", $misc->printVal($aggrdata->fields['aggrcomment']), "\n\n"; echo "\n"; } else echo "

{$lang['strnodata']}

\n"; diff --git a/colproperties.php b/colproperties.php index 5657f670..383730fc 100644 --- a/colproperties.php +++ b/colproperties.php @@ -50,33 +50,33 @@ echo "{$lang['strnotnull']}{$lang['strdefault']}{$lang['strcomment']}"; $column = $data->getTableAttributes($_REQUEST['table'], $_REQUEST['column']); - $column->f['attnotnull'] = $data->phpBool($column->f['attnotnull']); + $column->fields['attnotnull'] = $data->phpBool($column->fields['attnotnull']); // Upon first drawing the screen, load the existing column information // from the database. if (!isset($_REQUEST['default'])) { - $_REQUEST['field'] = $column->f['attname']; - $_REQUEST['type'] = $column->f['base_type']; + $_REQUEST['field'] = $column->fields['attname']; + $_REQUEST['type'] = $column->fields['base_type']; // Check to see if its' an array type... // XXX: HACKY - if (substr($column->f['base_type'], strlen($column->f['base_type']) - 2) == '[]') { - $_REQUEST['type'] = substr($column->f['base_type'], 0, strlen($column->f['base_type']) - 2); + if (substr($column->fields['base_type'], strlen($column->fields['base_type']) - 2) == '[]') { + $_REQUEST['type'] = substr($column->fields['base_type'], 0, strlen($column->fields['base_type']) - 2); $_REQUEST['array'] = '[]'; } else { - $_REQUEST['type'] = $column->f['base_type']; + $_REQUEST['type'] = $column->fields['base_type']; $_REQUEST['array'] = ''; } // To figure out the length, look in the brackets :( // XXX: HACKY - if ($column->f['type'] != $column->f['base_type'] && ereg('\\(([0-9, ]*)\\)', $column->f['type'], $bits)) { + if ($column->fields['type'] != $column->fields['base_type'] && ereg('\\(([0-9, ]*)\\)', $column->fields['type'], $bits)) { $_REQUEST['length'] = $bits[1]; } else $_REQUEST['length'] = ''; - $_REQUEST['default'] = $_REQUEST['olddefault'] = $column->f['adsrc']; - if ($column->f['attnotnull']) $_REQUEST['notnull'] = 'YES'; - $_REQUEST['comment'] = $column->f['comment']; + $_REQUEST['default'] = $_REQUEST['olddefault'] = $column->fields['adsrc']; + if ($column->fields['attnotnull']) $_REQUEST['notnull'] = 'YES'; + $_REQUEST['comment'] = $column->fields['comment']; } // Column name @@ -96,7 +96,7 @@ $misc->printVal($v), "\n"; } while (!$types->EOF) { - $typname = $types->f['typname']; + $typname = $types->fields['typname']; echo "\n"; $types->moveNext(); @@ -113,7 +113,7 @@ htmlspecialchars($_REQUEST['length']), "\" />"; } else { // Otherwise draw the read-only type name - echo "", $misc->printVal($data->formatType($column->f['type'], $column->f['atttypmod'])), ""; + echo "", $misc->printVal($data->formatType($column->fields['type'], $column->fields['atttypmod'])), ""; } echo "\n"; @@ -129,8 +129,8 @@ echo "\n"; echo "\n"; echo "\n"; - if ($column->f['attnotnull']) echo "\n"; - echo "formatType($column->f['type'], $column->f['atttypmod'])), "\" />\n"; + if ($column->fields['attnotnull']) echo "\n"; + echo "formatType($column->fields['type'], $column->fields['atttypmod'])), "\" />\n"; // Add hidden variables to suppress error notices if we don't support altering column type if (!$data->hasAlterColumnType()) { echo "\n"; @@ -184,7 +184,7 @@ function attPre(&$rowdata) { global $data; - $rowdata->f['+type'] = $data->formatType($rowdata->f['type'], $rowdata->f['atttypmod']); + $rowdata->fields['+type'] = $data->formatType($rowdata->fields['type'], $rowdata->fields['atttypmod']); } if (empty($_REQUEST['column'])) @@ -202,8 +202,8 @@ $attrs = $data->getTableAttributes($tableName, $_REQUEST['column']); // Show comment if any - if ($attrs->f['comment'] !== null) - echo "

", $misc->printVal($attrs->f['comment']), "

\n"; + if ($attrs->fields['comment'] !== null) + echo "

", $misc->printVal($attrs->fields['comment']), "

\n"; $column = array( 'column' => array( diff --git a/constraints.php b/constraints.php index ce117402..fe1d1614 100644 --- a/constraints.php +++ b/constraints.php @@ -3,7 +3,7 @@ /** * List constraints on a table * - * $Id: constraints.php,v 1.43 2006/06/17 12:57:36 xzilla Exp $ + * $Id: constraints.php,v 1.44 2007/01/15 15:48:17 soranzo Exp $ */ // Include application functions @@ -58,7 +58,7 @@ if ($attrs->recordCount() > 0) { while (!$attrs->EOF) { - $selColumns->add(new XHTML_Option($attrs->f['attname'])); + $selColumns->add(new XHTML_Option($attrs->fields['attname'])); $attrs->moveNext(); } } @@ -161,7 +161,7 @@ if ($attrs->recordCount() > 0) { while (!$attrs->EOF) { - $selColumns->add(new XHTML_Option($attrs->f['attname'])); + $selColumns->add(new XHTML_Option($attrs->fields['attname'])); $attrs->moveNext(); } } @@ -190,13 +190,13 @@ echo ""; echo "\n"; @@ -254,7 +254,7 @@ if ($attrs->recordCount() > 0) { while (!$attrs->EOF) { - $selColumns->add(new XHTML_Option($attrs->f['attname'])); + $selColumns->add(new XHTML_Option($attrs->fields['attname'])); $attrs->moveNext(); } } @@ -291,7 +291,7 @@ ($_POST['tablespace'] == '') ? ' selected="selected"' : '', ">\n"; // Display all other tablespaces while (!$tablespaces->EOF) { - $spcname = htmlspecialchars($tablespaces->f['spcname']); + $spcname = htmlspecialchars($tablespaces->fields['spcname']); echo "\t\t\t\t\n"; $tablespaces->moveNext(); @@ -437,11 +437,11 @@ function cnPre(&$rowdata) { global $data, $lang; - if (is_null($rowdata->f['consrc'])) { - $atts = $data->getAttributeNames($_REQUEST['table'], explode(' ', $rowdata->f['indkey'])); - $rowdata->f['+definition'] = ($rowdata->f['contype'] == 'u' ? "UNIQUE (" : "PRIMARY KEY (") . join(',', $atts) . ')'; + if (is_null($rowdata->fields['consrc'])) { + $atts = $data->getAttributeNames($_REQUEST['table'], explode(' ', $rowdata->fields['indkey'])); + $rowdata->fields['+definition'] = ($rowdata->fields['contype'] == 'u' ? "UNIQUE (" : "PRIMARY KEY (") . join(',', $atts) . ')'; } else { - $rowdata->f['+definition'] = $rowdata->f['consrc']; + $rowdata->fields['+definition'] = $rowdata->fields['consrc']; } } diff --git a/dataexport.php b/dataexport.php index e330edcb..14e2ceab 100644 --- a/dataexport.php +++ b/dataexport.php @@ -4,7 +4,7 @@ * Does an export to the screen or as a download. This checks to * see if they have pg_dump set up, and will use it if possible. * - * $Id: dataexport.php,v 1.23 2006/06/17 12:57:36 xzilla Exp $ + * $Id: dataexport.php,v 1.24 2007/01/15 15:48:17 soranzo Exp $ */ $extensions = array( @@ -124,7 +124,7 @@ echo " FROM stdin;\n"; while (!$rs->EOF) { $first = true; - while(list($k, $v) = each($rs->f)) { + while(list($k, $v) = each($rs->fields)) { // Escape value $v = $data->escapeBytea($v); @@ -154,7 +154,7 @@ if (!$rs->EOF) { // Output header row $j = 0; - foreach ($rs->f as $k => $v) { + foreach ($rs->fields as $k => $v) { $finfo = $rs->fetchField($j++); if ($finfo->name == $data->id && !$oids) continue; echo "\t\t", $misc->printVal($finfo->name, true), "\r\n"; @@ -164,7 +164,7 @@ while (!$rs->EOF) { echo "\t\r\n"; $j = 0; - foreach ($rs->f as $k => $v) { + foreach ($rs->fields as $k => $v) { $finfo = $rs->fetchField($j++); if ($finfo->name == $data->id && !$oids) continue; echo "\t\t", $misc->printVal($v, true, $finfo->type), "\r\n"; @@ -186,7 +186,7 @@ // Output header row $j = 0; echo "\t
\n"; - foreach ($rs->f as $k => $v) { + foreach ($rs->fields as $k => $v) { $finfo = $rs->fetchField($j++); $name = htmlspecialchars($finfo->name); $type = htmlspecialchars($finfo->type); @@ -198,7 +198,7 @@ while (!$rs->EOF) { $j = 0; echo "\t\t\n"; - foreach ($rs->f as $k => $v) { + foreach ($rs->fields as $k => $v) { $finfo = $rs->fetchField($j++); $name = htmlspecialchars($finfo->name); if ($v != null) $v = htmlspecialchars($v); @@ -216,7 +216,7 @@ echo "INSERT INTO \"{$_REQUEST['table']}\" ("; $first = true; $j = 0; - foreach ($rs->f as $k => $v) { + foreach ($rs->fields as $k => $v) { $finfo = $rs->fetchField($j++); $k = $finfo->name; // SQL (INSERT) format cannot handle oids @@ -259,7 +259,7 @@ if (!$rs->EOF) { // Output header row $first = true; - foreach ($rs->f as $k => $v) { + foreach ($rs->fields as $k => $v) { $finfo = $rs->fetchField($k); $v = $finfo->name; if ($v != null) $v = str_replace('"', '""', $v); @@ -273,7 +273,7 @@ } while (!$rs->EOF) { $first = true; - foreach ($rs->f as $k => $v) { + foreach ($rs->fields as $k => $v) { if ($v != null) $v = str_replace('"', '""', $v); if ($first) { echo ($v == null) ? "\"\\N\"" : "\"{$v}\""; diff --git a/groups.php b/groups.php index 0a97cf56..fba7ea2a 100644 --- a/groups.php +++ b/groups.php @@ -3,7 +3,7 @@ /** * Manage groups in a database cluster * - * $Id: groups.php,v 1.21 2005/10/18 03:45:16 chriskl Exp $ + * $Id: groups.php,v 1.22 2007/01/15 15:48:17 soranzo Exp $ */ // Include application functions @@ -80,9 +80,9 @@ $i = 0; while (!$groupdata->EOF) { $id = (($i % 2) == 0 ? '1' : '2'); - echo "", $misc->printVal($groupdata->f['usename']), "\n"; + echo "", $misc->printVal($groupdata->fields['usename']), "\n"; echo "href}&group=", - urlencode($_REQUEST['group']), "&user=", urlencode($groupdata->f['usename']), "\">{$lang['strdrop']}\n"; + urlencode($_REQUEST['group']), "&user=", urlencode($groupdata->fields['usename']), "\">{$lang['strdrop']}\n"; echo "\n"; $groupdata->moveNext(); } @@ -94,7 +94,7 @@ echo "
\n"; echo "recordCount()), "\">\n"; while (!$users->EOF) { - $username = $users->f['usename']; + $username = $users->fields['usename']; echo "\t\t\t\t\n"; $users->moveNext(); diff --git a/indexes.php b/indexes.php index 67f994a5..da3aa474 100644 --- a/indexes.php +++ b/indexes.php @@ -3,7 +3,7 @@ /** * List indexes on a table * - * $Id: indexes.php,v 1.38 2006/06/17 12:57:36 xzilla Exp $ + * $Id: indexes.php,v 1.39 2007/01/15 15:48:17 soranzo Exp $ */ // Include application functions @@ -92,7 +92,7 @@ if ($attrs->recordCount() > 0) { while (!$attrs->EOF) { - $selColumns->add(new XHTML_Option($attrs->f['attname'])); + $selColumns->add(new XHTML_Option($attrs->fields['attname'])); $attrs->moveNext(); } } @@ -154,7 +154,7 @@ ($_POST['formSpc'] == '') ? ' selected="selected"' : '', ">\n"; // Display all other tablespaces while (!$tablespaces->EOF) { - $spcname = htmlspecialchars($tablespaces->f['spcname']); + $spcname = htmlspecialchars($tablespaces->fields['spcname']); echo "\t\t\t\t\n"; $tablespaces->moveNext(); @@ -241,16 +241,16 @@ function indPre(&$rowdata, $actions) { global $data, $lang; - if ($data->phpBool($rowdata->f['indisprimary'])) { - $rowdata->f['+constraints'] = $lang['strprimarykey']; + if ($data->phpBool($rowdata->fields['indisprimary'])) { + $rowdata->fields['+constraints'] = $lang['strprimarykey']; $actions['drop']['disable'] = true; } - elseif ($data->phpBool($rowdata->f['indisunique'])) { - $rowdata->f['+constraints'] = $lang['struniquekey']; + elseif ($data->phpBool($rowdata->fields['indisunique'])) { + $rowdata->fields['+constraints'] = $lang['struniquekey']; $actions['drop']['disable'] = true; } else - $rowdata->f['+constraints'] = ''; + $rowdata->fields['+constraints'] = ''; return $actions; } diff --git a/operators.php b/operators.php index 70c43b77..91bd609a 100644 --- a/operators.php +++ b/operators.php @@ -3,7 +3,7 @@ /** * Manage operators in a database * - * $Id: operators.php,v 1.22 2006/06/17 12:57:36 xzilla Exp $ + * $Id: operators.php,v 1.23 2007/01/15 15:48:17 soranzo Exp $ */ // Include application functions @@ -25,36 +25,36 @@ $misc->printMsg($msg); $oprdata = $data->getOperator($_REQUEST['operator_oid']); - $oprdata->f['oprcanhash'] = $data->phpBool($oprdata->f['oprcanhash']); + $oprdata->fields['oprcanhash'] = $data->phpBool($oprdata->fields['oprcanhash']); if ($oprdata->recordCount() > 0) { echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "
{$lang['strname']}", $misc->printVal($oprdata->f['oprname']), "
", $misc->printVal($oprdata->fields['oprname']), "
{$lang['strleftarg']}", $misc->printVal($oprdata->f['oprleftname']), "
", $misc->printVal($oprdata->fields['oprleftname']), "
{$lang['strrightarg']}", $misc->printVal($oprdata->f['oprrightname']), "
", $misc->printVal($oprdata->fields['oprrightname']), "
{$lang['strcommutator']}", $misc->printVal($oprdata->f['oprcom']), "
", $misc->printVal($oprdata->fields['oprcom']), "
{$lang['strnegator']}", $misc->printVal($oprdata->f['oprnegate']), "
", $misc->printVal($oprdata->fields['oprnegate']), "
{$lang['strjoin']}", $misc->printVal($oprdata->f['oprjoin']), "
", $misc->printVal($oprdata->fields['oprjoin']), "
{$lang['strhashes']}", ($oprdata->f['oprcanhash']) ? $lang['stryes'] : $lang['strno'], "
", ($oprdata->fields['oprcanhash']) ? $lang['stryes'] : $lang['strno'], "
{$lang['strmerges']}", ($oprdata->f['oprlsortop'] !== '0' && $oprdata->f['oprrsortop'] !== '0') ? $lang['stryes'] : $lang['strno'], "
", ($oprdata->fields['oprlsortop'] !== '0' && $oprdata->fields['oprrsortop'] !== '0') ? $lang['stryes'] : $lang['strno'], "
{$lang['strrestrict']}", $misc->printVal($oprdata->f['oprrest']), "
", $misc->printVal($oprdata->fields['oprrest']), "
{$lang['strleftsort']}", $misc->printVal($oprdata->f['oprlsortop']), "
", $misc->printVal($oprdata->fields['oprlsortop']), "
{$lang['strrightsort']}", $misc->printVal($oprdata->f['oprrsortop']), "
", $misc->printVal($oprdata->fields['oprrsortop']), "
{$lang['strlessthan']}", $misc->printVal($oprdata->f['oprltcmpop']), "
", $misc->printVal($oprdata->fields['oprltcmpop']), "
{$lang['strgreaterthan']}", $misc->printVal($oprdata->f['oprgtcmpop']), "
", $misc->printVal($oprdata->fields['oprgtcmpop']), "
\n"; echo "

href}\">{$lang['strshowalloperators']}

\n"; diff --git a/privileges.php b/privileges.php index f019a2cf..b60a6333 100644 --- a/privileges.php +++ b/privileges.php @@ -3,7 +3,7 @@ /** * Manage privileges in a database * - * $Id: privileges.php,v 1.39 2006/06/17 12:57:36 xzilla Exp $ + * $Id: privileges.php,v 1.40 2007/01/15 15:48:17 soranzo Exp $ */ // Include application functions @@ -50,9 +50,9 @@ echo "{$lang['strusers']}\n"; echo "\n"; @@ -63,9 +63,9 @@ if ($groups->recordCount() > 0) { echo "
\n"; diff --git a/tablespaces.php b/tablespaces.php index 1a7fb37a..cdade039 100755 --- a/tablespaces.php +++ b/tablespaces.php @@ -3,7 +3,7 @@ /** * Manage tablespaces in a database cluster * - * $Id: tablespaces.php,v 1.11 2007/01/02 17:24:44 soranzo Exp $ + * $Id: tablespaces.php,v 1.12 2007/01/15 15:48:17 soranzo Exp $ */ // Include application functions @@ -31,10 +31,10 @@ if ($tablespace->recordCount() > 0) { - if (!isset($_POST['name'])) $_POST['name'] = $tablespace->f['spcname']; - if (!isset($_POST['owner'])) $_POST['owner'] = $tablespace->f['spcowner']; + if (!isset($_POST['name'])) $_POST['name'] = $tablespace->fields['spcname']; + if (!isset($_POST['owner'])) $_POST['owner'] = $tablespace->fields['spcowner']; if (!isset($_POST['comment'])) { - $_POST['comment'] = ($data->hasSharedComments()) ? $tablespace->f['spccomment'] : ''; + $_POST['comment'] = ($data->hasSharedComments()) ? $tablespace->fields['spccomment'] : ''; } echo "\n"; @@ -47,7 +47,7 @@ echo "{$lang['strowner']}\n"; echo "\n"; while (!$users->EOF) { - $uname = $users->f['usename']; + $uname = $users->fields['usename']; echo "\t\t\t\n"; $users->moveNext(); diff --git a/triggers.php b/triggers.php index 38c88f8b..47f3686b 100644 --- a/triggers.php +++ b/triggers.php @@ -3,7 +3,7 @@ /** * List triggers on a table * - * $Id: triggers.php,v 1.30 2006/08/13 15:31:13 xzilla Exp $ + * $Id: triggers.php,v 1.31 2007/01/15 15:48:17 soranzo Exp $ */ // Include application functions @@ -41,7 +41,7 @@ if ($triggerdata->recordCount() > 0) { - if (!isset($_POST['name'])) $_POST['name'] = $triggerdata->f['tgname']; + if (!isset($_POST['name'])) $_POST['name'] = $triggerdata->fields['tgname']; echo "\n"; echo "\n"; @@ -185,7 +185,7 @@ /* Populate functions */ $sel0 = new XHTML_Select('formFunction'); while (!$funcs->EOF) { - $sel0->add(new XHTML_Option($funcs->f['proname'])); + $sel0->add(new XHTML_Option($funcs->fields['proname'])); $funcs->moveNext(); } @@ -269,9 +269,9 @@ function tgPre(&$rowdata) { global $data, $lang; // Nasty hack to support pre-7.4 PostgreSQL - $rowdata->f['+tgdef'] = $rowdata->f['tgdef'] !== null - ? $rowdata->f['tgdef'] - : $data->getTriggerDef($rowdata->f); + $rowdata->fields['+tgdef'] = $rowdata->fields['tgdef'] !== null + ? $rowdata->fields['tgdef'] + : $data->getTriggerDef($rowdata->fields); } $misc->printTrail('table'); -- 2.39.5