mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-12 10:18:39 +00:00
20 lines
416 B
PHP
20 lines
416 B
PHP
<?php
|
|
|
|
namespace phpOMS\Utils\TaskSchedule;
|
|
|
|
use phpOMS\System\OperatingSystem;
|
|
use phpOMS\System\SystemType;
|
|
|
|
final class SchedulerFactory {
|
|
public static function create() : ScheduleInterface
|
|
{
|
|
switch(OperatingSystem::getSystem()) {
|
|
case SystemType::WIN:
|
|
return new TaskScheduler();
|
|
case SystemType::LINUX:
|
|
return new Cron();
|
|
default:
|
|
throw new \Exception('Unsupported system.');
|
|
}
|
|
}
|
|
} |