From 61434ebaa291ebd11cd1423ec36bb66073d55a74 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 9 Mar 2010 10:55:48 -0500 Subject: a script to flush site --- scripts/flushsite.php | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 scripts/flushsite.php (limited to 'scripts/flushsite.php') diff --git a/scripts/flushsite.php b/scripts/flushsite.php new file mode 100644 index 000000000..b7f385ac4 --- /dev/null +++ b/scripts/flushsite.php @@ -0,0 +1,45 @@ +#!/usr/bin/env php +. + */ + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); + +$shortoptions = 'd'; +$longoptions = array('delete'); + +$helptext = << +Flush the site with the given name from memcached. + +END_OF_FLUSHSITE_HELP; + +require_once INSTALLDIR.'/scripts/commandline.inc'; + +$nickname = common_config('site', 'nickname'); + +$sn = Status_network::memGet('nickname', $nickname); + +if (empty($sn)) { + print "No such site.\n"; + exit(-1); +} + +print "Flushing cache for {$nickname}..."; +$sn->decache(); +print "OK.\n"; \ No newline at end of file -- cgit v1.2.3-54-g00ecf