Changeset e905db1 in github


Ignore:
Timestamp:
Oct 14, 2008 8:49:44 AM (5 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
32eb29f
Parents:
871ca9a
Message:

Set postgres-specific schema options + fix indentation

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bin/dumpschema.php

    r06c3d10 re905db1  
    11<?php 
    22/* 
     3 #!/usr/bin/php 
    34 
    45 +-----------------------------------------------------------------------+ 
     
    4647        'force_defaults' => false, 
    4748        'portability' => false, 
    48         'disable_smart_seqname' => true, 
    49         'seqname_format' => '%s' 
    5049); 
    5150 
    52 $schema =& MDB2_Schema::factory($config->get('db_dsnw'), $options); 
     51$dsnw = $config->get('db_dsnw'); 
     52$dsn_array = MDB2::parseDSN($dsnw); 
     53 
     54// set options for postgres databases 
     55if ($dsn_array['phptype'] == 'pgsql') { 
     56        $options['disable_smart_seqname'] = true; 
     57        $options['seqname_format'] = '%s'; 
     58} 
     59 
     60$schema =& MDB2_Schema::factory($dsnw, $options); 
    5361$schema->db->supported['transactions'] = false; 
    5462 
    55                          
     63 
    5664// send as text/xml when opened in browser 
    5765if ($_SERVER['REMOTE_ADDR']) 
     
    6977         
    7078        $definition = $schema->getDefinitionFromDatabase(); 
     79        $definition['charset'] = 'utf8'; 
     80 
    7181        if (PEAR::isError($definition)) { 
    7282                $error = $definition->getMessage() . ' ' . $definition->getUserInfo(); 
     
    8292$schema->disconnect(); 
    8393 
    84 //if ($error) 
    85 //      fputs(STDERR, $error); 
     94if ($error && !$_SERVER['REMOTE_ADDR']) 
     95        fputs(STDERR, $error); 
    8696 
    8797?> 
  • program/include/rcube_mdb2.php

    r9f23f05 re905db1  
    8787 
    8888    if ($this->db_provider == 'pgsql') { 
    89         $db_options['disable_smart_seqname'] = true; 
    90         $db_options['seqname_format'] = '%s'; 
    91       } 
     89      $db_options['disable_smart_seqname'] = true; 
     90      $db_options['seqname_format'] = '%s'; 
     91    } 
    9292 
    9393    $dbh = MDB2::connect($dsn, $db_options); 
Note: See TracChangeset for help on using the changeset viewer.