Commit graph

30 commits

Author SHA1 Message Date
Max Semenik
fa432176d1 Hard deprecated SiteSQLStore::newInstance()
Deprecated in 1.27, no callers.

Change-Id: Ia262790cc6804b29fee656d0f53be1374bf04c2f
2018-12-08 22:12:33 -08:00
Umherirrender
130ec2523d Fix PhanTypeMismatchDeclaredParam
Auto fix MediaWiki.Commenting.FunctionComment.DefaultNullTypeParam sniff

Change-Id: I865323fd0295aabd06f3e3c75e0e5043fb31069e
2018-07-07 00:34:30 +00:00
Kunal Mehta
e0193327bd Fix MediaWiki.Commenting.LicenseComment.InvalidLicenseTag errors
Change-Id: I936c3f5fca1a0061f215e80469f5d882cb32ee29
2018-05-23 16:23:42 -07:00
Bartosz Dziewoński
a49b3216fc Canonicalise '@deprecated since' doc comments
Change-Id: I440041512feb47a998efb45e76e3fd00e0655752
2016-08-02 22:21:57 +00:00
Catrope
1162ed5f88 Revert "Allow reset of global services."
Completely breaks login.

This reverts commit 8e7a0a0912.

Change-Id: Ide7ab5632e987e81374c21173df6ab3998649df7
2016-04-11 13:40:28 -07:00
daniel
8e7a0a0912 Allow reset of global services.
This change provides a mechanism to reset global service instances
in an orderly manner. There are three use cases for this:

* the installation process
* forking processes
* integration tests (which must of the existing phpunit tests are)

Depends-On: I5d638ad415fc3840186a0beaa09ac02ea688539b
Change-Id: Ie98bf5af59208f186dba59a9e971c72ea0b63e69
2016-04-11 16:22:40 +02:00
daniel
eb46307b00 Introduce top level service locator.
The service locator, MediaWikiServices, is intended to facilitate
"manual" dependency injection in static entry points.

See also the Dependency Injection RFC T384 and Service Locator
RFC T124792 for details.
The following key points were implemented according the
discussion surrounding these RFCs:

* a configurable DI container that allows extensions to add and replace services.
* no auto-wiring, since it's prone to add confusion in large and complex applications.
* no 3rd party framework, since they typically do too much.

The following services in MediaWiki core are made accessible via the service locator
mechanism to showcase the bootstrapping mechanism:

* ConfigFactory and MainConfig
* SiteLookup and SiteStore

However, the implementation of these services was not yet converted to using proper DI
throughout the code.

Bug: T124792
Change-Id: I3c25c0ac17300d3dd13e1cf5100558a605eee15f
2016-04-02 18:07:28 +03:00
Brad Jorsch
4191a16700 Remove ORM use from DBSiteStore
This loses something of the genericity of the former DBSiteStore (i.e.
it's now tied to MediaWiki's database and sites table, and subclasses
and users can't easily override that), but nothing in core or extensions
in Gerrit was using that genericity so it's probably no big loss.

Further, T113034 (an RFC to actually use this 'site' stuff for its
original purpose) proposes getting rid of SiteStore anyway.

Bug: T114538
Change-Id: I7e7ca257451e6307a7e5bb11fd393283d0d19e77
2015-10-06 16:20:53 -04:00
Marius Hoch
2d20b88c7d Use CACHE_ACCEL for SiteLists if on HHVM
Bug: T58602
Change-Id: I3eeedddeb79cfbee734cfe49fe86d32bf826040a
2015-07-19 18:16:33 +00:00
aude
aded554d70 Split SiteLookup interface from SiteStore
* SiteLookup interface is added, and SiteStore extends
  it. (any SiteStore type hints can be changed to use
  SiteLookup if all they need is lookup functionality)
* Memcached based SiteStore code is split from the
  database SiteStore, and SiteSQLStore is deprecated.
  If no caching is desired when using a SiteStore, then
  use a SiteDBStore instance, instead of passing $source
  parameter in SiteStore::getSite and SiteStore::getSites.
* SiteListFileCache renamed to FileBasedSiteLookup and
  implements SiteLookup.

Bug: T77990
Change-Id: I36b599884c211580ea6806a8a190c65c4f9087cf
2015-03-18 21:31:48 +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
aude
3dfde951a7 Inject cache as constructor param of SiteSQLStore
Change-Id: If1d08d4f3451b72d7d4d1c443cf2c82842ffd20f
2014-11-22 16:05:03 -05:00
aude
77863e8fba Remove deprecated (since 1.21) Sites class
this is an 'alias' for SiteSQLStore and is unused
afaik in Wikibase and elsewhere.

Change-Id: Ibee3e2a89399b97fa4de48e52c3d527714cd0731
2014-11-20 14:25:10 +00:00
umherirrender
df24b7209d Fixed spacing
- Added newline at end of file
- Removed double spaces/newlines
- Added space after if/function and parentheses/brackets
- Removed space before comma/cast
- Fixed indent of some lines

Change-Id: I29867ffdffdfb7d2b56997e9393497c7dc12f7d3
2014-09-29 20:46:19 +02:00
Aaron Schulz
56bd04b471 Replaced more trx DIY with startAtomic()
Change-Id: I76662aa438ed8aa294f8ec5973c9a51fd8b7cdbf
2014-09-16 17:26:10 -07:00
Aaron Schulz
182b331aa9 Made SiteSQLStore use startAtomic() instead of DIY
Change-Id: I3f47675646d772b4718086e2715e243da3a16bab
2014-09-16 22:53:32 +00:00
umherirrender
947c841717 Add since to @deprecated in includes/site
Follow-Up: I08ffa6a97093abbe85169f664b97498c5f39bf8e
Change-Id: I6c3e607a4f095ca0dcd2f240c0c483b90c16c13d
2014-07-21 21:19:41 +02:00
Siebrand Mazeland
5ce5092621 Pass phpcs-strict on includes/site/
Change-Id: Ibc3f29e21dd5bcfd5ea641a58f8d3f641948741d
2014-05-09 21:54:07 +02:00
umherirrender
b45420410f 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: Iced714bca004756b461b66067a49a925a7e3b877
2014-04-19 22:22:20 +02:00
umherirrender
edbd8ea6b3 Fix [missing] variables in @param docs
Two places found without variable, one without $ and one only missed a
space before $

Change-Id: Iacd7c386d57223f3a112b59cd11383ef5c0ac2f1
2014-04-06 20:11:30 +02:00
aude
6778b932ca Reduce complexity of SiteSQLStore saveSites method
split code that generates an ORMRow from a Site object

Change-Id: Ie1f7ed834a33befb43536355ad2b9b98a13d4c79
2013-09-18 22:31:40 +02:00
daniel
fe6498d7d2 Set timeout for Sites object in memcached.
Change-Id: I8964a03c5989b368e0da07b42db463cf6e732fb3
2013-02-11 20:40:12 +01:00
daniel
1915b461e0 Make Sites::singleton() actually return a singleton.
Sites::singleton() was returning a new instance for every call,
rendering in-process caching ineffective. This was causing extreme
slowness on some configurations (about factor 100).

Change-Id: I1e28afea8710b44542c55db150ad37518a5a5df1
2013-01-31 15:33:22 +01:00
aude
d514668d5c add profiling points in SiteSQLStore
Change-Id: I1699baba30c4e0fe5db185410f54d19097cc6eb6
2013-01-25 14:56:05 +00:00
jenkins-bot
587626d03a Merge "(bug 44338) set the site internal id when loading sites from the db" 2013-01-25 13:18:13 +00:00
aude
5b33ae42d9 (bug 44338) set the site internal id when loading sites from the db
Change-Id: Id0d76255e8f12ac7101b8334e3968cdbf4b04851
2013-01-25 13:03:21 +00:00
daniel
93be12f54d Add a method to clear the site list programmatically.
Change-Id: Iecee9c4d52676f95845517a5b5dbcb500ea66cc4
2013-01-24 18:18:59 +00:00
daniel
ae9f19ab52 Clear caches automatically when changing site list.
This introduces SiteSQLStore::reset() and calls it in all
methods that modify the site list.

Change-Id: If865ac16f7e79df9999db27ebe22aea5a0bc9a6b
2013-01-24 19:10:19 +01:00
daniel
f556c7f2ae Fix cache key used by SiteSQLStore.
This makes sure that SiteSQLStore uses a cache key that includes
information about the serialization structure as well as where the
list of sites was loaded from.

This avoids problems with loading "old" serialized versions from the
cache after an upgrade. It also avoids cache conflicts with site lists
loaded from different places.

Change-Id: I7ad5b8ae63dc24598d41b2f150df7c14105d9f62
2013-01-24 14:58:25 +01:00
jeroendedauw
a00337c3f8 Design improvements to sites code
Change-Id: I08ffa6a97093abbe85169f664b97498c5f39bf8e
2013-01-22 15:39:23 +01:00