This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Orain's playbook is free software: you can redistribute it and/or modify it | |
* under the terms of the GNU Affero General Public License as published by the | |
* Free Software Foundation, either version 3 of the License, or (at your option) | |
* any later version. | |
* | |
* Orain's playbook is distributed in the hope that it will be useful, but WITHOUT | |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | |
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$DBlist = array_map( 'trim', file( "$IP/all.dblist" ) ); | |
$wgLocalDatabases = array(); | |
foreach ( $DBlist as $wiki ) { | |
$wikinotags = explode( '|', $wiki, 4 ); | |
list( $DBname, $siteName, $siteLang, $wikiTagList ) = array_pad( $wikinotags, 4, '' ); | |
$wgLocalDatabases[] = $DBname; | |
if ( strpos( '|closed', $wiki ) ) { | |
$wmgClosedWikis[] = $DBname; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$wikis = array('insert all the wikis'); | |
foreach ($wikis as $wiki) { | |
$connec = mysqli_connect('10.131.243.243', 'mediawiki', 'dbpass', $wiki) or die('Could not connect - ' . mysqli_connect_error($connec)); // prod3 | |
$query = mysqli_query($connec, 'SELECT rc_timestamp FROM recentchanges WHERE rc_timestamp > 20141010000000 LIMIT 1'); // check for RC entries in the last 30 days | |
# No RC entries found in the last 30 days | |
if (mysqli_num_rows($query) == 0) { | |
echo 'No RC entries in the last 30 days found for wiki ' . $wiki; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MW (deze zonder juiste indent geloof ik: | |
if ($iets == 1) { | |
echo "Hoi dit is {$iets}"; | |
} elseif ($iets == 2) { | |
echo "En dit is {$iets}"; | |
} else { | |
echo 'Doei'; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM user WHERE table_name = 1; |