cron.php 799 B

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