Commit graph

190 commits

Author SHA1 Message Date
Platonides
c9e56fd3dc Merge r67177 from 1.16wmf4 2011-02-22 10:26:00 +00:00
Sam Reed
7ebf2e5165 More function level documentation
Fixup some indenting
2011-02-19 00:44:38 +00:00
Sam Reed
15f4f6f360 Explicitally define some variables
Function documentation
2011-02-18 23:21:48 +00:00
Sam Reed
d2e409eed1 Mark a fixme comment in Oracle DB file for undefined variable
Add documentation
2011-02-18 22:58:02 +00:00
Sam Reed
64d9ae91c1 Fixup fixme on r81030, which should actually have been a fixme on r81657 2011-02-09 18:57:25 +00:00
OverlordQ
295dbec295 Followup to r81657, you do need a space between the table name and the alias 2011-02-08 15:34:28 +00:00
Sam Reed
849f0890c3 Per fixme on r77597, change to $this->addQuotes() instead of hardcoded quote type 2011-02-07 23:21:53 +00:00
Brion Vibber
4e7aa45ee5 Fixed an incorrect doc comment bit on Database::sourceStream, then added some more doc comments around the file just cause 2011-02-06 21:47:58 +00:00
Mark A. Hershberger
10aa275e6b fix Bug#26274: Database layer should allow arrays for ORDER BY, GROUP BY 2011-01-31 21:04:40 +00:00
Mark A. Hershberger
aeaaf53838 making my whitespace OCD happier. 2011-01-31 20:58:06 +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
Alexandre Emsenhuber
51c6afc751 * Replaced $wgMessageCache by MessageCache::singleton(); since we only use one instance of this class (as for ParserCache, LinkCache)
* MessageCache::singleton() calls wfGetMessageCacheStorage() directly instead of using $messageMemc, just in case this would be called before that variable is set
* Per TimStarling: also removed deprecated methods in MessageCache class: addMessages() and related, [get|set|enable|disable]Transform(), loadAllMessages(), loadMessageFile() and some others. Same for the legacyData stuff in LocalisationCache that was only used by MessageCache::addMessages() and related. 
* Converted remaining extensions
2011-01-26 15:42:04 +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
b3e99eec5b Followup to r79848 (and really, make it useful...)
Turn DatabaseBase::classFromType() into newFromType() factory function for constructing a new object based on a given type and (optional) params. Documented it fairly clearly.

I think it looks nicer :)
2011-01-24 16:31:36 +00:00
Niklas Laxström
c16556dd84 Partial revert of r79903, unstubbing needs localisation cache which might need database 2011-01-09 18:31:52 +00:00
Niklas Laxström
8b32822137 Follow-up r79880: check if $wgLang can be used.
Changed the checks in Database.php to use is_object because of stub objects
2011-01-09 17:08:40 +00:00
Niklas Laxström
75f8d17b07 The actual error is always in English, so wrap it in ltr element 2011-01-09 10:50:42 +00:00
Chad Horohoe
27ee520a96 Rm code that has been commented out for almost 6 years 2011-01-07 22:41:24 +00:00
Chad Horohoe
97b62e3034 Add DatabaseBase::classFromType() to reduce the 'Database' . $type duplication 2011-01-07 22:32:52 +00:00
Chad Horohoe
b61756cdea Followup r73348, r70608: move 'infinity' stuff to DB classes 2011-01-05 13:43:13 +00:00
Chad Horohoe
617395c33d Remove nasty ancient global $title (at least $wgTitle is easier to grep for), its no longer set since r78512. Afaict, this generic-named global is no longer in core.
It's not a title object, it's a string of what title= in the URL. If you want that, use WebRequest::getText() or something. Using this string is *wrong* and any extensions should be fixed (I didn't check because $title is a PITA to grep for). Don't backport to 1.17 because this is trivial, harmless, and may Break Something.

(Also made fileCachedPage private since it has no outside callers and I can't see any reason why you should)
2011-01-04 00:42:48 +00:00
Roan Kattouw
475c331f60 Remove now-unused SQL timestamp conversion functions added in r77231. They were made obsolete by the querypage-work2 branch merge in r78786 2010-12-31 16:29:44 +00:00
X!
1993c83277 -Destroy the DB automatically when initting the DB
-Add $force option to wfSetVar
-More work on getting SQLite to work
2010-12-30 17:30:35 +00:00
X!
86df2d2755 It's here! It's finally here! The skies are falling, pigs have sprouted wings, and it's pretty cold in hell!
-Add a working PHPUnit test that instantiates a new DB, adds set data, and deleted when done.
-Add listTables() to the Database classes (only MySql and SQLite use it, and only MySQL is tested)
2010-12-28 17:15:50 +00:00
Chad Horohoe
a61b389ff4 Nitpick r79094: fix var names 2010-12-28 01:22:38 +00:00
Chad Horohoe
3a9a451e8c Followup r79093: Move DROP TABLE code to Database classes and properly rename back to original table prefix in destroyDatabase() 2010-12-28 01:19:16 +00:00
Chad Horohoe
8bad04279a Same as r78533, but 5 lines down 2010-12-17 15:43:16 +00:00
Chad Horohoe
ffad65b6bc Installer can handle exceptions now, also suppress possible permission errors with fopen() 2010-12-17 15:40:08 +00:00
Sam Reed
9e1251873b Access modifiers aren't valid on interfaces 2010-12-14 23:43:03 +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
9eb8f23538 Followup r77666, remove changed in database comment (no idea where that came from) 2010-12-03 23:50:00 +00:00
Sam Reed
612c934210 * (bug 26219) Show API limits for multi values in description
Also move bug 9675/r77612 RELEASE-NOTES to the correct section
2010-12-03 16:24:05 +00:00
Sam Reed
ebf546098e Documentation improvement to r77597 2010-12-03 09:57:53 +00:00
Sam Reed
b0efc1a61c Per MaxSem CR on r77597, make $alias paramater optional, as per the documentation 2010-12-03 09:40:11 +00:00
Sam Reed
22ab89938f Per Roans request, Merge in r65475 (Database.php only) from querypage-work2 branch 2010-12-02 19:39:32 +00:00
Antoine Musso
5cdd7614d5 pipe does not look nice in doxygen. fu r77499 2010-12-02 19:33:15 +00:00
Sam Reed
7320879184 Few braces and spaces
Fixing up documentation
2010-11-30 19:06:28 +00:00
Platonides
bd6b4d7af8 Replace addslashes with Database::addQuotes() 2010-11-30 18:21:55 +00:00
Platonides
6e81d60086 Fix potential html injection when the database server isn't available (bug 26164).
Wikis which set $wgServer in their LocalSettings or are in a virtual
host would never be vulnerable.
For sites which show the wiki in the default host, it will depend on how
forgiving is their webserver and php stack for that garbled input, although 
some kind of foolable proxy —moreover wrongly caching errors (or the default 
output buffering is disabled and something incorrectly sent a previous text)—
would also need to be present in order to make that useful for a 
potential attacker.
2010-11-29 16:34:28 +00:00
Mark A. Hershberger
bdf0b5efc7 revert r77271 since it was an expensive fix to a non-existant problem. 2010-11-26 02:37:28 +00:00
Mark A. Hershberger
028d32b0ff Give SQLite a translation for MySQL's UNIX_TIMESTAMP() functions. Pg will probably need something similar. 2010-11-25 07:39:51 +00:00
Alexandre Emsenhuber
6cb276056b Moved switches in Special:Unusedimages and Special:Ancientpages to extract a unix timestamp from a fielf to DatabaseBase and related classes to avoid code duplication 2010-11-24 15:40:25 +00:00
Max Semenik
f134f2f134 Fix PHP 5.2 compatibility for r77144 2010-11-23 14:08:46 +00:00
Max Semenik
42e8644437 This indexInfo() belongs to MySQL 2010-11-23 11:14:48 +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
Alexandre Emsenhuber
2bdeabdcc3 @fixme command doesn't exist in doxygen 2010-11-19 11:49:47 +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