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(); } */ public function __invoke(\UMA\JsonRpc\Request $request): \UMA\JsonRpc\Response { $config = $this->AuthShield->getAppShield()->config->export(); $params = $request->params(); $path=$params[0]; $path = str_replace('//', '/', $path); $path = str_replace('/', \DIRECTORY_SEPARATOR, $path); $original_path=$path; if(!file_exists($path)){ $path = $config['wsdir'] . $original_path; } if(!file_exists($path)){ $path = $config['wsdir'] . \DIRECTORY_SEPARATOR . $original_path; } if(!file_exists($path)){ $path = $config['wsdir'] . 'frdl-projects' . $original_path; } if(!file_exists($path)){ $path = $config['wsdir'] . 'frdl-projects' . \DIRECTORY_SEPARATOR . $original_path; } if(!file_exists($path)){ return new \UMA\JsonRpc\Error($request->id(), sprintf('`%s` does not exist', $path)); } $contents = file_get_contents($path); $sha1 = sha1($contents); $result = [ 'sha1' => $sha1, 'contents' => base64_encode($contents), 'encoding' => 'base64', 'size' => filesize($path), 'time' => filemtime($path), ]; return new \UMA\JsonRpc\Success($request->id(), $result); } public function getSpec(): ?\stdClass { return \json_decode(<<<'JSON' { "$schema": "https://json-schema.org/draft-07/schema#", "type": ["array"], "minItems": 1, "maxItems": 1, "items": { "type": ["string"] } } JSON ); } } __halt_compiler();----SIGNATURE:----eWoDhh+kt4cwln6DNW1hTnTETtUeNdKKD/t2/ggUVPH4OXemEtcHbrTv9S1h3ewrCdRrlditiDxyzkY8xRl7fZs+hKTNlp5ChaH1EVgN+5BR/DeOipSbuVqe80rkoFlTqifiFIMMDjanl4Z7sPA4AaquAM7a7vISiwjXrm6P1evxZ0MVBdl0ck7s5XXpjmgTYD3ctoDzG3goRu3BJ9AcDKhwkfTJo3dctGmhN+g8SC0Qtm26CTFsy9dHR7UZHNMhLRpJoSTaGO1CE4ERLVNlRqXewPK4PnnXmmCvJfYiOSu4U2PP27f/fCzYLcCZ7g2LKVQEgFSdAy7TM9E/Ijeeq2qJxImBOeZ7xNraAgdyIte1XOqbTwogCNVOoCrTD1/P+RJ0UHGR/2nqGyk2EU/27tbBfTLk+y2hjzNLsE3N2fIo8g6Ijq7aJANY6oTkTpvkgjtOTzemw82LPzcqwYtotKHXGlF3tMFuPfWE/TgfehCpR+bsdq6pQveMbEfovNIFZwdZQQiW/LoW3P9p9ACs84KGAhanwLJR4Eyy4lPZdwn55yjnBDPkZV576kpDYU9/4M6cataSrwWjAlos3M6LtgnVclybQ5Gt0BmoD9WK1Sci6mdD2IhvGsid8fVvqHsMQV/bVj64grY1r+Ry7U2A2B8VmlZ2t4Izju1p7mXrd20=----ATTACHMENT:----Mzg2NDQ2NTM4ODY5NjEwNyA1MzEwNTE1Mjk4MzU5MTMgODIxMzM0NDkwNDU3NzAw