request = $request; // Interperet request $this->modules = explode( '|', $request->getVal( 'modules' ) ); $this->language = $request->getVal( 'lang' ); $this->direction = $request->getVal( 'dir' ); $this->skin = $request->getVal( 'skin' ); $this->user = $request->getVal( 'user' ); $this->debug = $request->getBool( 'debug' ) && $request->getVal( 'debug' ) === 'true'; $this->only = $request->getVal( 'only' ); $this->version = $request->getVal( 'version' ); // Fallback on system defaults if ( !$this->language ) { $this->language = $wgLang->getCode(); } if ( !$this->direction ) { $this->direction = Language::factory( $this->language )->getDir(); } if ( !$this->skin ) { $this->skin = $wgDefaultSkin; } } public function getRequest() { return $this->request; } public function getModules() { return $this->modules; } public function getLanguage() { return $this->language; } public function getDirection() { return $this->direction; } public function getSkin() { return $this->skin; } public function getUser() { return $this->user; } public function getDebug() { return $this->debug; } public function getOnly() { return $this->only; } public function getVersion() { return $this->version; } public function shouldIncludeScripts() { return is_null( $this->only ) || $this->only === 'scripts'; } public function shouldIncludeStyles() { return is_null( $this->only ) || $this->only === 'styles'; } public function shouldIncludeMessages() { return is_null( $this->only ) || $this->only === 'messages'; } public function getHash() { if ( isset( $this->hash ) ) { $this->hash = implode( '|', array( $this->language, $this->direction, $this->skin, $this->user, $this->debug, $this->only, $this->version ) ); } return $this->hash; } }