Files
grocy/controllers/SystemApiController.php
T

42 lines
1.2 KiB
PHP
Raw Normal View History

<?php
namespace Grocy\Controllers;
class SystemApiController extends BaseApiController
{
2020-02-11 17:42:03 +01:00
public function __construct(\DI\Container $container)
{
parent::__construct($container);
}
2020-02-11 17:42:03 +01:00
public function GetDbChangedTime(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
{
return $this->ApiResponse($response, array(
'changed_time' => $this->getDatabaseService()->GetDbChangedTime()
));
}
2020-02-11 17:42:03 +01:00
public function LogMissingLocalization(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
{
if (GROCY_MODE === 'dev')
{
try
{
$requestBody = $request->getParsedBody();
$this->getLocalizationService()->CheckAndAddMissingTranslationToPot($requestBody['text']);
return $this->EmptyApiResponse($response);
}
catch (\Exception $ex)
{
return $this->GenericErrorResponse($response, $ex->getMessage());
}
}
}
2020-02-11 17:42:03 +01:00
public function GetSystemInfo(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
{
return $this->ApiResponse($response, $this->getApplicationService()->GetSystemInfo());
}
}