Chad Horohoe
62679f963e
Various Postgres fixes (bug 26612 stuff)
...
* Remove last of $wgDBuser-specific settings like timezone, datestyle and search_path. This is all handled by open() :D
* Only set search_path if the schema exists (rather than just set to some random string), fall back to 'public' otherwise
* Only call setupUser() if we need to _CreateDBAccount, otherwise it returns immediately and confuses you (no functional change)
* Implement selectDB() for Postgres, basically call open() with a new DB name
* Try to fix setupDatabase() for this "user must be owner of relation" error I'm getting when the $wgDBuser exists (have tried with roles granted && no roles granted). I get no errors at all when
2011-02-23 16:01:22 +00:00
Chad Horohoe
04fc9587d6
Rm unused member variable
2011-02-23 13:53:47 +00:00
Chad Horohoe
ad2ea9d386
Per bug 26612, set datestyle and timezone in open() rather than relying on $wgDBuser having specific settings.
2011-02-23 13:51:00 +00:00
Sam Reed
7ebf2e5165
More function level documentation
...
Fixup some indenting
2011-02-19 00:44:38 +00:00
Platonides
36be4d521f
Remove unused initial_setup(), last $wgDBts2schema user. Follow up to r81132
2011-02-10 19:12:33 +00:00
Mark A. Hershberger
4625f338ca
Make schema selection really work for PostgreSQL installation
2011-02-06 03:06:45 +00:00
Chad Horohoe
b8ff7fd048
rm unrelated changes from r81486
2011-02-03 21:02:36 +00:00
Chad Horohoe
c22727da66
Remove now unused enableBackend()
2011-02-03 21:01:35 +00:00
OverlordQ
113639eb02
Follow-up to r81439, works up to installing the admin user then dies with:
...
Creating administrator user account...
Mediawiki tried to access the database via wfGetDB(). This is not allowed.
Backtrace:
#0 /var/www/testsite.com/w/includes/GlobalFunctions.php(3020): LBFactory_Fake->getMainLB(false)
#1 /var/www/testsite.com/w/includes/GlobalFunctions.php(3010): wfGetLB(false)
#2 /var/www/testsite.com/w/includes/User.php(2558): wfGetDB(-1)
#3 /var/www/testsite.com/w/includes/installer/Installer.php(1383): User->idForName()
#4 [internal function]: Installer->createSysop(Object(PostgresInstaller))
#5 /var/www/testsite.com/w/includes/installer/Installer.php(1293): call_user_func(Array, Object(PostgresInstaller))
#6 /var/www/testsite.com/w/includes/installer/WebInstallerPage.php(1022): Installer->performInstallation(Array, Array)
#7 /var/www/testsite.com/w/includes/installer/WebInstaller.php(243): WebInstaller_Install->execute()
#8 /var/www/testsite.com/w/config/index.php(46): WebInstaller->execute(Array)
#9 /var/www/testsite.com/w/config/index.php(14): wfInstallerMain()
#10 {main}
2011-02-03 05:17:18 +00:00
Platonides
73df0d7879
Follow-up r81132 removal of pre-8.3 support.
...
Still needs removal of $wgDBts2schema inside initial_setup()
2011-01-28 17:25:00 +00:00
Chad Horohoe
bf3e2be8d5
Per comment on bug 26612, we should drop the pre-Postgres 8.3 support with the TSearch2 schema.
...
This removes a bunch of back-compat code in the installer and search code.
Minimum postgres version is now 8.3
2011-01-28 14:12:26 +00:00
Chad Horohoe
a5053d4c5a
* Cleanup massive duplication across Database constructors. Default implementation fairly sane. Now they all share the same if( $server ) logic to allow constructing the class without forcing open a connection (MySQL has done this since at least r15094)
...
* Get rid of intermediate installTables() callback
* Actually cache the result of DbInstaller::getConnection() like the documentation says
2011-01-24 18:36:09 +00:00
Chad Horohoe
4ece90ed4b
Remove ancient and deprecated newFromParams() constructor wrappers from various DatabaseBase implementations. Only callers are AskSql and WikiTrust. Both are calling the (very old) Database class anyway, so are obviously expecting a MySQL connection and can use the fallback (which yells wfDeprecated) in DatabaseBase
2011-01-07 20:25:52 +00:00
Chad Horohoe
b5995fd723
Move setup_plpgsql() to PostgresInstaller and make it use status objects for when the rest of this is moved over too
2010-12-27 15:41:11 +00:00
Chad Horohoe
8fed0eb241
* Fix r78774 for Oracle and Postgres, broke by method rename
...
* Get rid of Postgres version check, already handled by PostgresInstaller::submitConnectForm()
2010-12-23 20:24:11 +00:00
Daniel Friesen
aae05c49f8
MySQL is the only database which quotes identifiers primarily using backticks. Move the backtick based addIdentifierQuotes implementation from the generic into DatabaseMysql and take the duplicated implementation used by oracle, sqlite, ibm_db2, postgresql, and mssql and remove it from all of them migrating it to the generic Database class as the default.
2010-12-04 15:35:36 +00:00
Daniel Friesen
692ad26f68
Followup to r77713, rename quote_ident to addIdentifierQuotes to follow naming conventions better. While I'm at it adding a missing addIdentifierQuotes implementation for Ibm_db2.
2010-12-04 15:14:08 +00:00
Daniel Friesen
da469e3abe
Fix a bug in the installer caused by r77487 creating installer sql statements like "GRANT ALL PRIVILEGES ON 'dbname'.* TO ''tablename''@'%" while improving the database independence of replaceVars.
...
* Drop unused and likely broken /*$var*/` -> `$var syntax
* Replace {$var} with '{$var}' and `{$var}` handling that uses relevant database independent quoting ({$var} without surrouding quotes are never used)
* Give the generic/mysql class a proper quote_ident implementation
* Fix the unused Oracle and Sqlite quote_ident implementations which are potential sql injections if used
* Split common variable replacemnt code off to a replaceGlobalVars and make the generic and oracle code use it instead of duplicating the same code as each other
2010-12-04 09:27:02 +00:00
Sam Reed
194acd8d9e
Set blank $fname
2010-11-26 12:06:50 +00:00
Sam Reed
6b0d4abc64
Revert r77297, Won't be reverting MimeMagic
...
Mainly whitespace reverts here
2010-11-25 22:22:53 +00:00
Antoine Musso
6fe29c9c30
revert r76464
...
* mixed style changes and variable removing
* logic changes
* useful comments removed
2010-11-25 20:01:34 +00:00
Antoine Musso
af7558aa94
dieout() now default to empty text. follow up r76165
2010-11-23 20:39:04 +00:00
Max Semenik
4345c2c20e
Refactoring of *Field classes:
...
* Made them all implement one common interface (might add more functions to it later)
* Moved MySQLField to DatabaseMysql.php
* Renamed nullable() to isNullable()
* Removed maxLength() from:
** SQLiteField: makes no sense
** MySQLField: doesn't do what people may think, useless for this class' purpose of assisting querying the DB schema
2010-11-21 19:56:51 +00:00
Sam Reed
10ecfeb03b
Various unused variables, add some braces
...
Explicitally define some variables used in hook type calls
2010-11-10 19:49:04 +00:00
Chad Horohoe
c7f9eaf626
Postgres updater stuff, needs review
...
* Move setup_database() from DatabasePostgres to PostgresInstaller
** Add install step after interwiki for the COMMIT
** Put the table creation test (should we abstract this?) in setupDatabase()
** The leftover stuff in initial_setup() also belongs in setupDatabase(), I think?
2010-11-10 16:06:16 +00:00
Platonides
4147b8a5bb
dieout() function already takes into account if a </ul> is needed.
2010-11-05 23:36:30 +00:00
Sam Reed
d189aaee05
(bug 24853) Kill failFunction - Fixed! :D
2010-10-24 21:27:33 +00:00
Sam Reed
16cded8b32
Start of bug 24853, killing off 'functional' parts of failfunction code. Seems when the constructors start getting changed, it starts borking. Using this as a point of reversion/stashing
2010-10-24 20:48:48 +00:00
Sam Reed
6b3b915353
Big attack on unused variables...
2010-10-14 20:53:04 +00:00
Sam Reed
a2589ff8c6
Assignment in loop conditions suck
...
while ( $row = $dbw->fetchObject( $res ) ) { to foreach ( $res as $row ) in includes
Add some braces
2010-10-13 23:11:40 +00:00
Chad Horohoe
e4189f5920
Fix a bunch of '? true : false' instances
2010-09-27 14:24:13 +00:00
Platonides
945fb1293d
Unused globals.
2010-09-17 15:07:07 +00:00
Chad Horohoe
14aaf4d1fe
Followup r65542, rm some unused vars
2010-09-15 07:41:03 +00:00
Jack Phoenix
0443990ccd
coding style tweaks
2010-09-05 18:35:34 +00:00
Jack Phoenix
1252d00372
trim trailing spaces
2010-09-05 18:00:33 +00:00
Aryeh Gregor
338ae40072
Suggest running update.php on database error
...
This is a pretty frequently asked question in #mediawiki -- most
database errors are probably due to not running update.php.
2010-09-05 17:40:47 +00:00
Sam Reed
b14e26cb49
Followup r72234, pass $this->mConn instead of null
2010-09-03 15:53:08 +00:00
Sam Reed
66a28589b1
Fixup some method calls with missing parameters
2010-09-02 21:54:53 +00:00
Chad Horohoe
9e6c7cc8ef
Get rid of PHP4-style constructors
2010-08-30 16:52:51 +00:00
Chad Horohoe
e0cb9ef9b6
Make getSoftwareLink() static so I can use it without instantiating (and opening) a bunch of databases I probably can't support. Can't have an abstract parent now, so throw an exception for anyone who writes a child class without bothering to implement it. All of this to add some helpful text links in an infobox in the installer :)
2010-08-22 20:55:07 +00:00
Sam Reed
85af1b0901
Revert r71250 r71251 r71252 r71253
...
Know what the problem is, roughly, can't fix atm, so not leaving phase3 broken
2010-08-18 14:15:32 +00:00
Sam Reed
96114da761
Fix wrong removal in r71250
2010-08-18 13:50:07 +00:00
Sam Reed
9ea1f1d388
Kill some crappy "failFunction" stuff, marked as old in r14625
2010-08-18 13:38:42 +00:00
Chad Horohoe
4c74490bb8
Big commit: kill almost every freeResult() call as useless
2010-08-08 12:27:48 +00:00
Chad Horohoe
d6c112d38d
Remove dupe implementations of begin/commit from Postgres. Also included checks for $mTrxLevel on commit/rollback, based on patch on bug 24629
2010-08-06 12:54:39 +00:00
Greg Sabino Mullane
ee2b60ca60
Correct casing for PL/pgSQL
2010-08-04 11:58:35 +00:00
Alexandre Emsenhuber
c13687bdb6
Standardisation of file headers
2010-08-01 21:13:44 +00:00
Platonides
df0793dc59
Followup r69909. This.. is.. no.. longer... a global!
2010-07-26 20:55:44 +00:00
Sam Reed
24bb8304f2
Followup r69921
...
PHP Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting T_PAAMAYIM_NEKUDOTAYIM in includes/db/DatabasePostgres.php on line 1157
2010-07-26 06:57:58 +00:00
Platonides
36d86e7ae9
Kill $wgDBversion
2010-07-25 22:09:34 +00:00