Added clarifying comments to IContextSource
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 7 Mar 2015 21:39:07 +0000 (13:39 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 7 Mar 2015 21:39:07 +0000 (13:39 -0800)
* Also removed some duplicated comments

Change-Id: I2c967d0f3219f3533378ecd5f9fccc40c8f9b219

includes/context/ContextSource.php
includes/context/DerivativeContext.php
includes/context/IContextSource.php
includes/context/RequestContext.php

index 076504e..83e8ef6 100644 (file)
@@ -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
@@ -17,8 +15,6 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  *
- * @since 1.18
- *
  * @author Happy-melon
  * @file
  */
@@ -26,6 +22,8 @@
 /**
  * The simplest way of implementing IContextSource is to hold a RequestContext as a
  * member variable and provide accessors to it.
+ *
+ * @since 1.18
  */
 abstract class ContextSource implements IContextSource {
        /**
index b8966f0..836aef9 100644 (file)
@@ -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
@@ -17,8 +15,6 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  *
- * @since 1.19
- *
  * @author Daniel Friesen
  * @file
  */
@@ -28,6 +24,7 @@
  * but allow individual pieces of context to be changed locally
  * eg: A ContextSource that can inherit from the main RequestContext but have
  *     a different Title instance set on it.
+ * @since 1.19
  */
 class DerivativeContext extends ContextSource {
        /**
index f718103..925666d 100644 (file)
@@ -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
  */
 
 /**
- * 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 {
        /**
index 89a0f3d..3abc986 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * Container for request-dependant objects and site configuration
- *
  * 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