Skip to content

Instantly share code, notes, and snippets.

@Southparkfan
Last active August 29, 2015 14:09
Show Gist options
  • Save Southparkfan/db847516333b38fc2d08 to your computer and use it in GitHub Desktop.
Save Southparkfan/db847516333b38fc2d08 to your computer and use it in GitHub Desktop.
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;
}
mysqli_close($connec);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment