cvs: pear /MDB2/MDB2/Driver/Manager fbsql.php

From: Date: Sat, 29 Oct 2005 11:17:36 +0000
Subject: cvs: pear /MDB2/MDB2/Driver/Manager fbsql.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-35945@lists.php.net to get a copy of this message
lsmith Sat Oct 29 07:17:36 2005 EDT Modified files: /pear/MDB2/MDB2/Driver/Manager fbsql.php Log: - use common implementation of create index http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Manager/fbsql.php?r1=1.42&r2=1.43&ty=u Index: pear/MDB2/MDB2/Driver/Manager/fbsql.php diff -u pear/MDB2/MDB2/Driver/Manager/fbsql.php:1.42 pear/MDB2/MDB2/Driver/Manager/fbsql.php:1.43 --- pear/MDB2/MDB2/Driver/Manager/fbsql.php:1.42 Sun Oct 16 17:47:55 2005 +++ pear/MDB2/MDB2/Driver/Manager/fbsql.php Sat Oct 29 07:17:32 2005 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: fbsql.php,v 1.42 2005/10/16 21:47:55 lsmith Exp $ +// $Id: fbsql.php,v 1.43 2005/10/29 11:17:32 lsmith Exp $ // require_once 'MDB2/Driver/Manager/Common.php'; @@ -405,59 +405,6 @@ } // }}} - // {{{ createIndex() - - /** - * get the stucture of a field into an array - * - * @param string $table name of the table on which the index is to be created - * @param string $name name of the index to be created - * @param array $definition associative array that defines properties of the index to be created. - * Currently, only one property named FIELDS is supported. This property - * is also an associative with the names of the index fields as array - * indexes. Each entry of this array is set to another type of associative - * array that specifies properties of the index that are specific to - * each field. - * - * Currently, only the sorting property is supported. It should be used - * to define the sorting direction of the index. It may be set to either - * ascending or descending. - * - * Not all DBMS support index sorting direction configuration. The DBMS - * drivers of those that do not support it ignore this property. Use the - * function support() to determine whether the DBMS driver can manage indexes. - - * Example - * array( - * 'fields' => array( - * 'user_name' => array( - * 'sorting' => 'ascending' - * ), - * 'last_login' => array() - * ) - * ) - * @return mixed MDB2_OK on success, a MDB2 error on failure - * @access public - */ - function createIndex($table, $name, $definition) - { - $db =& $this->getDBInstance(); - if (PEAR::isError($db)) { - return $db; - } - - $table = $db->quoteIdentifier($table); - $name = $db->quoteIdentifier($name); - $query = "CREATE ".(array_key_exists('unique', $definition) ? 'UNIQUE INDEX' : 'INDEX')." $name on $table"; - $fields = array(); - foreach (array_keys($definition['fields']) as $field) { - $fields[] = $db->quoteIdentifier($field); - } - $query .= ' ('. implode(', ', $fields) . ')'; - return $db->query($query); - } - - // }}} // {{{ dropIndex() /**

« previous php.pear.cvs (#35945) next »