SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-20 * * * * root lynx --dump https://workshop.fluidbook.com/maintenance/cleanDownload >/dev/null 2>/dev/null
-0 2 * * * root lynx --dump https://workshop.fluidbook.com/maintenance/deleteOldFilesFromFTP >/dev/null 2>/dev/null
-0 5 * * * root lynx --dump https://workshop.fluidbook.com/maintenance/cleanCompiledBooks >/dev/null 2>/dev/null
-40 * * * * root lynx --dump https://workshop.fluidbook.com/maintenance/cleanPackages >/dev/null 2>/dev/null
-0 1 * * * root lynx --dump https://workshop.fluidbook.com/maintenance/cleanConversionSessions >/dev/null 2>/dev/null
-*/5 * * * * root /application/bin/fixpackagerrights >/dev/null 2>/dev/null
-35 3 * * * root /application/bin/compresslogs >/dev/null 2>/dev/null
-10 * * * * root /application/bin/cleantmp >/dev/null 2>/dev/null
+20 * * * * root /usr/bin/lynx --dump https://workshop.fluidbook.com/maintenance/cleanDownload >/dev/null 2>/dev/null
+0 2 * * * root /usr/bin/lynx --dump https://workshop.fluidbook.com/maintenance/deleteOldFilesFromFTP >/dev/null 2>/dev/null
+0 5 * * * root /usr/bin/lynx --dump https://workshop.fluidbook.com/maintenance/cleanCompiledBooks >/dev/null 2>/dev/null
+40 * * * * root /usr/bin/lynx --dump https://workshop.fluidbook.com/maintenance/cleanPackages >/dev/null 2>/dev/null
+0 1 * * * root /usr/bin/lynx --dump https://workshop.fluidbook.com/maintenance/cleanConversionSessions >/dev/null 2>/dev/null
+*/5 * * * * root /application/bin/fixpackagerrights >/dev/null 2>/dev/null
+35 3 * * * root /application/bin/compresslogs >/dev/null 2>/dev/null
+10 * * * * root /application/bin/cleantmp >/dev/null 2>/dev/null
public static function cleanPackages()
{
+ echo '<pre>';
$limit = TIME - (2 * 3600); // 2 heures avant maintenant*
//
$dirs = array(
- WS_FILES . '/packager/'
+ WS_FILES . '/packager/',
+ WS_FILES . '/packager/nwbuild'
);
- // Clean downloads
+ // Clean downloads
foreach ($dirs as $dir) {
if (!file_exists($dir)) {
continue;
$dr = opendir($dir);
while ($file = readdir($dr)) {
if ($file == '.' || $file == '..') {
+ echo 'skip '.$file." (dot)\n";
continue;
}
$f = $dir . $file;
- if ($file == 'download') {
+ if ($file == 'download' || $file=='nwbuild') {
+ echo 'skip '.$file." (base)\n";
continue;
}
if (!is_dir($f)) {
+ echo 'skip '.$file." (file)\n";
continue;
}
if (filemtime($f) > $limit) {
+ echo 'skip '.$file." (time)\n";
continue;
}
+ echo 'clean '.$file."\n";
`rm -rf $f`;
}
{
$dirs = [ROOT . '/cache/download/', WS_FILES . '/packager/download'];
foreach ($dirs as $dir) {
- cubeFiles::scanRecursiveDir($dir, $files);
- $limit = TIME - 7200;
- if (is_array($files)) {
- foreach ($files as $f) {
- if (filemtime($f) < $limit) {
- unlink($f);
- }
- }
- }
+ echo `find $dir -name '*.*' -mmin +240 -delete -print`;
}
}
$portions = array_chunk($allPages, ceil($count / $it));
foreach ($portions as $p) {
- $url = 'https://workshop.fluidbook.com/maintenance/processPage/' . $book_id . '/' . implode(',', $p) . '/' . ($force ? '1' : '0') . '?PHPSESSID=' . session_id();
+ $url = 'https://workshop.fluidbook.com/maintenance/processPage/' . $book_id . '/' . implode(',', $p) . '/' . ($force ? '1' : '0');
echo $url . "\n";
self::timeoutRequest($url, 1);
}
public static function precompileImages($book_id)\r
{\r
// Begin to generate files async\r
- wsMaintenance::timeoutRequest('https://workshop.fluidbook.com/maintenance/processBookPages/' . $book_id . '?PHPSESSID=' . session_id(), 1);\r
+ wsMaintenance::timeoutRequest('https://workshop.fluidbook.com/maintenance/processBookPages/' . $book_id, 1);\r
}\r
}
\ No newline at end of file
public function isOutsidePage()
{
- if ($this->top > $this->compiler->height) {
+ $height = isset($this->compiler->config->pagesDimensions[$this->page][1]) ?: $this->compiler->height;
+ if ($this->top > $height) {
return true;
}
if ($this->left > $this->compiler->width) {
}
}
- public static function makeVideoTag($linkDatas, $w=null, $h=null, $compiler = null)
+ public static function makeVideoTag($linkDatas, $w = null, $h = null, $compiler = null)
{
if ($linkDatas->video_service == 0) {
return parent::makeVideoTag($linkDatas, $w, $h, $compiler);
// scale factor on the extracted images. It does so by dividing by 72, so we can pass our own scale
// factor by setting the resolution to 72 * $maxzoom
'resolution' => round(150 * $maxzoom),
- 'texts'=> $attributes['texts'] ?? true
+ 'texts' => $attributes['texts'] ?? true
];
// Round all link co-ordinates because there seems to be a problem with the the Workshop link editor