Commit graph

1058 commits

Author SHA1 Message Date
jenkins-bot
9a88ac6836 Merge "Move QueryPage and abstract subclasses to specialpage folder" 2014-06-29 00:34:39 +00:00
Kunal Grover
50144cd02a First version of Page Language selector
Special page PageLanguage to set the page language of a page.
To enable the feature, set $wgPageLanguageUseDB to true
and assign the 'pagelang' user right to a user group.

Bug: 35489
Change-Id: I0f82b146fbe948f917c1c5d29f7469644d797e80
2014-06-27 23:27:07 +00:00
Kevin Israel
ffa3518ed5 Move QueryPage and abstract subclasses to specialpage folder
... now that f508561f7b ("Moved $wgQueryPages stuff out of the global
scope and into a function") has been merged, which eliminated hardcoding
of the pathname except in the AutoLoader.

WantedQueryPage is moved to a separate file.

Bug: 60445
Change-Id: If2019492722083819b82afa6302670b94b181098
2014-06-24 20:03:21 -04:00
withoutaname
ad1d07f34f Rename Parser_DiffTest class to ParserDiffTest
Change-Id: I5fca44a3fffbc60a66be32fad9ed6d1713056d81
2014-06-22 13:14:01 -07:00
withoutaname
32ac391331 Move implementations of Page to separate file
Moved implementations of the Page interface, including subclasses
of WikiPage and Article, to a separate /includes/page file.
Separated PoolWorkArticleView to the includes/poolcounter file.

Change-Id: I4557eab76e0cb12d9d7f93644c5831bdd5b472b0
2014-06-22 07:56:16 +00:00
Bartosz Dziewoński
ec1ccf4367 Separate MonoBook skin from core
This makes it behave exactly like a custom skin.

* Renamed directory to reflect skin name.
* Split skin classes to separate PHP files.
* Removed core autoloader entries for skin classes.
* Changed the hack in Setup.php to require_once the skin PHP file, as
  the skin is now registered there.
* Extracted skin-specific localisation messages.
* Extracted skin-specific resources.

Change-Id: Ife9926d12b6baaa84cd2aa9a415f1183415863c8
2014-06-21 00:01:05 +02:00
Bartosz Dziewoński
a96afeb262 Separate Vector skin from core
This makes it behave exactly like a custom skin, with the caveat that
it is still hardcoded in several places :(, most notably lots of
skinStyles in Resources.php, the installer and some tests.

* Renamed directory to reflect skin name.
* Split skin classes to separate PHP files.
* Removed core autoloader entries for skin classes.
* Changed the hack in Setup.php to require_once the skin PHP file, as
  the skin is now registered there.
* Extracted skin-specific localisation messages.
* Extracted skin-specific resources. Did not touch skinStyles yet.
* Hacked up the installer not to fall over entirely if Vector is
  missing.
* Adjusted hardcoded paths in some more places...

Change-Id: Idfffc1430790b3a104cc9835a6367137bcbf0e4e
2014-06-21 00:01:04 +02:00
Chad Horohoe
9643a0a92d Remove SearchResultTooMany
Only worked for Postgres, and only worked halfway at that. Result
sets could be false for many reasons. No results, bad query, database
went to Mars. We shouldn't assume they're always "too many results."

Leave it up to the normal query error logging and move on.

Change-Id: Ieddd163e440ae54b152541d727c1afdbc4ab4fbd
2014-06-20 10:36:47 -07:00
jenkins-bot
af2c2b6331 Merge "Capitalise Message in SpecialAllMessages files" 2014-06-17 08:54:46 +00:00
Reedy
a161ea79a2 Rename SpecialAllpages to SpecialAllPages
Change-Id: Ic137bc7adbc4a9ed96448ba0fee4807b67b3112d
2014-06-16 18:36:04 +01:00
Reedy
2dc420dd2a Capitalise Message in SpecialAllMessages files
No internal changes to Special:Allmessage etc made

Change-Id: I21a164af0b6ec123bf654cd1e4e7085b1192f067
2014-06-16 18:25:53 +01:00
Bartosz Dziewoński
9e6827d7b5 Don't use autodiscovery for core skins, move them to separate directories
Step one on the way to killing the autodiscovery mechanism and making
the core skins less intertwined with core.

This only moves the files and fixes hardcoded paths throughout core.
Any further changes will be done in separate patch(es).

Moved files:
* skins/MonoBook.php → skins/monobook/MonoBook.php
* skins/Vector.php   → skins/vector/Vector.php

Bug: 65748
Change-Id: Ib4bdda5ed3c133fce0113eb17fa39950aa812f87
2014-06-10 02:49:17 +00:00
csteipp
af66c04d39 Add HKDF as a fast, random number source
This adds an RFC 5869 compatible library for quickly generating
cryptographically secure random keys/numbers. An attacker should be
unable to predict the next number generated, as long as the secret
key (set to wgSecretKey if not explicitly defined for a wiki) remains
secret.

In my testing, this is generating random numbers about 7x faster than
MWCryptRand for 32 hex characters, and shouldn't drain openssl's
entropy source.

This will hopefully speed up maintenance tasks that require secure
random numbers, such as resetting login token, and wrapping user's
passwords in a new format.

Change-Id: I437d9aec0122a0533b0d8723fe8a8624898af909
2014-06-09 11:32:26 -07:00
jrobson
fb33b959db Move Modern and CologneBlue out of core
Import in the new repositories:

- Modern: I5348fedddf14affcee2688833f4e759e5af6499c
- CologneBlue: I9cc051f48074a033c684e5efa56a7b4dde51d366

Change-Id: I65768b4c29faf46895a7005a3090f43cf6e86258
2014-05-27 11:29:24 -07:00
jenkins-bot
5aec437d5e Merge "Make abstract Config class truly implementation-agnostic" 2014-05-27 01:43:39 +00:00
Kunal Mehta
8977e56a6b Make abstract Config class truly implementation-agnostic
Follow up to I13baec0b6 ("Config: Add Config and GlobalConfig classes"):

Config:
* Rather than returning Status objects, Config::set will now throw an exception
  if an error is encountered
* Config::factory was moved into it's own ConfigFactory class.
* Since there are no more functions in it, Config was turned into an interface.

GlobalConfig:
* Remove $prefix args from Config::set and ::get. The idea of having an
  abstract Config class is to abstract some notion of configuration data from
  the particular way in which it is currently implemented (global variables).
  So the abstract base class has no business dealing with variable name
  prefixes.
** Instead GlobalVarConfig's implementations of get and set call getWithPrefix
   and setWithPrefix internally, which are now protected
* Rename GlobalConfig to GlobalVarConfig, which makes it clearer that it isn't
  referring to the scope of the configuration value, but to the scope of the
  variable name which provides it.

ConfigFactory:
* ConfigFactory is where Config objects are registered, and later constructed.
* Config objects are registered with a given name, and a callback factory function.
  This allows for implementations to construct the object with the parameters they want,
  and avoids the overhead of needing an entire class.
** The name 'main' is the default object returned by RequestContext::getConfig(),
   and is intended to be used by core.
* This is a singleton class, the main instance can be obtained with:
  ConfigFactory::getDefaultInstance()

In addition to the above:
* $wgConfigClass was removed, and $wgConfigRegistry was introduced, which
  stores a name => callback. The name is to be what the Config instance is
  registered with, and the callback should return an implementation of Config.
* Tests were written for the new ConfigFactory, and GlobalVarConfig's tests
  were improved.

Co-Authored-By: Ori Livneh <ori@wikimedia.org>
Co-Authored-By: Chad Horohoe <chadh@wikimedia.org>
Co-Authored-By: Mattflaschen <mflaschen@wikimedia.org>
Co-Authored-By: Parent5446 <tylerromeo@gmail.com>
Co-Authored-By: Reedy <reedy@wikimedia.org>
Co-Authored-By: Daniel Kinzler <daniel.kinzler@wikimedia.de>
Change-Id: I5a5857fcfa07598ba4ce9ae5bbb4ce54a567d31e
2014-05-26 02:59:57 -07:00
Brandon Black
e323bc3393 Speed up CIDR matching from $wgSquidServersNoPurge
This adds a new generic library class IPSet, which precomputes
a reasonably-efficient data structure from the input list of
addresses and CIDR net/mask specs for fast runtime matching,
and then uses it to check trusted XFF-setters.

See also: 32b4f19f173fc5cff1029eedee63a39a2d72dd3a
Bug: 57021
Change-Id: Ia3b12fb90c3e7e492374a128943b014481cc2730
2014-05-15 17:23:12 +00:00
Siebrand Mazeland
5bc1cf4093 Remove underscore from classes WebInstaller_*
Part of program to remove underscores from class names. Checked core and
675 extensions for occurrences. All uses are in core in core are updated
in this patch. There are no uses in Gerrit extensions.

Change-Id: I6150c2d3f5a18496da5bcdcadc5d8982b70bec7a
2014-05-12 18:36:55 +02:00
Bartosz Dziewoński
1c4b578214 Remove messages.inc, rebuildLanguage.php, writeMessagesArray.inc
They are not being used anymore since the messages lists are in JSON
format, no idea why they were still here. Especially messages.inc is
just confusing everyone adding or removing messages.

Change-Id: If104ca1609e122b6871a97521065916a26734516
2014-05-12 16:00:24 +02:00
Siebrand Mazeland
c0c39640e4 Make phpcs-strict pass on includes/ (5/~10)
Change-Id: I259f3f11cfc22f3ed1693f9ebd5bd80491b8a6e8
2014-05-11 19:35:32 +00:00
Siebrand Mazeland
838a89137d Remove unused includes/utils/ConfEditor.php
It was previously used by LocalisationUpdate. After the rewrite, it was no
longer used, but in an obsolete tests file. This has been removed in
I112c7fd396c47827999c in LocalisationUpdate.

Change-Id: I8baab87c1a0c5df73b0904e4ac34b621d0d72778
2014-05-11 18:00:45 +02:00
umherirrender
0cb17f950a Remove B/C classes WatchlistEditor and IPBlockForm
There was a rename of these classes in 1.18
For backward compatibility the old name was extending the new one.

Change-Id: I8251fb00ced5c3b474f29b245d89d0d3fb2c14da
2014-05-10 17:08:58 +02:00
Siebrand Mazeland
eb9376c702 Remove underscore from classes RevDel_*
Part of program to remove underscores from class names. Checked core and
675 extensions for occurrences. All uses are in core in core are updated
in this patch. There are no uses in Gerrit extensions.

Change-Id: Ibad9afb9c696da894dab6b34ea14fb62642573ad
2014-05-10 10:01:39 +02:00
Brad Jorsch
e9d4d06276 HTMLForm: Add "cloner" type
SecurePoll is going to need the ability to have a form for stuff like
"one or more admin usernames" and "one or more poll questions, each with
one or more options".

This change implements a generic field container that simply displays as
a <ul> followed by an "add more" button, with each <li> containing
various fields including a "remove" button.

Since this is only going to show up in SecurePoll to people creating a
poll (not to general users), the current design is functional but not
necessarily beautiful. Those interested in beauty are welcome to do so
in a followup change.

Change-Id: I46fad3971739ddc961259fe32eb6e1cd265a1c06
2014-05-02 15:02:40 +00:00
jenkins-bot
b75df0e71b Merge "Provide a ResourceLoader module for language names" 2014-04-30 23:32:43 +00:00
Ed Sanders
aa9a3be1e6 Provide a ResourceLoader module for language names
These will be autonyms by default, but localised language names
when the cldr extension is installed.

Change-Id: I63402b1e7c9194f68bccddd3eb0ba47d1e59a23d
2014-04-30 14:30:25 -07:00
jenkins-bot
06db1a2335 Merge "Added VirtualRESTServiceClient/VirtualRESTService classes" 2014-04-30 03:09:54 +00:00
Aaron Schulz
4d6d11d64b Added VirtualRESTServiceClient/VirtualRESTService classes
* Reference handling cleanup for loops in MultiHttpClient
* Support a slightly more convenient request array format for MultiHttpClient
* Added missing license header to MultiHttpClient

Change-Id: Icc86ed9e4c2ac78363aa7b6f3147253bb59e2afb
2014-04-29 17:01:25 -07:00
Siebrand Mazeland
9ef0e8bb84 Pass phpcs-strict on includes/libs/CSSJanus.php
Change-Id: I184a419a225d5503c5b72909bd69624eba690b0e
2014-04-24 21:46:54 +02: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
jenkins-bot
8ad7d60445 Merge "Put class FakeConverter in its own file" 2014-04-22 10:20:02 +00:00
jenkins-bot
32e1086bfd Merge "Fixed some @params documentation (includes/*)" 2014-04-22 09:57:32 +00:00
Siebrand Mazeland
4547200454 Put class FakeConverter in its own file
Change-Id: I84b256d668579a76034ad08c3bb763d33e7ffe31
2014-04-22 11:08:06 +02:00
jenkins-bot
33ee355b26 Merge "More Profiler class refactoring" 2014-04-21 18:02:07 +00:00
Aaron Schulz
9c586d6361 More Profiler class refactoring
* Factored a ProfilerStandard class out of Profiler
* Profiler is now an abstract base class
* For b/c, using Profiler as the profiler switches to ProfilerStub
  to avoid trying to instantiate an abstract class
* Also factored out a small TransactionProfiler class
* Fixed fatal in "new ProfilerStub()" line in getInstance();
  Profiler has long since type hinted $params as an array
* Removed bogus debug var usage left in ProfilerMwprof::getRawData()
* Removed useless mTimeMetric stuff

Change-Id: I854dabba6c8b1fb7d92baca59ebd4af25878d11d
2014-04-21 10:54:51 -07:00
Siebrand Mazeland
603a35fc4e Remove underscore from classes CLDRPluralRule*
Part of program to remove underscores from class names. Checked core and 675
extensions for occurrences. All uses are in core in core are updated in this
patch. There are no uses in Gerrit extensions.

Change-Id: Id3ff16710a11ce1909a83b58505b250736a073e8
2014-04-21 19:23:37 +02:00
umherirrender
8ad1c92441 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.
Also added some missing @param.

Change-Id: I7f605aa9e117b5fd80d9b1440864fe526d2b14a5
2014-04-20 21:16:57 +02:00
Chad Horohoe
61a854fadb Remove FakeTitle
This doesn't seem to be used anywhere anymore and it's an awful class

Change-Id: Ie9047a346e410099c3082725ced83818846e95c2
2014-04-17 14:51:32 +00:00
Aaron Schulz
afa6af07d7 Profiler class refactoring
* Merged the "collate at end" and "running collate" logic
  into the base class to make it more unified and consistent.
* Pulled out DB code into ProfilerSimpleDB class.
* Removed the ProfilerSimple class and updated child classes.
* Made ProfilerSimpleTrace set the debug information too.
* Work around "ended by close()" bug from 99aef03f. Since the
  getRawData() method gets called while some wfProfileOut() calls
  have not yet happened, make it use the matched call data and let
  the final logData() method work on the full data as normal.
* Let ProfilerSimple classes use getFunctionReport() for the profiler
  debug log if it is setup instead of making it just return "".
* Made getRawData() work as best as possible with ProfilerMwprof.
* Removed $wgProfileToDatabase since it is now useless.
* Improved DB profile performance with sqlite.
* Updated visibility of various methods.

Change-Id: I1260bab2b5ba12dccbba701bcae4a637cb85c6e8
2014-04-14 16:46:55 +00:00
jenkins-bot
d6b075d238 Merge "Split CLDRPluralRuleEvaluator file" 2014-04-09 11:01:52 +00:00
addshore
fcd78a0bab Split CLDRPluralRuleEvaluator file
Change-Id: Iec9a939e3f28a600c841b89a2849f65d41763a62
2014-04-08 23:50:31 +01:00
addshore
6503a529d8 Move ConverterRule class to its own file
Change-Id: I0d743625e32f903ecd13f3c1f5aaeabdaca70f9d
2014-04-08 23:39:55 +01:00
Alexandre Emsenhuber
9e28936e81 Correctly order AutoLoader class definitions
- Group per directory
- Sort by class name for each directory

Change-Id: If4771f2868c2183f60a6321533142a1ad5cdc7cd
2014-04-05 18:30:13 +00:00
jenkins-bot
f1b45cbed4 Merge "New API module, list=prefixsearch" 2014-04-03 23:07:58 +00:00
Aaron Schulz
fbf97f572c Re-organized PoolCounter files
* No actual changes to the classes

Change-Id: I4e35a2b097e4bc72315688d0390d3f5c4c1ca4ed
2014-04-02 11:08:22 -07:00
Max Semenik
af6d9aba6d New API module, list=prefixsearch
It's pretty much like action=opensearch but can be used as a generator
which can be handy when you need to retrieve both the list of pages and
some information about them.

Change-Id: Iaffe30a0f7402e1316c4885a805692a34bbe1a6a
2014-04-02 19:14:07 +04:00
Aaron Schulz
eb03cf3f7d Added a Redis pool counter class
* This should be easier to set up for typical installs

Change-Id: Icb4a7481b944fa0818c4635e3edbe12d08af9924
2014-04-01 15:57:31 -07:00
jenkins-bot
6bd4f02747 Merge "Implement listing for tracking categories" 2014-03-30 22:44:08 +00:00
unknown
610236b467 Implement listing for tracking categories
Special page to implement list of Tracking Categories. Global
$wgTrackingCategories added containing list of tracking categories

Bug: 60333
Change-Id: I7d4bb90622a6bae60845942ef93cfe64f229d2d2
2014-03-29 14:50:39 +05:30
daniel
154bcdc63f Introducing TitleValue
TitleValue is intended to be a light weight alternative to the Title
class. Any operations on TitleValue are implemented in separate
service classes, like TitleFormatter and PageLinkRenderer. See
<https://www.mediawiki.org/wiki/Requests_for_comment/TitleValue>
for more information.

This change updates SpecialCategories and SpecialLinkSearch to use
TitleValue instead of Title, to demonstrate how TitleValue would be
used, and how the necessary services can be injected and applied.

The intention is to improve testability and reusability; these
advantages will however only become apparent with further refactoring
of the respective special pages. This will be done in follow-up
changes.

More work will be needed to migrate essential functionality from
Title and Linker classes into the respective service classes,
MediaWikiTitleCodec and MediaWikiPageLinkRenderer.

Change-Id: I8eef5a165de4ffcacfbc4911fdacdb15d502fff4
2014-03-28 18:42:17 +00:00