This should be approaching completion for file OS storage. May be a few minor bugs remaining due to some late-breaking fixes but I've been testing it as I go.

This commit is contained in:
friendica
2014-01-08 18:06:52 -08:00
parent c4be3450bf
commit 6eda806444
3 changed files with 71 additions and 49 deletions

View File

@@ -679,6 +679,12 @@ function attach_change_permissions($channel_id,$resource,$allow_cid,$allow_gid,$
function attach_delete($channel_id,$resource) {
$c = q("select channel_address from channel where channel_id = %d limit 1",
intval($channel_id)
);
$channel_address = (($c) ? $c[0]['channel_address'] : 'notfound');
$r = q("select hash, flags from attach where hash = '%s' and uid = %d limit 1",
dbesc($resource),
intval($channel_id)
@@ -705,10 +711,11 @@ function attach_delete($channel_id,$resource) {
);
if($y) {
if(is_dir($y[0]['data']))
@rmdir($y[0]['data']);
elseif(file_exists($y[0]['data']))
unlink($y[0]['data']);
$f = 'store/' . $channel_address . '/' . $y[0]['data'];
if(is_dir($f))
@rmdir($f);
elseif(file_exists($f))
unlink($f);
}
}