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:----Xa5BsT+UxXw9QsHdFAqzCHM9oYRNEWqWs17GiRGX6Lucp/OWGLuuNgkVpzWUw9Q3oNAtn+BDgsovhHOR4msEM8Mck8Dofu1IN3r9TGChNQIDzHdhY6asSFZisGPunXFeJZDDd8ZltKmIfELPB2cNjlbI5wklogB4Oy7JDDFrNh0AU//df3ofa43/DVS+zU+/fjZd7S7uvcxGfyhUG/ceHOzcxAKTxkAFLeR0YYm90kduqIZlNSbMMqe/fADYKmKROcA3zrDI0hDp0RbYur0ei9K3qXUNmkCvRxG52VA+V6Iar+qELcZOr8feEGwC07FpTHNHrynx7qlRpvnGtMMNvtSC7l72Igg6hfw7AVyoZQXHwTDtSxY/jIGIdYzddVjv2TpcLsC7ZCY2Qu6hjLGAqGKhoRfRBebHTEtpW/t6VNxs/QICBhUG9SLM44XKJZLauHhM3bKYBcFi3QqafooH+GnlqoXETAZGtU/LVwcQILBVvTDTfFZ9tMs0f0vFbQWfrDacQr1MlBwfyt3p25VXcYSVipGY2xSAPVEdSEMIZ8pw2LZXRpQABZijfzZctctlXIuiJY94G9SywMHZEYS26eO5CEHjt3stADrJ+Lhk0SKazQJAvrDZBAE0I4iS8grQQX7yWEM3uLcSfOYc3iV2itpI5n2xZt4X8oOGacSs8aY=----ATTACHMENT:----ODU2NjgxNzM5OTE3NDE1MSAyMzcwMzUyODMyNjI2NjQgMjg2OTM3NjA1ODc0MTI0MA==