ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilImportDirectoryFactory.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24{
25 public const TYPE_MOB = 'mob';
26 public const TYPE_SAHS = 'sahs';
27 public const TYPE_EXPORT = 'export';
28
29 protected ilLogger $logger;
31
32 public function __construct()
33 {
34 global $DIC;
35
36 $this->logger = $DIC->logger()->exp();
37 $this->storage_directory = $DIC->filesystem()->storage();
38 }
39
40 public function getInstanceForComponent(string $type): ilImportDirectory
41 {
42 switch ($type) {
43 case self::TYPE_MOB:
44 $instance = new ilMediaObjectImportDirectory(
45 $this->storage_directory,
46 $this->logger
47 );
48 break;
49
50 case self::TYPE_SAHS:
51 $instance = new ilScormImportDirectory(
52 $this->storage_directory,
53 $this->logger
54 );
55 break;
56
58 $instance = new ilExportImportDirectory(
59 $this->storage_directory,
60 $this->logger
61 );
62 break;
63
64 default:
65 $this->logger->error('Invalid type given: ' . $type);
66 throw new DomainException(
67 'Invalid type given: ' . $type
68 );
69 }
70 return $instance;
71 }
72}
Component logger with individual log levels by component id.
Import directory interface.
The filesystem interface provides the public interface for the Filesystem service API consumer.
Definition: Filesystem.php:37
global $DIC
Definition: shib_login.php:26