예제 #1
0
 function isPermited(Host &$host, VM &$vm)
 {
     if (is_null($this->matrix)) {
         throw new Exception("TestingWithoutMatrix", 1);
     }
     return isset($this->matrix[$host->getId()][$vm->getId()]) ? $this->matrix[$host->getId()][$vm->getId()] : false;
 }
예제 #2
0
<?php

require __DIR__ . '/../../vendor/autoload.php';
if (file_exists(__DIR__ . '/config.vm.php')) {
    require_once dirname(__FILE__) . '/config.php';
    require __DIR__ . '/lib/vm/AbstractVM.php';
    require __DIR__ . '/lib/vm/VMInterface.php';
    require __DIR__ . '/lib/vm/DigitalOceanVM.php';
    require __DIR__ . '/lib/VM.php';
    $config = (require __DIR__ . '/config.vm.php');
    $vm = new VM($config);
    if ($vm->IsEnabled()) {
        $bbb = new bbb();
        if ($bbb->plugin_enabled) {
            $activeSessions = $bbb->getActiveSessionsCount();
            if (empty($activeSessions)) {
                $vm->runCron();
            } else {
                echo "Can't run cron active sessions found: " . $activeSessions;
            }
        }
    }
}
예제 #3
0
                ),
                'success',
                false
            );

            if (file_exists(__DIR__ . '/config.vm.php')) {
                require __DIR__ . '/../../vendor/autoload.php';

                require __DIR__ . '/lib/vm/AbstractVM.php';
                require __DIR__ . '/lib/vm/VMInterface.php';
                require __DIR__ . '/lib/vm/DigitalOceanVM.php';
                require __DIR__ . '/lib/VM.php';

                $config = require __DIR__ . '/config.vm.php';

                $vm = new VM($config);
                $vm->resizeToMinLimit();
            }

            break;
        case 'publish':
            $result = $bbb->publishMeeting($_GET['id']);
            break;
        case 'unpublish':
            $result = $bbb->unpublishMeeting($_GET['id']);
            break;
        default:
            break;
    }
}
예제 #4
0
$host = null;
$salt = null;
$bbb = new bbb();
if ($bbb->plugin_enabled) {
    if ($bbb->isServerRunning()) {
        if (isset($_GET['launch']) && $_GET['launch'] == 1) {
            if (file_exists(__DIR__ . '/config.vm.php')) {
                $config = (require __DIR__ . '/config.vm.php');
                $vmIsEnabled = true;
                $host = null;
                $salt = null;
                require __DIR__ . '/lib/vm/AbstractVM.php';
                require __DIR__ . '/lib/vm/VMInterface.php';
                require __DIR__ . '/lib/vm/DigitalOceanVM.php';
                require __DIR__ . '/lib/VM.php';
                $vm = new VM($config);
                if ($vm->IsEnabled()) {
                    try {
                        $vm->resizeToMaxLimit();
                    } catch (\Exception $e) {
                        echo $e->getMessage();
                        exit;
                    }
                }
            }
            $meeting_params = array();
            $meeting_params['meeting_name'] = api_get_course_id() . '-' . api_get_session_id();
            if ($bbb->meetingExists($meeting_params['meeting_name'])) {
                $url = $bbb->joinMeeting($meeting_params['meeting_name']);
                if ($url) {
                    $bbb->redirectToBBB($url);
예제 #5
0
<?php

require 'VM.php';
$vm = new VM('challenge.bin');
$vm->run();