* member variable and provide accessors to it.
*/
abstract class ContextSource implements IContextSource {
-
/**
* @var IContextSource
*/
public function getContext() {
if ( $this->context === null ) {
$class = get_class( $this );
- wfDebug( __METHOD__ . " ($class): called and \$context is null. Using RequestContext::getMain() for sanity\n" );
+ wfDebug( __METHOD__ . " ($class): called and \$context is null. Using RequestContext::getMain() for sanity\n" );
$this->context = RequestContext::getMain();
}
return $this->context;
* Set the IContextSource object
*
* @since 1.18
- * @param $context IContextSource
+ * @param IContextSource $context
*/
public function setContext( IContextSource $context ) {
$this->context = $context;
* Get the OutputPage object
*
* @since 1.18
- * @return OutputPage object
+ * @return OutputPage
*/
public function getOutput() {
return $this->getContext()->getOutput();
/**
* Get the Language object
*
- * @deprecated 1.19 Use getLanguage instead
+ * @deprecated since 1.19 Use getLanguage instead
* @return Language
*/
public function getLang() {
* Parameters are the same as wfMessage()
*
* @since 1.18
- * @return Message object
+ * @return Message
*/
public function msg( /* $args */ ) {
$args = func_get_args();
return call_user_func_array( array( $this->getContext(), 'msg' ), $args );
}
+
+ /**
+ * Export the resolved user IP, HTTP headers, user ID, and session ID.
+ * The result will be reasonably sized to allow for serialization.
+ *
+ * @return Array
+ * @since 1.21
+ */
+ public function exportSession() {
+ return $this->getContext()->exportSession();
+ }
}