function testManifests() { $manifests = glob(CONFIG::$PATH.'/modules/registries/*/module.xml'); foreach ($manifests as $manifest) { preg_match('/(.*)\/(.*)\/module\.xml/', $manifest, $matches); $module_name = $matches[2]; try { $res = RegistryManifest::Validate($manifest); $this->assertTrue(($res === true), "{$module_name} registry module passed manifest test!"); if ($res !== true) $this->error(E_USER_ERROR, $res, null, null); } catch(Exception $e) { $this->error(E_USER_ERROR, $e->getMessage(), $e->getFile(), $e->getLine()); } } }
} // Enable modules elseif($get_action == "enable" && $get_module) { // Check if this module licensed if (!License::IsModuleLicensed($get_module)) throw new LicensingException("Your license does not permit module {$get_module}. For additional module purchases, please contact sales@webta.net"); if (CONFIG::$DEV_DEMOMODE != 1) { $get_module = preg_replace("/[^A-Za-z0-9_-]+/", "", $get_module); // Validate Manifest RegistryManifest::LoadCompiledManifest(CONFIG::$PATH."/modules/registries/{$get_module}/module.xml", true); $res = RegistryManifest::Validate(CONFIG::$PATH."/modules/registries/{$get_module}/module.xml"); if ($res !== true) { Log::Log($res, E_USER_ERROR); $errmsg = sprintf(_("Module %s XML manifest did not pass validation. The following errors occured:"), $get_module); $err[] = $res; } if (!$errmsg) { try { $Registry = $RegistryModuleFactory->GetRegistryByName($get_module, true); } catch (Exception $e) {