Commit graph

60 commits

Author SHA1 Message Date
Aaron Schulz
6120c18829 Fix bogus DatabaseOracle::__construct() calls in OracleInstaller
Change-Id: I12a35ac0eeb68e5da9ba07ba44d3522213e9de8e
2018-02-28 22:59:30 +00:00
Umherirrender
255d76f2a1 build: Updating mediawiki/mediawiki-codesniffer to 15.0.0
Clean up use of @codingStandardsIgnore
- @codingStandardsIgnoreFile -> phpcs:ignoreFile
- @codingStandardsIgnoreLine -> phpcs:ignore
- @codingStandardsIgnoreStart -> phpcs:disable
- @codingStandardsIgnoreEnd -> phpcs:enable

For phpcs:disable always the necessary sniffs are provided.
Some start/end pairs are changed to line ignore

Change-Id: I92ef235849bcc349c69e53504e664a155dd162c8
2018-01-01 14:10:16 +01:00
Kunal Mehta
574ae4929e Check minimum database server version when running update.php
If MediaWiki has increased the minimum database server version that is
required, check it when running update.php to ensure it is still
compatible. Previously this was only checked during the installer.

Bug: T162044
Change-Id: I47092c9557f4706a4dcb3a23150647e68af4317f
2017-10-02 22:23:32 -07:00
Aaron Schulz
dd359741cc Move DB errors to Rdbms namespace
Change-Id: I463bd86123501abc68fdb78b4cda6110f7af2549
2017-04-15 10:47:41 -07:00
Aaron Schulz
30f4b3c103 Replace DatabaseBase => Database in more places
Change-Id: If37a7909056bf2c31a8228cbc84f0fbbf5f1c517
2016-09-28 15:53:02 -07:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
umherirrender
29c2ab3da0 DatabaseInstaller::setVarsFromRequest needs array
Method is not marked as var args.

Bug: 58434
Follow-Up: I920b0231db1b70b68c6c8907257c288a0e112668
Change-Id: Ief7f7c06e75efbe7ae1da13f5021a9062483f690
2014-01-07 19:54:27 +01:00
Siebrand Mazeland
abd4247019 Remove unused local variables, update formatting and documentation
Change-Id: Ib17f5f05d6cc48ac448df0ea8515d570713df9b5
2013-11-25 14:42:34 +01:00
Siebrand Mazeland
bb0044f638 Address PHP CodeSniffer errors and warnings
One class of errors left unaddressed: Class name "WebInstaller_Language"
is not in camel caps format. I think this can be changed, too, but I
wasn't able to quickly find out where class names are being created.

Change-Id: I920b0231db1b70b68c6c8907257c288a0e112668
2013-10-23 12:42:07 +00:00
Siebrand Mazeland
626addab9e Update formatting
With some manual corrections.

Change-Id: Icd947288c32fdb90a0f35388963ef5a17ffa58e7
2013-10-09 09:35:18 +00:00
umherirrender
24bfde2710 Fix spacing and break some lines
Change-Id: Ia57685d8858e02e399ad5c75ce64d12609d340ac
2013-08-24 17:06:25 +02:00
freakolowsky
ffe6e12a8a Fixed EZConnect string regex in OracleInstaller class.
The Oracle connect string was valid only if it contained alphanumerics,
underscore and dot. Some new schmemes makes uses of slashes and
EZConnect has the concept of server types (pooled, dedicated, shared)
which we now validate.

The long regex is now in OracleInstaller::checkConnectStringFormat()
(flagged with @since 1.22). The patch provides a bunch of very basic
tests to test out the regex.

Change-Id: Ie3a0af9801bfdbc9129298be07e1676145a1607a
2013-05-31 16:03:58 +02:00
umherirrender
15abcf71ca Added/Removed spaces around string concatenation
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !

Fixed windows newline style

Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
2013-04-13 13:36:24 +02:00
umherirrender
6c278b6d7e fix some spacing
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
  calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays

Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
2013-03-25 22:22:46 +00:00
umherirrender
d63121016d fix some spacing
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
2013-03-07 17:53:21 +01:00
umherirrender
48cd72819e fix some spacing
Change-Id: Ia9650be8b791fd2f0ccbc099436918a9d12d9968
2013-02-04 20:04:26 +00:00
freakolowsky
546111c187 * Oracle schema update: rc_moved, cat_hidden, ss_admin
* tables.sql + updater patches for *_content_(model|format) fieldswq

Change-Id: Ifb0dfbcdf3da10cab2d71c2efa437ef4a878a1f8
2012-10-10 12:56:00 +02:00
Alex Monk
2fabea7eea Use wfMessage instead of deprecated wfMsg*
Or $this->msg in special pages.

Change-Id: I774a89d646615053c8424050e42ad95601f92543
2012-08-18 14:11:05 +02:00
Alexandre Emsenhuber
09bb6975c5 Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: I1615bf268515ed7169e33173cea6ec30402451dc
2012-05-06 07:50:15 +02:00
Jure Kajzer
e42c970e2d * partly fixes two issues exposed by bug 34280
** forcing recreate if creating user
** parent::createTables was setting DB to a wrong setting
2012-02-27 19:01:10 +00:00
Sam Reed
2ec09c5165 More return documentation 2012-02-09 21:35:05 +00:00
Sam Reed
856faea6d6 Add documentation
Fix some unused variables, commented some others out
2011-10-18 17:26:09 +00:00
Tim Starling
b37cde66c1 PostgreSQL install fixes:
* Made PG throw a DBQueryError when it gets a query error, instead of DBUnexpectedError. Apparently this mistake goes back to r14625, when exceptions were first introduced. Did it by removing reportQueryError(), the DatabaseBase version works fine.
* Fixed several places where there was an attempt to check for a query error by checking if the result of query() was false. This never worked. Used try/catch instead.
* Made the DBConnectionError messages go on one line so that they don't mess up the formatting in the installer.
* In DatabasePostgres::selectDB(), only disconnect and reconnect if the DB name is actually changing.
* Made DatabasePostgres::schemaExists() less weird and scary.
* Added DatabasePostgres::roleExists() for use by the installer.
* Removed the PostgreSQL-specific hack to make _InstallUser have a default other than "root". Made _InstallUser into a proper DBMS-specific internal variable instead, since every DBMS we support so far needs a different default.
* Removed the $dbName parameters from openConnection/getConnection, and got rid of $this->useAdmin. Implemented a more sophisticated caching scheme instead. Partial revert of r89389 and r81440.
* When connecting as the install user before DB creation, and when testing the web user's credentials, try a few different database names and use whichever one works. 
* Instead of connecting as the web user to create tables, I used SET ROLE. It seems cleaner and more like what the other DBMSes do during installation. "SET ROLE wikiuser" requires the same privileges as "CREATE SCHEMA ... AUTHORIZATION wikiuser", so it's unlikely to break anything.
* In the area of web account creation, fixed various minor logic errors and introduced more informative error messages at the submit stage, pre-install. Show a helpful error message if the web user exists already and the install user can't do the relevant SET ROLE.
* Split schema creation out to a separate install step.
* When creating an account as a non-superuser, add the administrative account to the new account's group. This is necessary to avoid a fatal error during installation (bug 28845).
* Removed code which alters an existing web user to have appropriate search paths and permissions. This may break other apps and is not necessary. As in other DBMSes, If the web user exists, it is the responsibility of the sysadmin to ensure that it has appropriate permissions.
* Rewrote setupPLpgSQL() to use the query builder functions.
2011-06-10 11:32:57 +00:00
Mark A. Hershberger
9be60e5725 forward port r88929 2011-06-03 03:41:11 +00:00
Mark A. Hershberger
44f9460caf w/s cleanup 2011-05-20 18:20:16 +00:00
Tim Starling
6fec4e3fde Revert r87635, r87637, r87639, r87643 (MW_MIN_PHP_VERSION etc.): breaks HipHop support. 2011-05-15 13:21:16 +00:00
Happy-melon
602020b1df Move minimum database versions to Defines.php 2011-05-07 15:25:27 +00:00
Jure Kajzer
3002621fb7 * OracleInstaller now also supports installation with (requested by Tim):
** preexisting account 
** privileged account into a restricted account
* DatabaseOracle fixed a fixme (made by Reedy)
2011-03-01 13:50:52 +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
Jure Kajzer
be8ce87825 * changed variable list as per comment on r79954 left only wgDBtype
* all other variables get set trough ->getGlobalNames
* could somone test this on mysql, postgres and sqlite ... it should work, but to be sure
2011-01-14 07:05:21 +00:00
Jure Kajzer
f853d711ac * fixed Oracle code for installer and phpunit tests
* removed ORABlob class
2011-01-10 19:22:27 +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
Mark A. Hershberger
aa08646a71 Misc whitespace changes, mostly EOL w/s and indention fixes so TAB = 4 spaces 2010-12-19 04:31:15 +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
Platonides
dfe4979df4 Document a bit what's going on and get rid of a warning. 2010-11-30 18:24:02 +00:00
Sam Reed
cadc951d15 More reversion of r77297, 1 of 2 commits to keep it readable in CR (hopefully) 2010-11-25 22:24:11 +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
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
2c965c5dc4 Followup r76055, missed a few more 2010-11-04 23:23:34 +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
Jure Kajzer
e99125adf1 * installers skips recreation of existing user
* updater for 16->17 schema changes 
* i dedicate this revision to my greatest supporter ... Reedy :)
2010-10-27 14:52:18 +00:00
Jure Kajzer
1eede8e88b * DatabaseOracle - throw connection exception instead of debug+false
* DatabaseOracle - fixed $wgContLang local usage in update
* Installer - added Main Page insertion as a new installation step (fixes bug 22308)
2010-10-25 16:49:59 +00:00
Jure Kajzer
5bc09c7c5c * Installer for Oracle fixes
* added Main Page creation within install
* added MEDIAWIKI_INSTALL constant; some scripts still use it
* started OracleUpgrader scripts for upgrade from 1.16
* fixed some not null defaults that comply with mysql data type default on not null fields
* FKs made defferable
2010-10-25 11:07:55 +00:00
Jure Kajzer
49c9990074 * fixed r74949 remarks
* modified version lookup, added 9iR1 as minimum version for installation.
2010-10-19 06:25:12 +00:00
Jure Kajzer
6d11fb986f * Installer: works (beta). More testing tomorow.
* Updater: todo. For now it skips.
2010-10-18 16:09:18 +00:00
Chad Horohoe
4a50d55600 Add getConnection() for Oracle 2010-09-01 19:09:27 +00:00