19declare(strict_types=1);
29use Psr\Http\Message\ServerRequestInterface;
56 [self::NAMESPACE_LONG, self::NAMESPACE_ALTERNATIVE, self::NAMESPACE_SHORT],
63 if ($request->
getNamespace() === $this->getNamespace()) {
68 $this->getNamespaceAliasses()
78 $DIC->repositoryTree()
82 if (!$repository->has($alias)) {
83 return $response_factory->
cannot();
86 if (($shortlink = $repository->getByAlias($alias)) ===
null) {
87 return $response_factory->
cannot();
90 if (!$shortlink->isActive()) {
91 return $response_factory->
cannot();
95 $DIC[
'static_url']->builder(),
99 $target = $target_resolver->resolve(
102 if ($target instanceof
URI) {
103 $target = $target->getPath();
106 if (empty($target)) {
107 return $response_factory->
cannot();
110 $repository->increaseUsage(
114 return $response_factory->
can(
120 protected function mustShift(ServerRequestInterface $request): bool
122 $requested_uri = $request->getUri()->getPath();
The scope of this class is split ilias-conform URI's into components.
getAdditionalParameters()
can(string $uri_path, bool $shift=false)
const string NAMESPACE_ALTERNATIVE
canHandle(Request $request)
const string SHORTLINK_NAMESPACE
const string NAMESPACE_SHORT
const string NAMESPACE_LONG
mustShift(ServerRequestInterface $request)
handle(Request $request, Context $context, Factory $response_factory)
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.