'host' => $showHostnames
? $lb->getServerName( $index )
: '',
- 'lag' => intval( $lag )
+ 'lag' => $lag
];
}
public function estimateRowCount(
$table, $vars = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
) {
- $rows = 0;
$res = $this->select(
$table, [ 'rowcount' => 'COUNT(*)' ], $conds, $fname, $options, $join_conds
);
+ $row = $res ? $this->fetchRow( $res ) : [];
- if ( $res ) {
- $row = $this->fetchRow( $res );
- $rows = ( isset( $row['rowcount'] ) ) ? (int)$row['rowcount'] : 0;
- }
-
- return $rows;
+ return isset( $row['rowcount'] ) ? (int)$row['rowcount'] : 0;
}
public function selectRowCount(
if ( is_array( $table ) ) {
// A parenthesized group
if ( count( $table ) > 1 ) {
- $joinedTable = '('
- . $this->tableNamesWithIndexClauseOrJOIN( $table, $use_index, $ignore_index, $join_conds )
- . ')';
+ $joinedTable = '(' .
+ $this->tableNamesWithIndexClauseOrJOIN(
+ $table, $use_index, $ignore_index, $join_conds ) . ')';
} else {
// Degenerate case
$innerTable = reset( $table );
}
}
- return ' LIKE ' . $this->addQuotes( $s ) . ' ESCAPE ' . $this->addQuotes( $escapeChar ) . ' ';
+ return ' LIKE ' .
+ $this->addQuotes( $s ) . ' ESCAPE ' . $this->addQuotes( $escapeChar ) . ' ';
}
public function anyChar() {
margin: 0 !important; /* stylelint-disable-line declaration-no-important */
}
-#toc,
.toc {
background-color: #f9f9f9;
border: 1pt solid #aaa;
border: 0;
}
-#toc,
.toc {
border: 1px solid #bba;
background-color: #f7f8ff;
}
/* CSS for backwards-compatibility with cached page renders and creative uses in wikitext */
-table#toc,
table.toc {
border-collapse: collapse;
}
/* Remove additional paddings inside table-cells that are not present in <div>s */
-table#toc td,
table.toc td {
padding: 0;
}
-#toc h2,
.toc h2 {
display: inline;
border: 0;
font-weight: bold;
}
-#toc ul,
.toc ul {
list-style-type: none;
list-style-image: none;
text-align: left;
}
-#toc ul ul,
.toc ul ul {
margin: 0 0 0 2em;
}
font-size: 100%;
}
-/* use this instead of #toc for page content */
+/* use this instead of .toc for page content */
.toccolours {
border: 1px solid #aaa;
background-color: #f9f9f9;
list-style-type: oriya;
}
-#toc ul,
.toc ul {
margin: 0.3em 0;
}
/* Correct directionality when page dir is different from site/user dir */
/* @noflip */ .mw-content-ltr .toc ul,
-.mw-content-ltr #toc ul,
-.mw-content-rtl .mw-content-ltr .toc ul,
-.mw-content-rtl .mw-content-ltr #toc ul {
+.mw-content-rtl .mw-content-ltr .toc ul {
text-align: left;
}
/* @noflip */ .mw-content-rtl .toc ul,
-.mw-content-rtl #toc ul,
-.mw-content-ltr .mw-content-rtl .toc ul,
-.mw-content-ltr .mw-content-rtl #toc ul {
+.mw-content-ltr .mw-content-rtl .toc ul {
text-align: right;
}
/* @noflip */ .mw-content-ltr .toc ul ul,
-.mw-content-ltr #toc ul ul,
-.mw-content-rtl .mw-content-ltr .toc ul ul,
-.mw-content-rtl .mw-content-ltr #toc ul ul {
+.mw-content-rtl .mw-content-ltr .toc ul ul {
margin: 0 0 0 2em;
}
/* @noflip */ .mw-content-rtl .toc ul ul,
-.mw-content-rtl #toc ul ul,
-.mw-content-ltr .mw-content-rtl .toc ul ul,
-.mw-content-ltr .mw-content-rtl #toc ul ul {
+.mw-content-ltr .mw-content-rtl .toc ul ul {
margin: 0 2em 0 0;
}
-#toc #toctitle,
-.toc #toctitle,
-#toc .toctitle,
.toc .toctitle {
direction: ltr;
}
*/
/* Table of Contents */
-#toc,
.toc,
.mw-warning,
.toccolours {
* inline elements. In practice inline elements surrounding the TOC are uncommon enough that
* this is an acceptable sacrifice.
*/
-#toc,
.toc {
display: inline-block;
display: table;
}
/* CSS for backwards-compatibility with cached page renders and creative uses in wikitext */
-table#toc,
table.toc {
border-collapse: collapse;
}
/* Remove additional paddings inside table-cells that are not present in <div>s */
-table#toc td,
table.toc td {
padding: 0;
}
-#toc h2,
.toc h2 {
display: inline;
border: 0;
font-weight: bold;
}
-#toc #toctitle,
-.toc #toctitle,
-#toc .toctitle,
.toc .toctitle {
text-align: center;
}
-#toc ul,
.toc ul {
list-style-type: none;
list-style-image: none;
text-align: left;
}
-#toc ul ul,
.toc ul ul {
margin: 0 0 0 2em;
}
-#toc.tochidden,
.toc.tochidden,
.toctoggle {
display: none;
--- /dev/null
+'use strict';
+const merge = require( 'deepmerge' ),
+ username = 'Selenium user',
+ wdioConf = require( './wdio.conf.js' );
+
+// Overwrite default settings
+exports.config = merge( wdioConf.config, {
+ username: process.env.MEDIAWIKI_USER === undefined ?
+ username :
+ process.env.MEDIAWIKI_USER,
+ password: process.env.MEDIAWIKI_PASSWORD,
+ baseUrl: (
+ process.env.MW_SERVER === undefined ?
+ 'https://en.wikipedia.beta.wmflabs.org:443' :
+ process.env.MW_SERVER
+ ) + (
+ process.env.MW_SCRIPT_PATH === undefined ?
+ '/w' :
+ process.env.MW_SCRIPT_PATH
+ )
+} );