merge r4033 from branch 2.0 to trunk
Plugins upgrade now delete obsolete files from obsolete.list. git-svn-id: http://piwigo.org/svn/trunk@4034 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
69d4be7677
commit
6d5d2133cf
1 changed files with 21 additions and 0 deletions
|
|
@ -412,6 +412,27 @@ DELETE FROM ' . PLUGINS_TABLE . ' WHERE id="' . $plugin_id . '"';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (file_exists($extract_path.'/obsolete.list')
|
||||||
|
and $old_files = file($extract_path.'/obsolete.list', FILE_IGNORE_NEW_LINES)
|
||||||
|
and !empty($old_files))
|
||||||
|
{
|
||||||
|
array_push($old_files, 'obsolete.list');
|
||||||
|
foreach($old_files as $old_file)
|
||||||
|
{
|
||||||
|
$path = $extract_path.'/'.$old_file;
|
||||||
|
if (is_file($path))
|
||||||
|
{
|
||||||
|
@unlink($path);
|
||||||
|
}
|
||||||
|
elseif (is_dir($path))
|
||||||
|
{
|
||||||
|
if (!$this->deltree($path))
|
||||||
|
{
|
||||||
|
$this->send_to_trash($path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else $status = 'extract_error';
|
else $status = 'extract_error';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue