ILIAS  release_8 Revision v8.24
class.ilImportDirectoryFactory.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
6
8{
9 public const TYPE_MOB = 'mob';
10 public const TYPE_SAHS = 'sahs';
11 public const TYPE_EXPORT = 'export';
12
13 protected ilLogger $logger;
15
16 public function __construct()
17 {
18 global $DIC;
19
20 $this->logger = $DIC->logger()->exp();
21 $this->storage_directory = $DIC->filesystem()->storage();
22 }
23
25 {
26 switch ($type) {
27 case self::TYPE_MOB:
28 $instance = new ilMediaObjectImportDirectory(
29 $this->storage_directory,
30 $this->logger
31 );
32 break;
33
34 case self::TYPE_SAHS:
35 $instance = new ilScormImportDirectory(
36 $this->storage_directory,
37 $this->logger
38 );
39 break;
40
42 $instance = new ilExportImportDirectory(
43 $this->storage_directory,
44 $this->logger
45 );
46 break;
47
48 default:
49 $this->logger->error('Invalid type given: ' . $type);
50 throw new DomainException(
51 'Invalid type given: ' . $type
52 );
53 }
54 return $instance;
55 }
56}
Component logger with individual log levels by component id.
Import directory interface.
global $DIC
Definition: feed.php:28
Interface Filesystem.
Definition: Filesystem.php:40
Class FlySystemFileAccessTest \Provider\FlySystem @runTestsInSeparateProcesses @preserveGlobalState d...
$type