14 namespace Fossology\UI\Api\Controllers;
24 use Psr\Http\Message\ServerRequestInterface;
39 $this->sysconfigDao = $this->container->get(
'dao.sys_config');
55 $returnVal = $this->sysconfigDao->getConfigData();
56 $finalVal = $this->sysconfigDao->getCustomiseData($returnVal, $apiVersion);
57 return $response->withJson($finalVal, 200);
73 if (empty($body) || !array_key_exists(
"key", $body) || !array_key_exists(
"value", $body)) {
76 list($success, $msg) = $this->sysconfigDao->UpdateConfigData($body);
80 $info =
new Info(200,
"Successfully updated $msg.",
82 return $response->withJson($info->getArray(), $info->getCode());
95 $returnVal = $this->sysconfigDao->getBannerData();
96 return $response->withJson($returnVal, 200);
getBannerMessage($request, $response, $args)
updateCustomiseData($request, $response, $args)
getCustomiseData($request, $response, $args)
Base controller for REST calls.
getParsedBody(ServerRequestInterface $request)
Parse request body as JSON and return associative PHP array.
Override Slim response for withJson function.
static getVersion(ServerRequestInterface $request)
Different type of infos provided by REST.
Info model to contain general error and return values.