예제 #1
0
function getUnregisteredModules($registeredModules)
{
    $unregisteredModules = array();
    $exec_path = getExecutablePath();
    $modules = getModulesNames();
    foreach ($modules as $id) {
        if (isset($registeredModules[$id])) {
            if (strcmp($registeredModules[$id], $exec_path . "/" . $id) == 0) {
                echo $id . " is already registered \n";
            } else {
                $unregisteredModules[] = $id;
            }
        } else {
            $unregisteredModules[] = $id;
        }
    }
    return $unregisteredModules;
}
예제 #2
0
function getUnregisteredModules($client, $registeredModules)
{
    $unregisteredModules = array();
    $unregisteredModulesForHost = array();
    $modules = getModulesNames();
    foreach ($GLOBALS['COMPUTE_RESOURCE'] as $resource) {
        $unregisteredModules[$resource->host] = array();
    }
    foreach ($modules as $index => $id) {
        foreach ($GLOBALS['COMPUTE_RESOURCE'] as $resource) {
            $name = $id . "_" . $resource->host;
            $unregisteredModules[$resource->host][] = $id;
            if (isset($registeredModules[$name])) {
                foreach ($client->getAvailableAppInterfaceComputeResources($name) as $hostId => $hostName) {
                    if ($hostName == $resource->host) {
                        echo $name . " is already registered for {$hostName} \n";
                        unset($unregisteredModules[$hostName][$index]);
                    }
                }
            }
        }
    }
    return $unregisteredModules;
}