Commit graph

111 commits

Author SHA1 Message Date
yaron
13b2fe802e New hook, 'SearchResultInitFromTitle'
This hook lets you change the revision ID used for a page (a Title
object), when displaying that page in search results. It's useful for
the Approved Revs extension, so that pages whose approved revision is
not their latest can have their approved revision, not the latest one,
show up when doing a search text. It's also potentially useful for
other, similar extensions, like FlaggedRevs.

Change-Id: Ic4bad8dfaa83de131db9c8e7667d7f5767d8d5f5
2012-09-05 20:03:09 +04: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
Aaron Schulz
eb183bac87 Revision and WikiPage cleanup with IDBAccessObject interface.
* Replaced WikiPage::DATA_FROM_* constants with IDBAccessObject ones.
* Renamed IDBAccessObject constants a bit for visual consistency.
* Removed AVOID_MASTER parameter and replaced calling instances with READ_NORMAL.
  Instead of getting page_latest from the master and the revision from a
  slave, just get it all from the master in one RTT. Most callers used
  AVOID_MASTER (and now READ_NORMAL), so this case is barely hit anymore.

Change-Id: Ifbefdcd4490094b38e49bbb46c95fdb71b5c9e1a
2012-08-08 16:34:08 +00:00
Antoine Musso
ef9534313e prevents some doxygen warnings
This patch fix misc issues reported by doxygen. Nothing fancy.

Change-Id: I98edc8c877019f1dc4a82a37bca518df2eb904fc
2012-07-15 22:32:48 +02:00
Aaron
8288b34eae Reduced some master queries by adding flags to Revision functions.
* The main Revision functions now allow various QoS and locking flags.
* Added tiny DBAO interface add made Revision implement it.
  Since a lot of objects will need (or have) the same functionality.
* Use "self" keyword in Revision class consistently.
* Made Revisison::newFromConds() private.

Change-Id: I3139956999218a2bb44b5c845b8079e33b2328bb
2012-06-27 20:59:20 -07:00
Alexandre Emsenhuber
e7ab34cf1d Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: If65d7313e1e05163ce6cc46d17daa310cb41888c
2012-04-28 20:41:55 +02:00
Sam Reed
09a78c1368 More return documentation 2012-02-09 21:36:14 +00:00
Sam Reed
0a626db6e1 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 19:29:36 +00:00
Sam Reed
85bbb0b080 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:10 +00:00
Antoine Musso
fc6bc233be Fix doxygen docs before REL1_19 branching 2012-02-01 20:53:38 +00:00
Alexandre Emsenhuber
7134e2c654 * Inlinise Preferences::loadOldSearchNs() in SearchEngine::userNamespaces(); the latter is the only caller of the former
* Made code clearer and removed duplication
* Marked Preferences::loadOldSearchNs() as deprecated
2012-01-20 16:12:34 +00:00
Jeroen De Dauw
49cdca93be add missing deprecation notices and added deprecation version to existing ones 2011-12-13 05:19:05 +00:00
Brion Vibber
7a8973e3e2 Apply the actual fix from r104635. :P 2011-11-30 00:37:35 +00:00
Sam Reed
5ef630a3b3 Braces, spaces, documentation 2011-11-20 18:02:38 +00:00
Sam Reed
ecfc08119b Fix spaces to tabs 2011-11-20 11:41:42 +00:00
Roan Kattouw
a123a76c8a (bug 19833) Make the searching-for-an-IP-means-you-want-Special:Contributions behavior configurable. Patch by Olivier Finlay Beaton 2011-11-14 20:00:35 +00:00
Alexandre Emsenhuber
13c8aee478 Use WikiPage instead of Article to call the hasViewableContent() method 2011-11-04 08:58:10 +00:00
Aaron Schulz
6c4360c951 Make use of Title::isSpecialPage() in various places 2011-11-02 20:55:08 +00:00
Sam Reed
9ceb44a598 Fixup some assignments in conditionals
Add/normalise some more return statements
2011-10-16 03:27:12 +00:00
Chad Horohoe
22b599e06c Refactor deferrable updates into classes & interfaces, also add helper method for the most common use case:
$wgDeferredUpdateList[] = new HTMLCacheUpdate( $title, "sometable" );

I kept b/c with $wgDeferredUpdateList for now, but seeing as only 3 exts in svn use it (FileSearch, FlaggedRevs and WikiScripts), I'd like to deprecate it pretty soon :)
2011-09-10 06:50:30 +00:00
Chad Horohoe
70430650e9 Followup r96369: update child classes and a few callers 2011-09-06 20:51:10 +00:00
Roan Kattouw
1c92b1463e Use canonical URLs (introduced in r94995) in the OpenSearch discovery thingy 2011-08-19 14:39:37 +00:00
Sam Reed
ead9055a62 Update code comments that point to 1.18 to point to 1.19 2011-07-18 23:01:08 +00:00
Sam Reed
4fc982ebd9 Fix whitespace, documentation 2011-07-09 03:49:25 +00:00
Sam Reed
16842c0b73 Swap else if for elseif
Trimming trailing whitespace also

Doing in 3 commits (2/3), so hopefully reviewable in CR...
2011-06-17 16:05:05 +00:00
Mark A. Hershberger
a6722cc9aa w/s changes. 2011-06-02 19:32:45 +00:00
Sam Reed
ba2c3a793d And even more documentation in various files 2011-05-29 14:25:20 +00:00
Sam Reed
b15737fa83 And even more documentation, the last of this batch 2011-05-28 19:00:01 +00:00
Alexandre Emsenhuber
076fe2de0d Moved MediaWiki::articleFromTitle() to Article::newFromTitle(), this has nothing to do in the MediaWiki class 2011-05-22 18:38:04 +00:00
Sam Reed
e514478ba5 Fix function level comments that start with /* not /** 2011-05-21 19:35:16 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Sam Reed
f985524076 More versions added to @deprecated tags
Couple of inbound calls fixed up

Some ancient code removed as it's been marked deprecated
2011-05-06 21:50:18 +00:00
Chad Horohoe
9502fbb44d (bug 28343) Kill unused contextlines/contextchars 2011-05-01 21:14:32 +00:00
Sam Reed
cf042b1af7 Fix code accidentally committed in r86735 2011-04-23 21:17:18 +00:00
Sam Reed
42b9b27823 Followup to r86312
<ialex> Reedy: that rev is breaking usage of {{PAGENAME}} in messages, such as in MediaWiki:Noarticles

Allowing optional passing in of a Title object (like it may be set in Message), but if it's not set, or not a title object, fall back and use $wgTitle (I'm sorry!)
2011-04-22 20:17:21 +00:00
Niklas Laxström
ce59727553 Allow extensions to customize the search forms. This required some cleanup and refactoring to special:search and search engine.
Should be fully backwards compatible. Lightly tested, but only with MySQL search backend.
Introduces concept of search profiles, which replace long list of namespaces in the url.
2011-04-22 16:13:58 +00:00
Niklas Laxström
836f7951bd Followup r86705 fix typo in comment 2011-04-22 15:16:37 +00:00
Niklas Laxström
fa70acc8cf * Remove manual query building in search mysql
* Remove reference to mysql3, no longer supported
* Changed method signatures, I found no class extending this class in extensions
* Tested lightly and returns same results
2011-04-22 13:28:03 +00:00
Max Semenik
ea0e6ea45c Fixed SearchMySQL broken by r80856 2011-04-21 05:43:52 +00:00
Happy-melon
b7e2cdba69 (bug 28583) chase down and beat to death external calls of functions marked /*private*/, and make those declarations actually binding. Patch by yuvipanda. 2011-04-18 19:03:14 +00:00
Sam Reed
a6f56411a2 Remove some unused variables/globals
Fix another unreachable statement
2011-04-16 11:28:35 +00:00
Jure Kajzer
3b916c3763 * updated tableName function changed addIdentifierQuotes, added isQuotedIdentifier and removeIdentifierQuotes
* quoting objects in Oracle is poorly supported prior to 10g (it still has bugs in 10g) so i wish to avoid it for as long as possible
* i've added /*Q*/ marker to avoid double-prefixing of table names
* tableName quoted parameter is usable only in cases where you call it directly in functions where it might occur that tableName can get called twice it is unusable as the tableName gets prefixed twice


Oracle documentation is generally crappy. They claim a lot of things but some of those claims depend on a gazillion of factors and in case of one of this factors being a bit off have no general solution. Object name quoting is one of such things and is general practice amongst oracle DBAs that if you write the code directly you can use them but if you write abstracted or embedded code it's best to stay away if you can.
2011-04-15 10:48:02 +00:00
Happy-melon
c26ecc84d1 Follow-up r85929: update MediaWiki::articleFromTitle() call in SearchEngine.php 2011-04-13 14:27:59 +00:00
Jure Kajzer
6b056de74c * fix as per brion's comment on r85669 2011-04-11 13:50:21 +00:00
Jure Kajzer
faebf89170 * r81084 added prefix to index name and as this index gets synced directly it has to use the same prefix 2011-04-08 12:45:19 +00:00
Alexandre Emsenhuber
7ad587fcc9 Respect $wgScriptExtension in SearchEngine::getOpenSearchTemplate() and SearchEngine::getMWSuggestTemplate() 2011-04-02 09:50:20 +00:00
Sam Reed
d3f043c53a Add/update/improve various bits of documentation 2011-03-25 11:21:53 +00:00
Brian Wolff
2d64c69910 (follow-up 79778) Make $wgLang->truncate function consider the length of the ... (ellipsis message) in the truncation length.
The length of this message varries by localization, so the previous solution of telling truncate to truncate 5 bytes
less than needed is not good since this will be too little or too much.

Updated places where its used. Some places I left as is, as it looked like the new behaviour would work fine for them to.
(for example, the autosummary feature - it was cutting off at 200 bytes, which is no where near 250 limit, so I presume that
was for asethic reasons rather then to fit as much in before the db limit).

Will do another commit for extension callers in a moment.
2011-03-24 02:54:11 +00:00
Sam Reed
64be8c7b26 Ununsed variables
Documentation and explicit definitions
2011-02-23 12:35:41 +00:00
Sam Reed
7d98280f3e More function and variable documentation 2011-02-19 01:02:56 +00:00