mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-13 04:53:26 +00:00
Remove links when unmounting db
This commit is contained in:
@@ -445,6 +445,21 @@ class databox extends base
|
|||||||
|
|
||||||
public function unmount_databox()
|
public function unmount_databox()
|
||||||
{
|
{
|
||||||
|
if ($this->app['phraseanet.static-file-factory']->isStaticFileModeEnabled()) {
|
||||||
|
$sql = "SELECT path, file FROM subdef WHERE `name`='thumbnail'";
|
||||||
|
$stmt = $this->get_connection()->prepare($sql);
|
||||||
|
$stmt->execute();
|
||||||
|
$rows = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
|
$stmt->closeCursor();
|
||||||
|
foreach ($rows as $row) {
|
||||||
|
$pathfile = $this->app['phraseanet.thumb-symlinker']->getSymlinkPath(sprintf(
|
||||||
|
'%s/%s',
|
||||||
|
rtrim($row['path'], '/'),
|
||||||
|
$row['file']
|
||||||
|
));
|
||||||
|
$this->app['filesystem']->remove($pathfile);
|
||||||
|
}
|
||||||
|
}
|
||||||
foreach ($this->get_collections() as $collection) {
|
foreach ($this->get_collections() as $collection) {
|
||||||
$collection->unmount_collection($this->app);
|
$collection->unmount_collection($this->app);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user