Commit graph

58 commits

Author SHA1 Message Date
Greg Sabino Mullane
d7f7a69d6a When switching from admin to non-admin account, make sure to set $this->db to null, otherwise MW will happily return the old handle, which means we end up in the old admin database, and thus create our 'mediawiki' schema in the postgres or template1 database (whoops!). There may be other similar cases in the code in which we are not clearing this->db before toggling the useAdmin attribute. Fixes bug 28171. 2011-03-21 22:09:49 +00:00
Greg Sabino Mullane
e19a2ac3e1 template1 is a poor choice: use the standard 'postgres' database instead.
Especially as the installer currently is modifying this database! (a separate bug...)
2011-03-21 21:59:04 +00:00
Greg Sabino Mullane
cfb993f5b9 $safedb needs to be set *outside* the if/else block, not just inside the if
Fixes bug 28170
2011-03-21 21:36:21 +00:00
Greg Sabino Mullane
b694d74c80 Change the default user from 'root' to 'postgres' if using a PostgreSQL backend.
There may be a better way to do this, so comments welcome.
2011-03-21 14:59:14 +00:00
Greg Sabino Mullane
ed8e58314e Don't need an Oracle flag here... 2011-03-21 03:01:36 +00:00
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
3b23b4291b Fix backwards canCreateAccounts() check, remove setting search_path for $wgDBuser, since this is set per-session on open() 2011-02-23 14:26:45 +00:00
Sam Reed
64be8c7b26 Ununsed variables
Documentation and explicit definitions
2011-02-23 12:35:41 +00:00
Sam Reed
2c6e16e5e5 Remove unused variables 2011-02-18 01:10:38 +00:00
Mark A. Hershberger
4625f338ca Make schema selection really work for PostgreSQL installation 2011-02-06 03:06:45 +00:00
Chad Horohoe
78101f2bdd More uppercase trues 2011-02-04 21:00:17 +00:00
Chad Horohoe
198574cb45 lowercase a few more t/f 2011-02-04 20:54:43 +00:00
Chad Horohoe
39e7d019d8 Rm selectDB from Postgres, doesn't do anything 2011-02-04 20:52:55 +00:00
Mark A. Hershberger
ee3e5163c4 re r81495 — you know, I've completely forgotten why I wanted to return a status object. Fix that and not the busted status message. 2011-02-04 00:21:59 +00:00
Mark A. Hershberger
5e1e89c63f * make canCreateAccounts() return Status Objects instead of boolean
* re-use openConnection to test the ability of the user to connect.
2011-02-04 00:15:44 +00:00
Sam Reed
0c3f623d71 Fixup spaces to tabs 2011-02-03 20:47:54 +00:00
Chad Horohoe
6e35fc91a1 2011-02-03 20:40:20 +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
Mark A. Hershberger
1eb2307caa Results of my work on new-installer and Pg.
* NOTE: this commit removes any semblence of tsearch compatibility with pre-8.3 PostgreSQL
* Make new-installer work against PostgreSQL
* Remove SearchPostgres.php's call to pg_fetch_result.  I think this is the only one outside of the vestigtial old installer code.
2011-02-03 04:06:11 +00:00
Chad Horohoe
69d2ee1095 Followup r81132, missed some more ts2 removal 2011-01-28 15:25:15 +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
Tim Starling
e1c8e80297 * Fixed Oracle new installer support, broken by r80957. This is a minimal patch and doesn't address the architectural issues.
** Moved the responsibility for calling setupSchemaVars() on install to the DatabaseInstaller subclass. This allows it to be called after setupDatabase() has completed, as required by Oracle and PostgreSQL.
** Fixed OracleInstaller::getConnection() so that it respects $this->useSysDBA correctly.
** In OracleInstaller, added some more variables to the list of schema vars, which are needed by user.sql and tables.sql
** In SearchOracle, specify the database name when calling ctx_ddl.sync_index(). This fixes a fatal error in the createMainpage step, caused by the schema name not being equal to the current user. 

* In oracle/tables.sql, fixed a couple of indexes with missing table prefixes.
* Improved debugging output in DatabaseInstaller::getConnection() and Installer::createMainpage().
* In DatabaseBase::selectDB(), set $this->mDBname correctly, as in DatabaseMysql.
2011-01-27 08:25:48 +00:00
Tim Starling
0c86b1611a * Fixed a bug causing the installer to ignore the "engine" and "charset" settings when installing a MySQL database.
* Fixed a bug causing the engine and charset settings to not be properly preserved when adding new tables on upgrade.
* Fixed total breakage of SQLite upgrade, by reusing the administrative connection to the SQLite database instead of creating a new one when wfGetDB() is called. Added LBFactory_Single to support this. 
* Introduced a "schema variable" concept to DatabaseBase to avoid the use of globals for communication between the installer and the Database. Removed a lot of old global variable names from Database::replaceVars(), most were only added on a whim and were never used.
* Introduced DatabaseInstaller::getSchemaVars(), to allow schema variables to be supplied by the DatabaseInstaller child classes.
* Removed messages config-mysql-egine-mismatch [sic] and config-mysql-charset-mismatch. In the old installer it was possible for users to request a certain character set for an upgrade, but in the new installer the question is never asked. So these warnings were shown whenever a non-default character set or engine was used in the old database.
* In MysqlInstaller::preUpgrade(), fixed the incorrect strings used to identify the MySQL character sets: mysql5 instead of utf8 and mysql5-binary instead of binary.
* On install, initialise the site_stats table, using code copied from the old installer. Unlike the old installer, use SiteStats to increment the user count when the initial user is added.
* Fixed several instances of inappropriate call-by-reference. 
* Replaced call_user_func_array() with call_user_func() where possible, it is shorter and simpler.	
* Moved the caching boilerplate for DatabaseInstaller::getConnection() to the base class, and have the derived classes override an uncached function openConnection() instead. Updates r80892.
* In MysqlInstaller::getLocalSettings(), escape PHP strings correctly with LocalSettingsGenerator::escapePhpString(). 
* Reduce timeout for checks in dirIsExecutable() to 3 seconds, so that it doesn't take 30s to run when apache is in single-threaded mode for debugging.
* MySQL and SQLite have been tested and they appear to work. PostgreSQL upgrade is totally broken, apparently it was like that before I started. The Oracle code is untested.
2011-01-25 07:37:48 +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
Sam Reed
6111daf9ef Spaces to tabs 2011-01-12 23:01:47 +00:00
Chad Horohoe
19bde21182 Fix undefined variable from r79828 2011-01-12 21:28:59 +00:00
Chad Horohoe
49ee8fede4 Fix a few doQuery() -> query() 2011-01-11 16:02:56 +00:00
Chad Horohoe
587c077aad Fix callbacks for the final time so it actually works per documentation.
Other minor postgres fixes
2011-01-11 15:02:59 +00:00
Chad Horohoe
b8e4029eab Fix copy+paste mistake from r79989 2011-01-11 14:00:47 +00:00
Chad Horohoe
958ed916db Fix callback issue noted in r79989 (broken in r78774).
$this makes a difference.
I'm an idiot.
2011-01-11 13:54:05 +00:00
OverlordQ
e17d76f631 I have no clue how the callbacks work, this at least sets up a database, everything after that is fubar 2011-01-11 03:07:45 +00:00
Chad Horohoe
a36ff08975 More postgres
* Add user creation form like MySQL
* Fix canCreateAccounts() check
* Fix ts2 setup callback
* Still needs schema creation and other misc. stuff from lines ~370-530 of DatabasePostgres
2011-01-10 19:18:28 +00:00
Chad Horohoe
3848fdfd15 Forgot param 1, make URL param 2 per Nikerabbit 2011-01-07 18:41:55 +00:00
Chad Horohoe
e391b31946 Move over some initial_setup() for Postgres (THIS IS BROKEN, NEEDS REVIEW/WORK FROM POSTGRES GUYS!!)
* Ported canCreateAccounts() check
* Moved creation of new user to setupUser()
* Moved DB creation (still needs schema stuff) to setupDatabase() where it belongs
* Added ts2 setup

TODO:
* UI for non-admin account (like MysqlInstaller::getSettingsForm) and maybe move ts2 and other "optional" settings there
* Schema creation/setup
2011-01-07 18:24:56 +00:00
Chad Horohoe
d657893eb9 Typofix key names 2011-01-06 22:45:34 +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
Aaron Schulz
281018701f Changed doQuery() -> query() 2010-12-15 20:59:29 +00:00
Brandon Harris
4f8f4bf675 Revert r77860, which was a reversion of r75832.
Didn't see comments about escaping html and use of tipsy; will be addressed in next commit.
2010-12-06 20:04:28 +00:00
Tim Starling
41b92f3343 Reverted r75832 per my comments on CR, unanswered for 19 days. Moving all help information into tooltips is a step backwards for usability. Reverted followups r75836, r75866, r76314 and r76315. 2010-12-06 07:08:31 +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
Mark A. Hershberger
a465346c6e random w/s cleanup 2010-12-01 20:22:45 +00:00
Mark A. Hershberger
962be1d210 * Commit changes to PG new-installer I thought I had done last week.
* Set up and use function for renaming tables
* Use $conn instead of $this when it is called for
* remove protection from commitChanges so the installer can use it
2010-12-01 20:15:45 +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
Chad Horohoe
0bee9581b4 Replace XML->HTML methods throughout most of the installer 2010-11-04 23:21:24 +00:00
Brandon Harris
d00ddeef7f * Added tipsy library
* Added associated files for tooltip display
* Added associated css rules for tooltip display
* Updated installer's help system in (most?) places to display help as tooltips instead of show/hide system
* Beginnings of visual changes (e.g., less boxes, more color)
* Modified several of the installer's widget display methods
* Added a couple new i18n values
* Fixed small bug in installer logic:
  - Password validation on new users was being executed even if there wasn't a $user object
2010-11-01 21:17:15 +00:00
Chad Horohoe
79cb225ea3 rm always-true isOK() check 2010-10-17 19:35:13 +00:00
Alexandre Emsenhuber
a2bbf10231 Per ^demon's comment on r71430: moved doUpgrade() to DatabaseInstaller (did not remove the stub method in Oracle installer) 2010-09-07 20:57:53 +00:00
Chad Horohoe
ed7ff76d50 Move createTables() up a level, this code was practically identical 2010-09-01 19:03:56 +00:00
Chad Horohoe
9fb2b16dc0 Reduce some duplication, just implement stub in parent 2010-09-01 18:10:02 +00:00