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 { set_time_limit(120); $params = $request->params(); $config = $this->AuthShield->getAppShield()->config->export(); $projects = []; $finder = $this->container->get('finder'); $finder->name('composer.json'); $finder->depth('< 5'); $theDir = (isset($config['wsdir']) && is_dir($config['wsdir']) ) ? $config['wsdir'] : \webfan\hps\patch\Fs::getRelativePath(getcwd(), \webfan\hps\patch\Fs::getRootDir($_SERVER['DOCUMENT_ROOT'])); foreach ($finder->in($theDir) as $file) { // $absoluteFilePath = $file->getRealPath(); // $fileNameWithExtension = $file->getRelativePathname(); $composer = json_decode($file->getContents()); if(!isset($composer->type) || 'project' !== strtolower($composer->type) ){ continue; } $projects[\webfan\hps\patch\Fs::getRelativePath($config['wsdir'] . 'frdl-projects', dirname($file->getRealPath()))] = $composer; } //try{ // return new \UMA\JsonRpc\Success($request->id(), $config); //}catch(\Exception $e){ // return new \UMA\JsonRpc\Error($request->id(), 'Could get config'); //} return new \UMA\JsonRpc\Success($request->id(), $projects); } public function getSpec(): ?\stdClass { return \json_decode(<<<'JSON' { "$schema": "https://json-schema.org/draft-07/schema#", "type": ["null", "array", "object"], "properties": { }, "required" : [], "additionalProperties": true } JSON ); } } __halt_compiler();----SIGNATURE:----q9eYnFd+brvu84w5Q3lHsbU/7EZH/VjqD9ECvUuQ4lgzCItmpRwi10HWI244nnh3nqk3PdmAvyPcRxN7GO6z3xwhF0MKJ0GwkNVL8MG7v0eCeGACNGuyBjjj0rpjX8LfKRXEbwaztDIHskUjQmHK6+y3No4rKsnke6bwxVmrCM/n9RsSHGgAjgPbRLa78a1c/g/fn8CBpa5opc8tgDx+KYcMrvghLwFf/1ZNoBWrmRaO42kxRyeCUvKDXM6iQDSF5oorICLOKCfrFVcF8ICtMHO1Yu6DbKUvPpfRgxnIGi4oYYkolbQ3CdbtrB4ClXsXYB9AkMFxhEFaiLT2k+CL1FcokglUYgiFdb4pvnPnYkqZ7jtopAmwggKvTEoq5fk1bskH1XDHMJMv2KDPoN4yYaEUrhvBOKnRsslq1CLSQwQvlZ07o3IrcGR7bhAaeVKbVPPSoIFKDaC+JRIuhN8oTnqWOmcPT822SUB9fo7H0Lq+h0HxAXdGobngBbRjeXWCm31A+oX5oJ7qFYW+CVQ+4SwYxYZKUfP57gJqFHA/iPpXH7y54RXaWDsA0ZJ9Da9bMBdoUAMKBPiA5Bv4jUQXmZ/xEUncKn306VeA/a+aZqmxRJhjiARG1b0rxcUSYuX9c182knKpTEoycI1iY7d31MTZM8IHK10Ji0wbEEtfTAA=----ATTACHMENT:----Njg5MzI5NTQyNTc3Nzc1MCA5MDQ5ODc4OTQ2MTM5NDE4IDU2NzMwNzk0ODc0MjQ2