Esempio n. 1
0
 public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next)
 {
     $this->request = $request;
     $this->response = $response;
     // root path
     $this->rootDir = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR);
     $result = \Maestro\Manager::invoke($this);
     //\Maestro\Manager::process($conf, $dir);
     //$query  = $request->getQueryParams();
     //$target = isset($query['target']) ? $query['target'] : 'World';
     //$target = htmlspecialchars($target, ENT_HTML5, 'UTF-8');
     //$result = 'xxx';
     //$response->getBody()->write(sprintf(
     //    '<h1>result: %s!</h1>',
     //    $result
     //));
     //return $response->withHeader('Content-Type', 'text/html');
     $response->getBody()->write($result);
     return $response;
 }