mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 17:59:55 +02:00
25 lines
1.2 KiB
PHP
25 lines
1.2 KiB
PHP
<?php
|
|
require_once '../videos/configuration.php';
|
|
require_once $global['systemRootPath'] . 'objects/video.php';
|
|
//getAllVideosAsync($status = "viewable", $showOnlyLoggedUserVideos = false, $ignoreGroup = false, $videosArrayId = array(), $getStatistcs = false, $showUnlisted = false, $activeUsersOnly = true)
|
|
session_write_close();
|
|
$status = $argv[1];
|
|
$showOnlyLoggedUserVideos = $argv[2];
|
|
$ignoreGroup = $argv[3];
|
|
$videosArrayId = $argv[4];
|
|
$getStatistcs = $argv[5];
|
|
$showUnlisted = $argv[6];
|
|
$activeUsersOnly = $argv[7];
|
|
$_GET = object_to_array(_json_decode($argv[8]));
|
|
$_POST = object_to_array(_json_decode($argv[9]));
|
|
$cacheFileName = $argv[10];
|
|
$lockFile = $cacheFileName.".lock";
|
|
if (file_exists($lockFile) && (time() - filemtime($lockFile) < 300)) { // 5 min limit
|
|
_error_log("getAllVideos: file locked ".$lockFile." filemtime(\$lockFile) = ".filemtime($lockFile)."| (time() - filemtime(\$lockFile))=".(time() - filemtime($lockFile)));
|
|
return false;
|
|
}
|
|
file_put_contents($lockFile, 1);
|
|
$total = Video::getAllVideos($status, $showOnlyLoggedUserVideos, $ignoreGroup, $videosArrayId, $getStatistcs, $showUnlisted, $activeUsersOnly);
|
|
file_put_contents($cacheFileName, json_encode($total));
|
|
//_error_log(__FILE__." ".$cacheFileName.": done");
|
|
unlink($lockFile);
|