diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-04-20 20:02:31 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-04-20 20:02:31 +0000 |
commit | f09028107ca18a8f897ff517d2ed04688e1c567d (patch) | |
tree | 1f6cff867077daac6dbdd9a78967679cadef1b8c /includes/database/pgsql | |
parent | 10931908b5885741be806ff15586770691801e51 (diff) | |
download | brdo-f09028107ca18a8f897ff517d2ed04688e1c567d.tar.gz brdo-f09028107ca18a8f897ff517d2ed04688e1c567d.tar.bz2 |
- Patch #413732 by brianV: database code clean-up.
Diffstat (limited to 'includes/database/pgsql')
-rw-r--r-- | includes/database/pgsql/database.inc | 2 | ||||
-rw-r--r-- | includes/database/pgsql/install.inc | 6 | ||||
-rw-r--r-- | includes/database/pgsql/query.inc | 10 | ||||
-rw-r--r-- | includes/database/pgsql/schema.inc | 10 |
4 files changed, 21 insertions, 7 deletions
diff --git a/includes/database/pgsql/database.inc b/includes/database/pgsql/database.inc index c9dd63a06..881ea3d97 100644 --- a/includes/database/pgsql/database.inc +++ b/includes/database/pgsql/database.inc @@ -72,7 +72,7 @@ class DatabaseConnection_pgsql extends DatabaseConnection { else { $query_string = $query; } - throw new PDOException($query_string . " - \n" . print_r($args,1) . $e->getMessage()); + throw new PDOException($query_string . " - \n" . print_r($args, 1) . $e->getMessage()); } return NULL; } diff --git a/includes/database/pgsql/install.inc b/includes/database/pgsql/install.inc index 921e21402..b301cb672 100644 --- a/includes/database/pgsql/install.inc +++ b/includes/database/pgsql/install.inc @@ -1,6 +1,12 @@ <?php // $Id$ +/** + * @file + * Install functions for PostgreSQL embedded database engine. + */ + + // PostgreSQL specific install functions class DatabaseInstaller_pgsql extends DatabaseInstaller { diff --git a/includes/database/pgsql/query.inc b/includes/database/pgsql/query.inc index a0f97b1b4..f3a4932ea 100644 --- a/includes/database/pgsql/query.inc +++ b/includes/database/pgsql/query.inc @@ -6,6 +6,12 @@ * @{ */ +/** + * @file + * Query code for PostgreSQL embedded database engine. + */ + + class InsertQuery_pgsql extends InsertQuery { public function __construct($connection, $table, array $options = array()) { @@ -51,7 +57,7 @@ class InsertQuery_pgsql extends InsertQuery { ++$blob_count; } else { - $stmt->bindParam(':db_insert_placeholder_'. $max_placeholder++, $insert_values[$idx]); + $stmt->bindParam(':db_insert_placeholder_' . $max_placeholder++, $insert_values[$idx]); } } } @@ -101,7 +107,7 @@ class InsertQuery_pgsql extends InsertQuery { else { // If there are no values, then this is a default-only query. We still need to handle that. $placeholders = array_fill(0, count($this->defaultFields), 'default'); - $values[] = '(' . implode(', ', $placeholders) .')'; + $values[] = '(' . implode(', ', $placeholders) . ')'; } $query .= implode(', ', $values); diff --git a/includes/database/pgsql/schema.inc b/includes/database/pgsql/schema.inc index c4dda4c03..08b04b938 100644 --- a/includes/database/pgsql/schema.inc +++ b/includes/database/pgsql/schema.inc @@ -19,7 +19,7 @@ class DatabaseSchema_pgsql extends DatabaseSchema { * This is collected by DatabaseConnection_pgsql->queryTableInformation(), * by introspecting the database. * - * @see DatabaseConnection_pgsql->queryTableInformation(). + * @see DatabaseConnection_pgsql->queryTableInformation() * @var array */ protected $tableInformation = array(); @@ -46,7 +46,7 @@ class DatabaseSchema_pgsql extends DatabaseSchema { if (!isset($this->tableInformation[$key])) { // Split the key into schema and table for querying. - list($schema,$table_name) = explode('.', $key); + list($schema, $table_name) = explode('.', $key); $table_information = (object) array( 'blob_fields' => array(), 'sequences' => array(), @@ -56,7 +56,7 @@ class DatabaseSchema_pgsql extends DatabaseSchema { if ($column->data_type == 'bytea') { $table_information->blob_fields[$column->column_name] = TRUE; } - else if (preg_match("/nextval\('([^']+)'/", $column->column_default, $matches)) { + elseif (preg_match("/nextval\('([^']+)'/", $column->column_default, $matches)) { // We must know of any sequences in the table structure to help us // return the last insert id. If there is more than 1 sequences the // first one (index 0 of the sequences array) will be used. @@ -311,8 +311,10 @@ class DatabaseSchema_pgsql extends DatabaseSchema { * table along with adding the field. The format is the same as a * table specification but without the 'fields' element. If you are * adding a type 'serial' field, you MUST specify at least one key - * or index including it in this array. @see db_change_field for more + * or index including it in this array. See db_change_field() for more * explanation why. + * + * @see db_change_field() */ public function addField(&$ret, $table, $field, $spec, $new_keys = array()) { $fixnull = FALSE; |