]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - scripts/decache.php
Merge branch '0.9.x' into 1.0.x
[quix0rs-gnu-social.git] / scripts / decache.php
index 90e1ec63c0d374411af49e07c3d6fc3d8c430f13..094bdb5aa00bd8e7f16d0938e57d51e49f61abf3 100644 (file)
@@ -1,8 +1,8 @@
 #!/usr/bin/env php
 <?php
 /*
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2009, Control Yourself, Inc.
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2009, StatusNet, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -24,6 +24,8 @@ $helptext = <<<ENDOFHELP
 USAGE: decache.php <table> <id> [<column>]
 Clears the cache for the object in table <table> with id <id>
 If <column> is specified, use that instead of 'id'
+
+
 ENDOFHELP;
 
 require_once INSTALLDIR.'/scripts/commandline.inc';
@@ -43,8 +45,10 @@ if (count($args) > 2) {
 $object = Memcached_DataObject::staticGet($table, $column, $id);
 
 if (!$object) {
-    print "No such '$table' with $column = '$id'.\n";
-    exit(1);
+    print "No such '$table' with $column = '$id'; it's possible some cache keys won't be cleared properly.\n";
+    $class = ucfirst($table);
+    $object = new $class();
+    $object->column = $id;
 }
 
 $result = $object->decache();