mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
Add option to execute a code, every minute, or hour, or day or month
This commit is contained in:
parent
d138f2b022
commit
89795fe843
2 changed files with 51 additions and 0 deletions
|
@ -2848,6 +2848,45 @@ class AVideoPlugin
|
||||||
self::YPTend("{$value['dirName']}::" . __FUNCTION__);
|
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
|
class YouPHPTubePlugin extends AVideoPlugin
|
||||||
|
|
|
@ -749,6 +749,18 @@ abstract class PluginAbstract {
|
||||||
|
|
||||||
function executeEveryMinute() {
|
function executeEveryMinute() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function executeEveryHour() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function executeEveryDay() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function executeEveryMonth() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue