cron.php 782 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. require __DIR__ . '/../../vendor/autoload.php';
  3. if (file_exists(__DIR__ . '/config.vm.php')) {
  4. require_once dirname(__FILE__) . '/config.php';
  5. require __DIR__ . '/lib/vm/AbstractVM.php';
  6. require __DIR__ . '/lib/vm/VMInterface.php';
  7. require __DIR__ . '/lib/vm/DigitalOceanVM.php';
  8. require __DIR__ . '/lib/VM.php';
  9. $config = require __DIR__ . '/config.vm.php';
  10. $vm = new VM($config);
  11. if ($vm->IsEnabled()) {
  12. $bbb = new bbb();
  13. if ($bbb->plugin_enabled) {
  14. $activeSessions = $bbb->getActiveSessionsCount();
  15. if (empty($activeSessions)) {
  16. $vm->runCron();
  17. } else {
  18. echo "Can't run cron active sessions found: " . $activeSessions;
  19. }
  20. }
  21. }
  22. }