dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert Special:Search input to OOUI
[lhc/web/wiklou.git]
/
includes
/
specials
/
SpecialRandompage.php
diff --git
a/includes/specials/SpecialRandompage.php
b/includes/specials/SpecialRandompage.php
index
9f7ef66
..
d7835d1
100644
(file)
--- a/
includes/specials/SpecialRandompage.php
+++ b/
includes/specials/SpecialRandompage.php
@@
-30,7
+30,7
@@
class RandomPage extends SpecialPage {
private $namespaces; // namespaces to select pages from
protected $isRedir = false; // should the result be a redirect?
class RandomPage extends SpecialPage {
private $namespaces; // namespaces to select pages from
protected $isRedir = false; // should the result be a redirect?
- protected $extra =
array()
; // Extra SQL statements
+ protected $extra =
[]
; // Extra SQL statements
public function __construct( $name = 'Randompage' ) {
$this->namespaces = MWNamespace::getContentNamespaces();
public function __construct( $name = 'Randompage' ) {
$this->namespaces = MWNamespace::getContentNamespaces();
@@
-45,7
+45,7
@@
class RandomPage extends SpecialPage {
if ( !$ns || $ns < NS_MAIN ) {
$ns = NS_MAIN;
}
if ( !$ns || $ns < NS_MAIN ) {
$ns = NS_MAIN;
}
- $this->namespaces =
array( $ns )
;
+ $this->namespaces =
[ $ns ]
;
}
// select redirects instead of normal pages?
}
// select redirects instead of normal pages?
@@
-73,7
+73,7
@@
class RandomPage extends SpecialPage {
return;
}
return;
}
- $redirectParam = $this->isRedirect() ?
array( 'redirect' => 'no' ) : array()
;
+ $redirectParam = $this->isRedirect() ?
[ 'redirect' => 'no' ] : []
;
$query = array_merge( $this->getRequest()->getValues(), $redirectParam );
unset( $query['title'] );
$this->getOutput()->redirect( $title->getFullURL( $query ) );
$query = array_merge( $this->getRequest()->getValues(), $redirectParam );
unset( $query['title'] );
$this->getOutput()->redirect( $title->getFullURL( $query ) );
@@
-86,7
+86,7
@@
class RandomPage extends SpecialPage {
*/
private function getNsList() {
global $wgContLang;
*/
private function getNsList() {
global $wgContLang;
- $nsNames =
array()
;
+ $nsNames =
[]
;
foreach ( $this->namespaces as $n ) {
if ( $n === NS_MAIN ) {
$nsNames[] = $this->msg( 'blanknamespace' )->plain();
foreach ( $this->namespaces as $n ) {
if ( $n === NS_MAIN ) {
$nsNames[] = $this->msg( 'blanknamespace' )->plain();
@@
-108,7
+108,7
@@
class RandomPage extends SpecialPage {
if ( !Hooks::run(
'SpecialRandomGetRandomTitle',
if ( !Hooks::run(
'SpecialRandomGetRandomTitle',
- array( &$randstr, &$this->isRedir, &$this->namespaces, &$this->extra, &$title )
+ [ &$randstr, &$this->isRedir, &$this->namespaces, &$this->extra, &$title ]
) ) {
return $title;
}
) ) {
return $title;
}
@@
-135,27
+135,27
@@
class RandomPage extends SpecialPage {
protected function getQueryInfo( $randstr ) {
$redirect = $this->isRedirect() ? 1 : 0;
protected function getQueryInfo( $randstr ) {
$redirect = $this->isRedirect() ? 1 : 0;
- $tables =
array( 'page' )
;
- $conds = array_merge(
array(
+ $tables =
[ 'page' ]
;
+ $conds = array_merge(
[
'page_namespace' => $this->namespaces,
'page_is_redirect' => $redirect,
'page_random >= ' . $randstr
'page_namespace' => $this->namespaces,
'page_is_redirect' => $redirect,
'page_random >= ' . $randstr
-
)
, $this->extra );
- $joinConds =
array()
;
+
]
, $this->extra );
+ $joinConds =
[]
;
// Allow extensions to modify the query
// Allow extensions to modify the query
- Hooks::run( 'RandomPageQuery',
array( &$tables, &$conds, &$joinConds )
);
+ Hooks::run( 'RandomPageQuery',
[ &$tables, &$conds, &$joinConds ]
);
- return
array(
+ return
[
'tables' => $tables,
'tables' => $tables,
- 'fields' =>
array( 'page_title', 'page_namespace' )
,
+ 'fields' =>
[ 'page_title', 'page_namespace' ]
,
'conds' => $conds,
'conds' => $conds,
- 'options' =>
array(
+ 'options' =>
[
'ORDER BY' => 'page_random',
'LIMIT' => 1,
'ORDER BY' => 'page_random',
'LIMIT' => 1,
-
)
,
+
]
,
'join_conds' => $joinConds
'join_conds' => $joinConds
-
)
;
+
]
;
}
private function selectRandomPageFromDB( $randstr, $fname = __METHOD__ ) {
}
private function selectRandomPageFromDB( $randstr, $fname = __METHOD__ ) {