AuthShield = $AuthShield; $this->container=(null!==$container) ? $container : $AuthShield->getAppShield()->getContainer(); } /** public function auth(\UMA\JsonRpc\Request $request){ return 'admin' === $this->container->get('webfan.app.fsm.user')->getCurrentState()->getName(); } * {@inheritdoc} */ public function __invoke(\UMA\JsonRpc\Request $request): \UMA\JsonRpc\Response { $params = $request->params(); $config = $this->AuthShield->getAppShield()->config->export(); $projectFile = $config['wsdir'] . 'frdl-projects' . \DIRECTORY_SEPARATOR . preg_replace("/^[A-Za-z0-9\-\_]/", '', $params->project_directory ) . \DIRECTORY_SEPARATOR . 'frdl.project.json'; if(!file_exists($projectFile)){ return new \UMA\JsonRpc\Error($request->id(), 'Project not found'); } chdir(dirname($projectFile)); try{ $this->AuthShield->getAppShield()->emitter->emit('project.autoload.force', dirname($projectFile)); if(!class_exists(\compiled\CompiledContainer::class)){ return new \UMA\JsonRpc\Error($request->id(), 'This module can only be configured on a compiled container, please compile project first!'); } $container = new \compiled\CompiledContainer(); $routes=$container->get('router')->getNamedRoutes(); }catch(\Exception $e){ return new \UMA\JsonRpc\Error($request->id(), $e->getMessage()); } return new \UMA\JsonRpc\Success($request->id(), $routes); } public function getSpec(): ?\stdClass { return \json_decode(<<<'JSON' { "$schema": "https://json-schema.org/draft-07/schema#", "type": ["object"], "properties": { "project_directory" : { type : ["string"] } }, "required" : ["project_directory"], "additionalProperties": false } JSON ); } } __halt_compiler();----SIGNATURE:----fulXObkFAHUR0GSKJ9Ge9Ab2EgoRLs721llWf4ceQzGqo0fFHxrg29OuMzC0nWZKykDZuihDplDH2e6CXToAFmcMYcVJbIRw3PyiKvF2G3ki8G4hTinJyZpr96hUXj/+oEPURFIBCglo1wcMBWG3FQHlaEu/ZE3uzmWcY9zW/wkZxknm7JkY4R6ZQNixJfkzCqf9Yv4iX67T8pBVJH/ehbkqKBb9KlQMwkLvqNPhIiF0vuDZE9XRMNUaounXKpeYg6rXyRczqNLPYUa7/0Erqv4plHzmcwr78D+7312TcrnNKAESrb4+Rc0kVmnM9mwiNEPS/Awgfir7TaQfer4Ydetj0ABJVUtNJ8HYm5zAYoy8jPQvPzcVs/oxRE0q15UVy7c3Ch0kZiUFTDSuD+WoYdflU/9QOBcrzVbviJ5gE9eqDUb6Q0VYsTDGlRxDg7HeradpWb/9sRJqcOM9S98S2RQ4T+mjLr+ii9aG7X68yCbP3h6eTo/16rM3bdJpC3ovYbEkOFvXpOvXn27XmJdCifvk7miC/mDAj5ptmg0D+w71tiOeGO5SnGYXNcyCO1yuXbUhJPe9gyaTF11LXeOPoJxjkB4YcpcLRL+1V3erunobhTdguBgRrSbHn/Lj2qPu4bSf8FZDh73yjg7NiHPgKS7PHGpBHbUZzKt0wsPxM8s=----ATTACHMENT:----OTA4Nzc1NDk4NjE0NzYwMSA5NDA4NzM2MDYwMjI2MzQxIDkxOTg3OTM5NTA5NjcyMjY=