/** * * @param boolean $cacheConjuncts * @return void */ public static function checkProcessRules($cacheConjuncts = true) { $logger = Logger::getLogger('FW'); $session = Session::singleton(); $logger->debug("Checking process rules for active roles: " . implode(', ', array_column($session->getActiveRoles(), 'label'))); foreach ($session->rulesToMaintain as $rule) { $violations = $rule->getViolations($cacheConjuncts); foreach ($violations as $violation) { Notifications::addSignal($violation); } } }
$content = Notifications::getAll(); // Return all notifications print json_encode($content, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); }); $app->get('/admin/checks/rules/evaluate/all', function () use($app) { if (Config::get('productionEnv')) { throw new Exception("Database reinstall not allowed in production environment", 403); } foreach (Rule::getAllInvRules() as $rule) { foreach ($rule->getViolations() as $violation) { Notifications::addInvariant($violation); } } foreach (Rule::getAllSigRules() as $rule) { foreach ($rule->getViolations() as $violation) { Notifications::addSignal($violation); } } $content = Notifications::getAll(); // Return all notifications print json_encode($content, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); }); $app->get('/admin/export/all', function () use($app) { if (Config::get('productionEnv')) { throw new Exception("Export not allowed in production environment", 403); } $allAtoms = array(); foreach (Concept::getAllConcepts() as $concept) { $allAtoms[$concept->name] = $concept->getAllAtomIds(); } $allLinks = array();