Commit graph

45 commits

Author SHA1 Message Date
Kunal Mehta
f6e5079a69 Use mediawiki/at-ease library for suppressing warnings
wfSuppressWarnings() and wfRestoreWarnings() were split out into a
separate library. All usages in core were replaced with the new
functions, and the wf* global functions are marked as deprecated.

Additionally, some uses of @ were replaced due to composer's autoloader
being loaded even earlier.

Ie1234f8c12693408de9b94bf6f84480a90bd4f8e adds the library to
mediawiki/vendor.

Bug: T100923
Change-Id: I5c35079a0a656180852be0ae6b1262d40f6534c4
2015-06-11 18:49:29 +00:00
Ricordisamoa
2ae155da52 Fix phpcs errors in includes/
Mostly Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines

Change-Id: I678b2f0902f11cd1dfa1611b9da24e7237df9122
2015-01-08 20:15:07 +01:00
Chad Horohoe
aa21e125a3 Remove obvious function-level profiling
Xhprof generates this data now. Custom profiling of various
sub-function units are kept.

Calls to profiler represented about 3% of page execution
time on Special:BlankPage (1.5% in/out); after this change
it's down to about 0.98% of page execution time.

Change-Id: Id9a1dc9d8f80bbd52e42226b724a1e1213d07af7
2015-01-07 11:14:24 -08:00
umherirrender
c2de24efcd Add missing @param to function docs
Change-Id: Ib7ac94d05a04490f25dfd40b46b27973cbab582c
2014-08-14 19:38:57 +00:00
Brian Wolff
8c953947ff rm $wgCountTotalSearchHits. It was broken.
If $wgCountTotalSearchHits was set to true, then the total
number of hits returned was zero, which caused Special:Search
to display no results.

I'm opting to remove the feature (although I don't have any
strong opinions about removal vs changing Special:Search), since
if someone both cares about performance and has a wiki where its
big enough to matter, they are going to need to use Cirrus anyways.

Change-Id: I1c3b908ae5423ce3dfbdc22b1a68dd81a85698aa
2014-07-08 03:41:13 -03:00
Kevin Israel
b43ac16fcc Remove use of strencode() outside Database classes
Change-Id: Idbc38d8089541e5154b2601297b429f7433fd59e
2014-06-02 13:45:26 -04:00
Siebrand Mazeland
b1aa60af25 Pass phpcs-strict on includes/search/
Change-Id: Ia38af607b1f2a8e49f60f1a659a14b801e7dcda0
2014-05-09 22:32:17 +02:00
Chad Horohoe
b826ba0bf3 Don't call legalSearchChars() statically so it can properly inherit
Change-Id: Iaabc10ce2905eefe9de8bceeec3290082ba9eb2e
2014-05-05 13:34:02 -07:00
Chad Horohoe
ff00b052ce Clean up database-backed SearchResultSets
SqlSearchResultSet basically handles all of the work in a DB-agnostic
manner. Remove specific implementations for MySQL, Mssql and Sqlite

Change-Id: Iae3fd5cc40dfbc50917be73d7ace668681e4148a
2014-04-22 12:56:36 -07:00
umherirrender
dcf6955e5c Fixed some @params documentation (includes/*)
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.

Change-Id: Ifbb1da2a6278b0bde2a6f6ce2e7bd383ee3fb28a
2014-04-20 23:33:05 +02:00
Chad Horohoe
7e8c48ac3d Remove "include redirects" option from search
Always include redirects. Search results are worse without them
and MWSearch has never respected this option anyway.

Change-Id: I0ebe321a3b14e7960aa98e3225dc5a19ba916e7d
2014-03-26 09:28:26 -07:00
Ladsgroup
a90f1a2d79 Changing URLs of mediawiki.org in scripts to the SSL-based website
http://www.mediawiki.org --> https://www.mediawiki.org

Part 3

Change-Id: Ica633881b1744fa2854f4b012b79dbf5a7e5e7e2
2014-03-13 22:28:14 +00:00
Chad Horohoe
110eb02f3a Begin abstracting more of the database-specific search backend out
There's a lot in the base search implementations that is specific
to the database backed search. This starts moving some of that out
into a shared base class for those.

For starters, let's not grab a connection to the slave DB for
every single search for backends unless they need it.

Change-Id: Ib66696841eea901e04b21dd309784af889a45ab1
2014-01-21 17:53:16 -08:00
Chad Horohoe
e0f48d66b4 Support search update for MySQL search engine
Since change I2063fe0 SearchMySQL does not do a search update anymore.

Bug: 53408
Change-Id: I7ccd033c13f4dd622dde7ac97c56f68474780ef2
2013-08-29 14:05:53 -07:00
Chad Horohoe
96fb0c4d71 Support updating search index when page is deleted
Right now, if you delete a page then you end up with a stale
entry in the search index, this affects all core SQL-based
searches.

For extensions, this means they no longer have to implement
something like ArticleDelete, they can just add the delete()
method to their SearchEngine subclass.

Change-Id: I9d8a9878aeebc53f453ab1cbacc03fe73fcca949
2013-06-18 17:41:13 -04:00
umherirrender
9f14ecf829 Added space after switch/Removed spaces after unset
While at it, added/removed some other spaces in the same files

Change-Id: I84d8001aa123a008807ad5eb76f396aed7c899a4
2013-04-26 16:42:31 +02:00
umherirrender
6c38a5eb72 Fixed spacing in logging/parser/profiler/rl/revdel/search folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: I11bbcfa351e945b7bde10c2105d61a3cf5622205
2013-04-20 17:38:24 +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
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
umherirrender
be90ce07b3 fix some spacing
Change-Id: I93f0a87ba7129bc336083e7289247d3150feb606
2013-02-04 19:54:07 +00: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
Antoine Musso
fc6bc233be Fix doxygen docs before REL1_19 branching 2012-02-01 20:53:38 +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
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
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
Sam Reed
0b5d5960af Fix r80982, re-add accidental removed AND during debugging 2011-01-25 19:58:20 +00:00
Sam Reed
5bdf93c6bc Followup r80856, don't unconditionally add the "AND" as if '' is returned by a function, we can get some silly errors (Yay for crappily built SQL strings)
Remove trailing whitespace
2011-01-25 19:56:58 +00:00
Sam Reed
2e7a059abb Fixup usage of raw sql in Title
Followup r80856, add missing __METHOD__
2011-01-24 15:30:35 +00:00
Sam Reed
668323434d Start another attack on raw sql queries 2011-01-24 13:59:22 +00:00
Platonides
a85f03a94f Move storing of $db down to SearchEngine
Fixes the r76809 issue of SearchDbTest not being marked as requiring a Database.
2010-11-22 16:08:12 +00:00
Chad Horohoe
9e6c7cc8ef Get rid of PHP4-style constructors 2010-08-30 16:52:51 +00:00
Alexandre Emsenhuber
25ee5e7ae9 * standardised file headers
* added a basic description
* added @file
2010-08-08 10:44:59 +00:00
Mark A. Hershberger
92ed21f0ab follow-up r61856 — wordsegmentation should be done for all search engines, not just mysql 2010-03-09 04:19:55 +00:00
Philip Tzou
d6b6766f3a Follow up r60742, r60743, r60764, r60766, r61214, r61390. Split stripForSearch into wordSegmentation and normalizeForSearch. So the wordSegmentation could be called by search engines separately. 2010-02-02 15:09:01 +00:00
Max Semenik
eff719b75d Fixed r61214: moved MySQL munging to SearchEngine, updated calls. Can we kill $doStrip now? 2010-01-22 20:36:26 +00:00
Max Semenik
5280fbe949 Renamed $wgSearchMySQLTotalHits to $wgCountTotalSearchHits, since such functionality also exists in SearchSqlite. No migration needed, as it was added in 1.16. 2010-01-13 15:29:24 +00:00
Max Semenik
4b0299a765 Severely refactored the SearchResultSet descendants system, consolidating most od the code into one class. Ping r58322. 2010-01-09 14:30:55 +00:00
Chad Horohoe
7196442927 Move search related includes to includes/search/ 2009-07-30 22:45:38 +00:00
Renamed from includes/SearchMySQL.php (Browse further)