protected static function _isScormLink($url)
{
- if (strpos($url, 'http://') !==false || strpos($url, 'https://') !==false) {
- $res= false;
- }else {
+ if (strpos($url, 'http://') !== false || strpos($url, 'https://') !== false) {
+ $res = false;
+ } else {
$res = stristr($url, 'scorm');
}
return $res;
array_pop($e);
$name = implode('.', $e);
$pdffile = $this->wdir . $this->to;
+ $mtime = filemtime($pdffile);
$htmlfile = $this->wdir . $name . '.html';
- if (!file_exists($htmlfile)) {
+ if (!file_exists($htmlfile) || filemtime($htmlfile) < $mtime) {
$cmd = "pdftotext -f 1 -l 1 -htmlmeta $pdffile $htmlfile";
`$cmd`;
}
$infosfile = $this->wdir . $name . '.nfo';
- if (!file_exists($infosfile)) {
+ if (!file_exists($infosfile) || filemtime($infosfile) < $mtime) {
$i = `pdfinfo -f 1 -l 1 -box $pdffile`;
if (preg_match('/Page\s+1\s+size:\s+([0-9\.]+) x ([0-9\.]+)/', $i, $matches)) {
$infos = ['width' => $matches[1], 'height' => $matches[2]];
$cut = $this->wdir . $name . '.c.pdf';
$size = $this->wdir . $name . '.s.pdf';
$sinfos = $this->wdir . $name . '.s.nfo';
- if (!file_exists($cut) || !file_exists($size) || !file_exists($sinfos) || filesize($sinfos) === 0) {
+ if (!file_exists($cut) || !file_exists($size) || !file_exists($sinfos) || filesize($sinfos) === 0 || filemtime($size) < $mtime) {
// Cut the pdf in many pages
$ratio = $infos->width / $infos->height;
$nb = max(1, ceil(0.707071 / $ratio));