cvs: pear /LiveUser/sql install.php

From: Date: Wed, 08 Feb 2006 16:02:12 +0000
Subject: cvs: pear /LiveUser/sql install.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-38056@lists.php.net to get a copy of this message
lsmith Wed Feb 8 16:02:12 2006 UTC Modified files: /pear/LiveUser/sql install.php Log: - add support for force_seq http://cvs.php.net/viewcvs.cgi/pear/LiveUser/sql/install.php?r1=1.39&r2=1.40&diff_format=u Index: pear/LiveUser/sql/install.php diff -u pear/LiveUser/sql/install.php:1.39 pear/LiveUser/sql/install.php:1.40 --- pear/LiveUser/sql/install.php:1.39 Wed Feb 8 00:04:18 2006 +++ pear/LiveUser/sql/install.php Wed Feb 8 16:02:12 2006 @@ -35,7 +35,7 @@ * @author Lukas Smith <smith@pooteeweet.org> * @copyright 2002-2005 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt - * @version CVS: $Id: install.php,v 1.39 2006/02/08 00:04:18 lsmith Exp $ + * @version CVS: $Id: install.php,v 1.40 2006/02/08 16:02:12 lsmith Exp $ * @link http://pear.php.net/LiveUser */ @@ -68,6 +68,7 @@ 'allowDuplicateHandles' => 0, 'storage' => array( 'dsn' => $dsn, +# 'force_seq' => false, 'alias' => array( 'auth_user_id' => 'authUserId', 'lastlogin' => 'lastLogin', @@ -97,8 +98,11 @@ 'permContainer' => array( 'type' => 'Complex', 'storage' => array( - 'MDB2' => array('dsn' => $dsn, - 'prefix' => 'liveuser_') + 'MDB2' => array( + 'dsn' => $dsn, + 'prefix' => 'liveuser_', +# 'force_seq' => false, + ) ) ) ); @@ -177,7 +181,7 @@ * @category authentication * @package LiveUser * @author Lukas Smith <smith@pooteeweet.org> - * @version $Id: install.php,v 1.39 2006/02/08 00:04:18 lsmith Exp $ + * @version $Id: install.php,v 1.40 2006/02/08 16:02:12 lsmith Exp $ * @copyright 2002-2005 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt * @version Release: @package_version@ @@ -226,19 +230,24 @@ $fields[$field_name]['default'] = $default; // Sequences if ($required === 'seq') { - $sequences[$instance->prefix . $instance->alias[$table_name]] = array( - 'on' => array( - 'table' => $instance->prefix . $instance->alias[$table_name], - 'field' => $field_name, - ) - ); - - $table_indexes[$table_name.'_'.$field_name] = array( - 'fields' => array( - $field_name => true, - ), - 'unique' => true - ); + if (isset($instance->force_seq) && !$instance->force_seq) { + $fields[$field_name]['autoincrement'] = true; + $fields[$field_name]['default'] = 0; + } else { + $sequences[$instance->prefix . $instance->alias[$table_name]] = array( + 'on' => array( + 'table' => $instance->prefix . $instance->alias[$table_name], + 'field' => $field_name, + ) + ); + + $table_indexes[$table_name.'_'.$field_name] = array( + 'fields' => array( + $field_name => true, + ), + 'unique' => true + ); + } // Generate indexes } elseif (is_string($required)) { $index_name = $table_name.'_'.$required . '_i';

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