Last active
August 29, 2015 14:04
-
-
Save ebernhardson/25b804581549ebf21df1 to your computer and use it in GitHub Desktop.
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 | |
echo "Replace wgMemc\n"; | |
$realMemc = $wgMemc; | |
$wgMemc = new HashBagOStuff; | |
echo "Locate workflow for ", $argv[1], "\n"; | |
$workflow = Flow\Container::get( 'factory.loader.workflow' )->createWorkflowLoader( Title::newFromText( $argv[1] ) )->getWorkflow(); | |
echo "Get list of topics\n"; | |
$pager = new Flow\Data\Pager( Flow\Container::get( 'storage' )->getStorage( 'TopicListEntry' ), array( 'topic_list_id' => $workflow->getId() ), array() ); | |
echo "Get posts within topics\n"; | |
$found = Flow\Container::get( 'query.topiclist' )->getResults( $pager->getPage()->getResults() ); | |
echo "Detect all used memcache keys\n"; | |
$reflProp = new ReflectionProperty( $wgMemc, 'bag' ); | |
$reflProp->setAccessible( true ); | |
$keys = array_keys( $reflProp->getValue( $wgMemc ) ); | |
echo "Purging keys: ", implode( ', ', $keys ), "\n"; | |
foreach ( $keys as $key ) { $realMemc->delete( $key ); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment