1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 17:59:55 +02:00
Oinktube/objects/getTotalVideosInfoAsync.php
Caleb Mazalevskis 27a7925b98
Refactor.
2022-01-06 21:44:29 +08:00

22 lines
856 B
PHP

<?php
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/video.php';
//getTotalVideosInfo($status = "viewable", $showOnlyLoggedUserVideos = false,
//$ignoreGroup = false, $videosArrayId = array(), $getStatistcs = false)
session_write_close();
$status = $argv[1];
$showOnlyLoggedUserVideos = boolval($argv[2]);
$ignoreGroup = boolval($argv[3]);
$videosArrayId = _json_decode($argv[4]);
$getStatistcs = boolval($argv[5]);
$cacheFileName = $argv[6];
$lockFile = $cacheFileName . '.lock';
if (file_exists($lockFile)) {
return false;
}
file_put_contents($lockFile, 1);
$total = Video::getTotalVideosInfo($status, $showOnlyLoggedUserVideos, $ignoreGroup, $videosArrayId, $getStatistcs);
file_put_contents($cacheFileName, json_encode($total));
//_error_log(__FILE__." ".$cacheFileName.": done");
unlink($lockFile);