1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00

Add option to execute a code, every minute, or hour, or day or month

This commit is contained in:
Daniel Neto 2023-07-10 09:15:28 -03:00
parent d138f2b022
commit 89795fe843
2 changed files with 51 additions and 0 deletions

View file

@ -2848,6 +2848,45 @@ class AVideoPlugin
self::YPTend("{$value['dirName']}::" . __FUNCTION__);
}
}
public static function executeEveryHour()
{
$plugins = Plugin::getAllEnabled();
foreach ($plugins as $value) {
self::YPTstart();
$p = static::loadPlugin($value['dirName']);
if (is_object($p)) {
$p->executeEveryHour();
}
self::YPTend("{$value['dirName']}::" . __FUNCTION__);
}
}
public static function executeEveryDay()
{
$plugins = Plugin::getAllEnabled();
foreach ($plugins as $value) {
self::YPTstart();
$p = static::loadPlugin($value['dirName']);
if (is_object($p)) {
$p->executeEveryDay();
}
self::YPTend("{$value['dirName']}::" . __FUNCTION__);
}
}
public static function executeEveryMonth()
{
$plugins = Plugin::getAllEnabled();
foreach ($plugins as $value) {
self::YPTstart();
$p = static::loadPlugin($value['dirName']);
if (is_object($p)) {
$p->executeEveryMonth();
}
self::YPTend("{$value['dirName']}::" . __FUNCTION__);
}
}
}
class YouPHPTubePlugin extends AVideoPlugin

View file

@ -749,6 +749,18 @@ abstract class PluginAbstract {
function executeEveryMinute() {
}
function executeEveryHour() {
}
function executeEveryDay() {
}
function executeEveryMonth() {
}
/**