Movatterモバイル変換


[0]ホーム

URL:


MediaWiki master
SpecialPageData.php
Go to the documentation of this file.
1<?php
7namespaceMediaWiki\Specials;
8
9useMediaWiki\Exception\HttpError;
10useMediaWiki\LinkedData\PageDataRequestHandler;
11useMediaWiki\SpecialPage\UnlistedSpecialPage;
12
21classSpecialPageDataextendsUnlistedSpecialPage {
22
26private $requestHandler =null;
27
28publicfunction__construct() {
29 parent::__construct('PageData' );
30 }
31
40publicfunctionsetRequestHandler(PageDataRequestHandler $requestHandler ) {
41 $this->requestHandler = $requestHandler;
42 }
43
48protectedfunctioninitDependencies() {
49if ( $this->requestHandler ===null ) {
50 $this->requestHandler = $this->newDefaultRequestHandler();
51 }
52 }
53
59privatefunction newDefaultRequestHandler() {
60returnnewPageDataRequestHandler();
61 }
62
70publicfunctionexecute( $subPage ) {
71 $this->initDependencies();
72
73// If there is no title, show an HTML form
74// TODO: Don't do this if HTML is not acceptable according to HTTP headers.
75if ( !$this->requestHandler->canHandleRequest( $subPage, $this->getRequest() ) ) {
76 $this->showForm();
77return;
78 }
79
80 $this->requestHandler->handleRequest( $subPage, $this->getRequest(), $this->getOutput() );
81 }
82
86publicfunctionshowForm() {
87 $this->getOutput()->showErrorPage('pagedata-title','pagedata-text' );
88 }
89}
90
95class_alias( SpecialPageData::class,'SpecialPageData' );
MediaWiki\Exception\HttpError
Show an error that looks like an HTTP server error.
DefinitionHttpError.php:23
MediaWiki\LinkedData\PageDataRequestHandler
Request handler implementing a data interface for mediawiki pages.
DefinitionPageDataRequestHandler.php:25
MediaWiki\SpecialPage\SpecialPage\getRequest
getRequest()
Get the WebRequest being used for this instance.
DefinitionSpecialPage.php:864
MediaWiki\SpecialPage\SpecialPage\getOutput
getOutput()
Get the OutputPage being used for this instance.
DefinitionSpecialPage.php:874
MediaWiki\SpecialPage\UnlistedSpecialPage
Shortcut to construct a special page which is unlisted by default.
DefinitionUnlistedSpecialPage.php:19
MediaWiki\Specials\SpecialPageData
Special page to act as an endpoint for accessing raw page data.
DefinitionSpecialPageData.php:21
MediaWiki\Specials\SpecialPageData\initDependencies
initDependencies()
Initialize any un-initialized members from global context.
DefinitionSpecialPageData.php:48
MediaWiki\Specials\SpecialPageData\setRequestHandler
setRequestHandler(PageDataRequestHandler $requestHandler)
Sets the request handler to be used by the special page.
DefinitionSpecialPageData.php:40
MediaWiki\Specials\SpecialPageData\execute
execute( $subPage)
DefinitionSpecialPageData.php:70
MediaWiki\Specials\SpecialPageData\__construct
__construct()
DefinitionSpecialPageData.php:28
MediaWiki\Specials\SpecialPageData\showForm
showForm()
Shows an informative page to the user; Called when there is no page to output.
DefinitionSpecialPageData.php:86
MediaWiki\Specials

[8]ページ先頭

©2009-2025 Movatter.jp