forked from GNUsocial/gnu-social
Merge branch 'master' of git@gitorious.org:statusnet/mainline into testing
This commit is contained in:
commit
4e6f587f86
@ -24,6 +24,8 @@ $helptext = <<<ENDOFHELP
|
|||||||
USAGE: decache.php <table> <id> [<column>]
|
USAGE: decache.php <table> <id> [<column>]
|
||||||
Clears the cache for the object in table <table> with id <id>
|
Clears the cache for the object in table <table> with id <id>
|
||||||
If <column> is specified, use that instead of 'id'
|
If <column> is specified, use that instead of 'id'
|
||||||
|
|
||||||
|
|
||||||
ENDOFHELP;
|
ENDOFHELP;
|
||||||
|
|
||||||
require_once INSTALLDIR.'/scripts/commandline.inc';
|
require_once INSTALLDIR.'/scripts/commandline.inc';
|
||||||
@ -43,8 +45,10 @@ if (count($args) > 2) {
|
|||||||
$object = Memcached_DataObject::staticGet($table, $column, $id);
|
$object = Memcached_DataObject::staticGet($table, $column, $id);
|
||||||
|
|
||||||
if (!$object) {
|
if (!$object) {
|
||||||
print "No such '$table' with $column = '$id'.\n";
|
print "No such '$table' with $column = '$id'; it's possible some cache keys won't be cleared properly.\n";
|
||||||
exit(1);
|
$class = ucfirst($table);
|
||||||
|
$object = new $class();
|
||||||
|
$object->column = $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $object->decache();
|
$result = $object->decache();
|
||||||
|
Loading…
Reference in New Issue
Block a user