<?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
*/
/**
- * 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) 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) 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 {
/**
/**
* Get the Title object
*
- * @return Title
+ * @return Title|null
*/
public function getTitle();
*/
public function getUser();
- /**
- * Get the Language object
- *
- * @deprecated since 1.19 Use getLanguage instead
- * @return Language
- */
- public function getLang();
-
/**
* Get the Language object
*
*/
public function getConfig();
+ /**
+ * Get the stats object
+ *
+ * @since 1.25
+ * @return BufferingStatsdDataFactory
+ */
+ public function getStats();
+
/**
* Get a Message object with context set
*