Show
Ignore:
Timestamp:
05/11/08 17:04:41 (4 years ago)
Author:
dom
Message:

fix much tab/whitespace damage; no functional changes.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • wiki-toolkit/trunk/lib/Wiki/Toolkit/Setup/MySQL.pm

    r426 r431  
    1414 
    1515my %create_sql = ( 
    16         schema_info => [ qq| 
     16    schema_info => [ qq| 
    1717CREATE TABLE schema_info ( 
    1818  version   int(10)      NOT NULL default 0 
     
    117117    my %tables = fetch_tables_listing($dbh); 
    118118 
    119         # Do we need to upgrade the schema of existing tables? 
    120         # (Don't check if no tables currently exist) 
    121         my $upgrade_schema; 
    122         my @cur_data; 
    123         if(scalar keys %tables > 0) { 
    124                 $upgrade_schema = Wiki::Toolkit::Setup::Database::get_database_upgrade_required($dbh,$VERSION); 
    125         } 
    126         if($upgrade_schema) { 
    127                 # Grab current data 
    128                 print "Upgrading: $upgrade_schema\n"; 
    129                 @cur_data = eval("&Wiki::Toolkit::Setup::Database::fetch_upgrade_".$upgrade_schema."(\$dbh)"); 
    130                 if($@) { warn $@; } 
     119    # Do we need to upgrade the schema of existing tables? 
     120    # (Don't check if no tables currently exist) 
     121    my $upgrade_schema; 
     122    my @cur_data; 
     123    if(scalar keys %tables > 0) { 
     124        $upgrade_schema = Wiki::Toolkit::Setup::Database::get_database_upgrade_required($dbh,$VERSION); 
     125    } 
     126    if($upgrade_schema) { 
     127        # Grab current data 
     128        print "Upgrading: $upgrade_schema\n"; 
     129        @cur_data = eval("&Wiki::Toolkit::Setup::Database::fetch_upgrade_".$upgrade_schema."(\$dbh)"); 
     130        if($@) { warn $@; } 
    131131 
    132132        # Check to make sure we can create, index and drop tables 
     
    137137        } 
    138138         
    139                 # Drop the current tables 
    140                 cleardb($dbh); 
    141  
    142                 # Grab new list of tables 
    143                 %tables = fetch_tables_listing($dbh); 
    144         } 
    145  
    146         # Set up tables if not found 
     139        # Drop the current tables 
     140        cleardb($dbh); 
     141 
     142        # Grab new list of tables 
     143        %tables = fetch_tables_listing($dbh); 
     144    } 
     145 
     146    # Set up tables if not found 
    147147    foreach my $required ( keys %create_sql ) { 
    148148        if ( $tables{$required} ) { 
     
    156156    } 
    157157 
    158         # If upgrading, load in the new data 
    159         if($upgrade_schema) { 
    160                 Wiki::Toolkit::Setup::Database::bulk_data_insert($dbh,@cur_data); 
    161         } 
     158    # If upgrading, load in the new data 
     159    if($upgrade_schema) { 
     160        Wiki::Toolkit::Setup::Database::bulk_data_insert($dbh,@cur_data); 
     161    } 
    162162 
    163163    # Clean up if we made our own dbh. 
     
    167167# Internal method - what Wiki::Toolkit tables are defined? 
    168168sub fetch_tables_listing { 
    169         my $dbh = shift; 
     169    my $dbh = shift; 
    170170 
    171171    # Check what tables exist 
     
    176176        exists $create_sql{$table} and $tables{$table} = 1; 
    177177    } 
    178         return %tables; 
     178    return %tables; 
    179179} 
    180180 
     
    234234        if ( $args{dbh} ) { 
    235235            return $args{dbh}; 
    236         } else { 
     236    } else { 
    237237            return _make_dbh( %args ); 
    238238        } 
     
    259259        if ( $args{dbh} ) { 
    260260            return 0; 
    261         } else { 
     261    } else { 
    262262            return 1; 
    263263        } 
     
    273273    $dsn .= ";host=$args{dbhost}" if $args{dbhost}; 
    274274    my $dbh = DBI->connect($dsn, $args{dbuser}, $args{dbpass}, 
    275                            { PrintError => 1, RaiseError => 1, 
    276                              AutoCommit => 1 } ) 
    277       or croak DBI::errstr; 
     275               { PrintError => 1, RaiseError => 1, 
     276                 AutoCommit => 1 } ) 
     277        or croak DBI::errstr; 
    278278    return $dbh; 
    279279}