Skip to content

Instantly share code, notes, and snippets.

View Southparkfan's full-sized avatar
🔏

Ferran Tufan Southparkfan

🔏
View GitHub Profile
<?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
$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;
}
@Southparkfan
Southparkfan / gist:db847516333b38fc2d08
Last active August 29, 2015 14:09
Orain inactivity checker
$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;
@Southparkfan
Southparkfan / gist:5c1730c7a5149bcc0477
Last active August 29, 2015 14:07
MW syntax compared to WP's one
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';
}
SELECT * FROM user WHERE table_name = 1;