<?php
/*
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, Control Yourself, Inc.
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2008, 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-if (!defined('LACONICA')) { exit(1); }
+if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
$f2p->file_id = $file_id;
$f2p->post_id = $notice_id;
$f2p->insert();
+
+ $f = File::staticGet($file_id);
+
+ if (!empty($f)) {
+ $f->blowCache();
+ }
}
if (empty($seen[$notice_id])) {
}
}
- function &pkeyGet($kv)
+ function pkeyGet($kv)
{
return Memcached_DataObject::pkeyGet('File_to_post', $kv);
}
-}
+ function delete()
+ {
+ $f = File::staticGet('id', $this->file_id);
+ if (!empty($f)) {
+ $f->blowCache();
+ }
+ return parent::delete();
+ }
+}