Commit graph

74 commits

Author SHA1 Message Date
Alexandre Emsenhuber
3114dbea04 Replace $wgConf->localVHosts by $wgLocalVirtualHosts
The former is independent of the remaining of the SiteConfiguration
class, and as thus makes more sense to be defined as an explicit
configuration setting rather that being hidden in $wgConf.

Change-Id: I25204d37c5cfffb6953fe53e14316dc3df5b5b10
2014-10-03 03:54:44 -07:00
Alex Monk
1a25787699 When getting remote config, if the caller requested a single setting without an array, always do that
Even if it comes from the cache. See Idfec62d5 review comments for PS43.

Change-Id: I67ceef7fec61b7f37728f120354bd886018d244e
2014-09-06 22:44:07 +01:00
jenkins-bot
7edab4aa73 Merge "Force array parameters in SiteConfiguration" 2014-07-04 19:49:44 +00:00
Alexandre Emsenhuber
a7de863d3a Don't use isset to check for null
Change isset() checks for variables that are always defined.

Change-Id: Ic96b9661d94742909c0d6b62a8eb2f6a038a774f
2014-07-04 21:20:22 +02:00
Alexandre Emsenhuber
5ef43924c9 Force array parameters in SiteConfiguration
Now that we require PHP 5.1 (for quite some time actually)
we can force method parameters to be array.

Change-Id: Ia4a262320344e05cc1625c041a3aa4ec41034ad7
2014-07-03 21:48:08 +02:00
Siebrand Mazeland
49cffd699c Make phpcs-strict pass on includes/ (2/~10)
Change-Id: I59fa9af7b16e0a5a4eb8a5cc764a605b18137316
2014-05-11 19:22:05 +00:00
umherirrender
23bb3d1cb4 Follow-Ups to "Fixed some @params documentation"
Fix of inline comments of the following patch sets:
Follow-Up: I0056b4a8df243cfc0c5f25378de48f7a35170aca
Follow-Up: I7f605aa9e117b5fd80d9b1440864fe526d2b14a5
Follow-Up: I3622f216a2ca8ac1b5e51892be9f98665f65bc36
Follow-Up: I6627ba0e76d3577c40bf2473e0f78a5ad7368634
Follow-Up: Id75b5ecf648ca50f955b3bde3307c82c4366b102
Follow-Up: I4ca5231119f33039d91da3b57a41cd40719a576b

Change-Id: Id9bbe84b2820e9db44af5783411e955f55f643d4
2014-04-23 13:39:49 +02:00
umherirrender
a3983418d5 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: I0056b4a8df243cfc0c5f25378de48f7a35170aca
2014-04-22 13:07:02 +02:00
Liangent
bc2915b722 Attempt to remove a hard-coded "wikipedia".
Change-Id: I3c1567929eaa11a6ca0f3e8d7fe73653375b595b
2013-08-09 09:32:13 +00:00
umherirrender
15ff79312d Fixed spacing and removed unneeded parenthesis
Added spaces after/before parenthesis
Removed unneeded parenthesis around some statements
Broke a long line

Change-Id: I7fbe129f7bbf524dd0598ece2a9708643f08453b
2013-05-17 16:12:08 +00:00
umherirrender
ef2f507d23 Fixed spacing in files direct in includes folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Ibb8dd102db045522d12ff939075ba7420d95ab6b
2013-04-21 06:38:49 +00: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
Aaron Schulz
04e0d75f86 [JobQueue] Use target wiki configuration for some key functions.
* getQueueTypes() now gets the config of the target wiki.
  Previously, for WMF, if an extension using jobs was not
  on aawiki, those job queues would not be seen by nextJobDB.
* Also fixed nextJobDB.php so that it no longer only considers
  jobs types known to aawiki for picking a DB for default jobs.
* Note that $wgJobTypesExcludedFromDefaultQueue should be global.
* This adds a SiteConfiguration::getConfig() function, which calls
  a new getConfiguration.php script.

Change-Id: I7e6904ead17efa407291f423a2b18e3c866d55fd
2013-02-21 05:34:42 +00:00
umherirrender
1044b0b8df fix some spacing
Change-Id: I8f976013f33c5818e4402604fe8610aa3f43b0c6
2013-02-04 20:18:33 +00:00
umherirrender
6fbbbd17ca fix some spacing
Change-Id: Ie7bb35871cc99237f3a655f7db22ca1f0646df5e
2013-01-27 14:21:50 +01:00
Antoine Musso
cb60d72be1 misc style fix
* makes booleans lower case
* add spaces before open braces

Change-Id: Id88884e08bc23d7730361ee91646f54f5e16920b
2012-12-20 16:09:25 +01:00
Reedy
7e386ab639 Minor stylize, add some braces
Couple of bits of member variable docs

Change-Id: Iccf861b1b93543f21f43c50864107ec6bb233bd1
2012-07-05 23:53:57 +01:00
Antoine Musso
f7ea837eb5 (bug 1) doc for SiteConfiguration
SiteConfiguration was lacking some basic example and a very basic
introduction.

Change-Id: I306f7427ca17b0e271784f4a3e959ca8848dabea
2012-05-31 10:16:16 +02:00
Alexandre Emsenhuber
bc9d9f1f9c Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent and removed a duplicate comment from SpecialPageFactory.php in SpecialPage.php.

Change-Id: I99dd2de7fe461f2fad4e0bd315ebc2899958a90f
2012-05-10 17:51:44 +02: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
Chad Horohoe
daacd1b3d3 Remove no-op initialise from configuration. Nothing outside of Ext:Configure needs/uses it 2011-08-04 20:55:20 +00:00
Aaron Schulz
19d66a6668 Fixed typo. w/s cleanup. 2011-07-28 07:27:40 +00:00
Chad Horohoe
ab99b52bd1 Followup r91224: stupid syntax error 2011-06-30 21:32:55 +00:00
Chad Horohoe
226b5730a3 Remove superfluous inclusion of SiteConfiguration in doMaintenance. It's in the AutoLoader and has already been initialized by DefaultSettings by this point.
As a result: rm DIY inclusion protection, since this was the only reason it was still needed.
2011-06-30 21:25:52 +00:00
Sam Reed
36cb6833e4 More documentation updates and additions
Getting bored of this tonight now I think...
2011-05-21 20:06:57 +00:00
Sam Reed
e76775e06f More unused variables 2010-11-30 18:44:50 +00:00
Alexandre Emsenhuber
289ee10df6 Fixed some doxygen warnings 2010-05-10 20:43:54 +00:00
Tim Starling
e5fbb46f51 Pass the SiteConfiguration object as a parameter to fullLoadCallback. 2009-06-12 04:11:15 +00:00
Andrew Garrett
af184614e5 Phase 1 in fixing up SiteConfiguration: Replace the hack of including InitialiseSettings.php with a generic system for loading full configuration data, involving a callback. 2009-06-02 09:49:31 +00:00
Alexandre Emsenhuber
2869888b02 Redo r39954, without regression this time. Sorry :( 2008-08-26 15:10:12 +00:00
Brion Vibber
4bbe226739 Revert r39954, 39958 "Tweaks for SiteConfiguration:"
This seems to have broken upload dirs on live site (eg http://upload.wikimedia.org/wiki/commons/6/66/Diemetrie.png in place of http://upload.wikimedia.org/wikipedia/commons/6/66/Diemetrie.png)
Please make no further changes without some regression testing...
2008-08-25 22:06:03 +00:00
Alexandre Emsenhuber
c32fec76e0 rm useless comment :) 2008-08-25 17:12:20 +00:00
Alexandre Emsenhuber
68ed90f748 Tweaks for SiteConfiguration:
* Introduced SiteConfiguration::$siteParamsCallback, a callback function that returns an array of params to define custom parameters to replace and wiki tags so that they can be used at run time (e.g. for CentralAuth or SiteMatrix), can also override SiteConfiguration::siteFromDB(). See the documentation of that variable for further information. Backward compatibility is maintened for paramters passed to SiteConfiguration::get() and similar functions but the vaules returned by the callback function will override them.
* Added SiteConfiguration::arrayMerge() for merging arrays, written by Werdna. Warning: as array_merge(), it may change numeric keys, so don't use it for settings having namespaces index in keys.
* Removed SiteFromDB hook, deprecated by the callback function
* document a bit
2008-08-25 16:46:34 +00:00
Andrew Garrett
7ce4ef5002 Only run hooks if Hooks.php has been loaded (i.e. we CAN run them) 2008-08-22 13:02:49 +00:00
Andrew Garrett
0742c5f99c *ahem* 2008-08-22 12:09:37 +00:00
Andrew Garrett
8e22becd1b Quick hook to allow reusers of SiteConfiguration to customise siteFromDB, which is pretty wikimedia-specific 2008-08-22 12:08:21 +00:00
Andrew Garrett
5a2a85a1b4 *ahem* self-revert. Something weird happened with getAll() 2008-08-20 14:12:52 +00:00
Andrew Garrett
4b5d8c21a8 Use a nice fancy deep-merge function for merging arrays in SiteConfiguration (newly written), and move the merging of config options and globals deeper into get(), so we don't need to duplicate the same functionality in the entry points. 2008-08-20 14:08:50 +00:00
Andrew Garrett
8736d07448 Add "+setting" type code (adding to the existing global) into getAll, since that is what we use on Wikimedia 2008-08-20 12:56:59 +00:00
Brion Vibber
969f3bf3ec Revert r39623 "Use array_merge_recursive instead of array_merge for merging settings."
I do not think array_merge_recursive does what you think it does. It looks like it would spectacularly corrupt things.
2008-08-19 19:05:23 +00:00
Andrew Garrett
612fdcfc53 Use array_merge_recursive instead of array_merge for merging settings. 2008-08-19 01:11:02 +00:00
Rotem Liss
ef48f1f435 Avoid notices: Before checking if retval is an array, check if it is defined. 2008-08-18 14:51:10 +00:00
Andrew Garrett
d475d6c2cb Allow use of +setting to add to that setting as it is (for arrays), rather than to replace it. Together with the previous commit to this file, we don't need to use groupOverrides/groupOverrides2 anymore 2008-08-18 12:50:30 +00:00
Andrew Garrett
0df393bb8e Allowed array-merging for site config. You can now set a setting for '+whatever', and it's the same as setting it for 'whatever', merged with the contents of the next level up. Should mean we're able to deprecate the ugly groupOverrides/groupOverrides2 syntax in InitialiseSettings.php. 2008-08-18 09:26:48 +00:00
Fran Rogers
851eaecd50 Wrapped certain tricky constructs in @cond/@endcond to prevent Doxygen
from choking on them and segfaulting.
2008-08-06 03:55:49 +00:00
Siebrand Mazeland
79d5225c0e * remove end of line whitespace
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +00:00
Tim Starling
fbfb509df5 * Introduced LBFactory -- an abstract class for configuring database load balancers and connecting to foreign DBs.
* Wrote two concrete implementations. LBFactory_Simple is for general installations. LBFactory_Multi will replace the runtime configuration used on Wikimedia and allow load-balanced connections to any DB. 
* Ported Special:Userrights, CentralAuth and OAI audit to the LBFactory system. 
* Added ForeignDBViaLBRepo, a file repository which uses LBFactory.
* Removed $wgLoadBalancer and $wgAlternateMaster
* Improved the query group concept to allow failover and lag control
* Improved getReaderIndex(), it will now try all servers before waiting, instead of waiting after each.
* Removed the $fail parameter to getConnection(), obsolete. 
* Removed the useless force() function. 
* Abstracted the replication position interface to allow for future non-MySQL support.
* Rearranged Database.php. Added a few debugging features. 
* Removed ancient benet-specific hack from waitForSlave.php
2008-03-30 09:48:15 +00:00
Tim Starling
e91d944a66 typo, thanks ialex 2008-02-06 16:53:21 +00:00
Tim Starling
3b5becc91d Allow a list of tags for settings fallback, in addition to wiki name, suffix and default. Committing for test on server. 2008-02-06 15:56:25 +00:00