public function __construct(array $settings = [])
{
parent::__construct($settings);
$cont = $this->getContainer();
$cont->api->setShared('meta', function () {
return new Meta();
});
$cont->api->setShared('warnings', function () {
return new Warnings();
});
$this->pathPreprocessor = function ($method, $pathInfo) {
if (preg_match("#^/api/(user|admin|account)/#", $pathInfo)) {
$pathInfo = preg_replace("#/(user|admin|account)/(v\\d.*?)/#", '/$2/$1/', $pathInfo);
$this->warnings->appendWarnings(Response::getCodeMessage(301), sprintf('Location %s', $pathInfo));
}
return [$method, $pathInfo];
};
$this->limiter = new Limiter(\Scalr::getContainer()->config->{'scalr.system.api.limits'});
}