Index: trunk/phase3/includes/Database.php |
— | — | @@ -2212,7 +2212,7 @@ |
2213 | 2213 | */ |
2214 | 2214 | class MySQLField { |
2215 | 2215 | private $name, $tablename, $default, $max_length, $nullable, |
2216 | | - $is_pk, $is_unique, $is_key, $type; |
| 2216 | + $is_pk, $is_unique, $is_multiple, $is_key, $type; |
2217 | 2217 | function __construct ($info) { |
2218 | 2218 | $this->name = $info->name; |
2219 | 2219 | $this->tablename = $info->table; |
Index: trunk/phase3/config/index.php |
— | — | @@ -67,6 +67,12 @@ |
68 | 68 | $ourdb['postgres']['bgcolor'] = '#aaccff'; |
69 | 69 | $ourdb['postgres']['rootuser'] = 'postgres'; |
70 | 70 | |
| 71 | +$ourdb['sqlite']['fullname'] = 'SQLite'; |
| 72 | +$ourdb['sqlite']['havedriver'] = 0; |
| 73 | +$ourdb['sqlite']['compile'] = 'pdo_sqlite'; |
| 74 | +$ourdb['sqlite']['bgcolor'] = '#b1ebb1'; |
| 75 | +$ourdb['sqlite']['rootuser'] = 'root'; |
| 76 | + |
71 | 77 | ?> |
72 | 78 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
73 | 79 | <html> |
— | — | @@ -828,11 +834,11 @@ |
829 | 835 | |
830 | 836 | if( !$ok ) { continue; } |
831 | 837 | |
832 | | - } else /* not mysql */ { |
| 838 | + } else { # not mysql |
833 | 839 | error_reporting( E_ALL ); |
834 | 840 | $wgSuperUser = ''; |
835 | 841 | ## Possible connect as a superuser |
836 | | - if( $useRoot ) { |
| 842 | + if( $useRoot && $conf->DBtype != 'sqlite' ) { |
837 | 843 | $wgDBsuperuser = $conf->RootUser; |
838 | 844 | echo( "<li>Attempting to connect to database \"postgres\" as superuser \"$wgDBsuperuser\"..." ); |
839 | 845 | $wgDatabase = $dbc->newFromParams($wgDBserver, $wgDBsuperuser, $conf->RootPW, "postgres", 1); |
— | — | @@ -852,8 +858,8 @@ |
853 | 859 | } else { |
854 | 860 | $myver = $wgDatabase->getServerVersion(); |
855 | 861 | } |
856 | | - $wgDatabase->initial_setup('', $wgDBname); |
857 | | - } |
| 862 | + if (is_callable(array($wgDatabase, 'initial_setup'))) $wgDatabase->initial_setup('', $wgDBname); |
| 863 | + } |
858 | 864 | |
859 | 865 | if ( !$wgDatabase->isOpen() ) { |
860 | 866 | $errs["DBserver"] = "Couldn't connect to database"; |
— | — | @@ -1006,7 +1012,7 @@ |
1007 | 1013 | if ($conf->DBtype == 'mysql') { |
1008 | 1014 | dbsource( "../maintenance/tables.sql", $wgDatabase ); |
1009 | 1015 | dbsource( "../maintenance/interwiki.sql", $wgDatabase ); |
1010 | | - } else if ($conf->DBtype == 'postgres') { |
| 1016 | + } elseif (is_callable(array($wgDatabase, 'setup_database'))) { |
1011 | 1017 | $wgDatabase->setup_database(); |
1012 | 1018 | } |
1013 | 1019 | else { |