summaryrefslogtreecommitdiff
path: root/includes/context/IContextSource.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/context/IContextSource.php')
-rw-r--r--includes/context/IContextSource.php38
1 files changed, 35 insertions, 3 deletions
diff --git a/includes/context/IContextSource.php b/includes/context/IContextSource.php
index f718103d..713c5cbf 100644
--- a/includes/context/IContextSource.php
+++ b/includes/context/IContextSource.php
@@ -1,7 +1,5 @@
<?php
/**
- * Request-dependant objects containers.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -24,7 +22,33 @@
*/
/**
- * Interface for objects which can provide a context on request.
+ * Interface for objects which can provide a MediaWiki context on request
+ *
+ * Context objects contain request-dependent objects that manage the core
+ * web request/response logic for essentially all requests to MediaWiki.
+ * The contained objects include:
+ * a) Key objects that depend (for construction/loading) on the HTTP request
+ * b) Key objects used for response building and PHP session state control
+ * c) Performance metric deltas accumulated from request execution
+ * d) The site configuration object
+ * All of the objects are useful for the vast majority of MediaWiki requests.
+ * The site configuration object is included on grounds of extreme
+ * utility, even though it should not actually depend on the web request.
+ *
+ * More specifically, the scope of the context includes:
+ * a) Objects that represent the HTTP request/response and PHP session state
+ * b) Object representing the MediaWiki user (as determined by the HTTP request)
+ * c) Primary MediaWiki output builder objects (OutputPage, user skin object)
+ * d) The language object for the user/request
+ * e) The title and wiki page objects requested via URL (if any)
+ * f) Performance metric deltas accumulated from request execution
+ * g) The site configuration object
+ *
+ * This class is not intended as a service-locator nor a service singleton.
+ * Objects that only depend on site configuration do not belong here (aside
+ * from Config itself). Objects that represent persistent data stores do not
+ * belong here either. Session state changes should only be propagated on
+ * shutdown by separate persistence handler objects, for example.
*/
interface IContextSource {
/**
@@ -100,6 +124,14 @@ interface IContextSource {
public function getConfig();
/**
+ * Get the stats object
+ *
+ * @since 1.25
+ * @return BufferingStatsdDataFactory
+ */
+ public function getStats();
+
+ /**
* Get a Message object with context set
*
* @return Message