mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
17 lines
606 B
PHP
17 lines
606 B
PHP
<?php
|
|
require_once '../videos/configuration.php';
|
|
require_once $global['systemRootPath'] . 'objects/video_statistic.php';
|
|
_session_write_close();
|
|
//getTotalLastDays($video_id, $numberOfDays)
|
|
$videos_id = $argv[1];
|
|
$numberOfDays = boolval($argv[2]);
|
|
$cacheFileName = $argv[3];
|
|
$lockFile = $cacheFileName.".lock";
|
|
if (file_exists($lockFile)) {
|
|
return false;
|
|
}
|
|
file_put_contents($lockFile, 1);
|
|
$total = VideoStatistic::getTotalLastDays($video_id, $numberOfDays);
|
|
file_put_contents($cacheFileName, json_encode($total));
|
|
_error_log(__FILE__." ".$cacheFileName.": done");
|
|
unlink($lockFile);
|