1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00
Oinktube/objects/video_statistic_getTotalLastDays.php
daniel 9a5c483182 allow you to choose not log errors, to try to improve performance
add variable $global['noDebug'] = 1 on your configuration.php file
2020-01-05 16:52:54 -03:00

18 lines
No EOL
603 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);