Skip to content
Snippets Groups Projects
Commit 79adb5a4 authored by Alex Arnaud's avatar Alex Arnaud
Browse files

hotline #16456 - Asynchronous retrieving of web thumbnails.

This avoid timeout when a search result contains a lot of
thumbnail's web-sites to download.
parent 9f925481
Branches
Tags
4 merge requests!529Hotline 6.56,!428Master,!427Hotline 6.53,!423Hotline#16456 change the way retrieving site images
- ticket #16456: Les webthumbnails sont récupérés de manière asynchrone pour éviter un timeout lors d'une recherche.
30/09/2014 - v6.53.1
- correction compatiblité PHP5.4
......
......@@ -74,6 +74,23 @@ class SitoController extends Zend_Controller_Action {
$this->view->title = $this->view->_("Sélection de sites");
}
public function webthumbnailAction() {
$viewRenderer = $this->getHelper('ViewRenderer');
$viewRenderer->setNoRender();
session_write_close();
$url = $this->_getParam('url');
$webThumbnail = $this->view->getHelper('WebThumbnail');
$filename = $webThumbnail->fileNameFromUrl($url);
$filepath = $webThumbnail->fullPath($filename);
if (!$webThumbnail->getThumbnailer()->fetchUrlToFile($url, $filepath))
$this->_redirect('');
$this->_redirect($webThumbnail->fullUrl($filename));
}
}
?>
......@@ -33,10 +33,8 @@ class ZendAfi_View_Helper_WebThumbnail extends ZendAfi_View_Helper_BaseHelper {
$filename = $this->fileNameFromUrl($url);
$filepath = $this->fullPath($filename);
if (!file_exists($filepath)) {
if (!$this->getThumbnailer()->fetchUrlToFile($url, $filepath))
return '';
}
if (!file_exists($filepath))
return BASE_URL."/sito/webthumbnail?url=$url";
return $this->fullUrl($filename);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment