Merge "Http::getProxy() method to get proxy configuration"
[lhc/web/wiklou.git] / includes / context / DerivativeContext.php
index aaa1fa7..1b881e4 100644 (file)
@@ -26,7 +26,7 @@
  *     a different Title instance set on it.
  * @since 1.19
  */
-class DerivativeContext extends ContextSource {
+class DerivativeContext extends ContextSource implements MutableContext {
        /**
         * @var WebRequest
         */
@@ -72,6 +72,11 @@ class DerivativeContext extends ContextSource {
         */
        private $stats;
 
+       /**
+        * @var Timing
+        */
+       private $timing;
+
        /**
         * Constructor
         * @param IContextSource $context Context to inherit from
@@ -115,6 +120,19 @@ class DerivativeContext extends ContextSource {
                }
        }
 
+       /**
+        * Get the timing object
+        *
+        * @return Timing
+        */
+       public function getTiming() {
+               if ( !is_null( $this->timing ) ) {
+                       return $this->timing;
+               } else {
+                       return $this->getContext()->getTiming();
+               }
+       }
+
        /**
         * Set the WebRequest object
         *