thomascube
2008-10-14 e905db13057c84403d33b7007b4a13e9ffbf2ed0
Set postgres-specific schema options + fix indentation

2 files modified
20 ■■■■ changed files
bin/dumpschema.php 20 ●●●● patch | view | raw | blame | history
program/include/rcube_mdb2.php patch | view | raw | blame | history
bin/dumpschema.php
@@ -1,5 +1,6 @@
<?php
/*
 #!/usr/bin/php
 +-----------------------------------------------------------------------+
 | bin/dumpschema.php                                                    |
@@ -45,11 +46,18 @@
    'quote_identifier' => true,
    'force_defaults' => false,
    'portability' => false,
    'disable_smart_seqname' => true,
    'seqname_format' => '%s'
);
$schema =& MDB2_Schema::factory($config->get('db_dsnw'), $options);
$dsnw = $config->get('db_dsnw');
$dsn_array = MDB2::parseDSN($dsnw);
// set options for postgres databases
if ($dsn_array['phptype'] == 'pgsql') {
    $options['disable_smart_seqname'] = true;
    $options['seqname_format'] = '%s';
}
$schema =& MDB2_Schema::factory($dsnw, $options);
$schema->db->supported['transactions'] = false;
            
@@ -68,6 +76,8 @@
    );
    
    $definition = $schema->getDefinitionFromDatabase();
    $definition['charset'] = 'utf8';
    if (PEAR::isError($definition)) {
        $error = $definition->getMessage() . ' ' . $definition->getUserInfo();
    }
@@ -81,7 +91,7 @@
$schema->disconnect();
//if ($error)
//    fputs(STDERR, $error);
if ($error && !$_SERVER['REMOTE_ADDR'])
    fputs(STDERR, $error);
?>
program/include/rcube_mdb2.php