Merge pull request #1091 from nlegoff/yeah-yeah-yeah

[3.8.6][PHRAS-136] Add static file mode to serve thumbnails
This commit is contained in:
Nicolas Le Goff
2014-09-24 14:07:06 +02:00
24 changed files with 828 additions and 11 deletions

View File

@@ -445,6 +445,21 @@ class databox extends base
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) {
$collection->unmount_collection($this->app);
}