19 declare(strict_types=1);
46 public function __construct(array $handlers,
string $base_dir)
50 $this->handlers[$handler->getID()] =
$handler;
51 if ($handler->isPrimary()) {
52 if ($this->primary !== null) {
53 throw new \LogicException(
"Only one primary StorageHandler can exist");
58 if ($this->primary === null) {
59 throw new \LogicException(
"One primary StorageHandler must exist");
80 if (isset($this->handlers[$storage_id])) {
81 return $this->handlers[$storage_id];
84 throw new \LogicException(
"no StorageHandler for '$storage_id' available");
94 $internal_path = str_replace($this->
getBaseDir(),
"", $uri);
95 $internal_path = ltrim(str_replace(self::BASE_DIRECTORY,
"", $internal_path),
"/");
97 $fs_identifier = explode(
"/", $internal_path)[0];
99 $internal_path = str_replace($fs_identifier .
"/",
"", $internal_path);
102 $path_generator =
$handler->getPathGenerator();
104 $rid = $path_generator->getIdentificationFor($internal_path);
Class FileResourceHandler.
Interface StorageResource.
getRidForURI(string $uri)
Interface Observer Contains several chained tasks and infos about them.
getHandlerForStorageId(string $storage_id)
ILIAS ResourceStorage StorageHandler StorageHandler $primary
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ResourceIdentification.
__construct(array $handlers, string $base_dir)
StorageHandlerFactory constructor.
getHandlerForRevision(Revision $revision)
getHandlerForResource(StorableResource $resource)
Class StorageHandlerFactory.