cache pages
This commit is contained in:
@@ -46,16 +46,17 @@ function pdfs_init($source, $page = 1){
|
||||
if (!file_exists($source))
|
||||
return false;
|
||||
|
||||
// $result['count'] = pdfs_count($source); // количество страниц
|
||||
$result['pdfurl'] = SITE.trim(pdfs_cachefile($source), '/'); //полный файл на скачку
|
||||
|
||||
|
||||
$name = pdfs_hash($source);
|
||||
$cachedir = PGDIR.$name.'/';
|
||||
$cachefile = $name.'-'.$page.'.pdf';
|
||||
$fullcachefile = $cachedir.$cachefile;
|
||||
|
||||
if (!file_exists($fullcachefile)){
|
||||
|
||||
if (!file_exists($source))
|
||||
return false;
|
||||
|
||||
if (!is_dir($cachedir))
|
||||
mkdir($cachedir);
|
||||
|
||||
Reference in New Issue
Block a user