ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Services.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use ILIAS\DI\Container as GlobalContainer;
29use ILIAS\MetaData\Structure\Services\Services as StructureServices;
34use ILIAS\MetaData\Manipulator\Services\Services as ManipulatorServices;
37use ILIAS\MetaData\Copyright\Services\Services as CopyrightServices;
39use ILIAS\MetaData\XML\Writer\SimpleDC\SimpleDC;
41use ILIAS\Export\ExportHandler\Factory as ExportService;
42use ILIAS\Data\Factory as DataFactory;
43
45{
46 protected GlobalContainer $dic;
50
51 protected PathServices $path_services;
52 protected StructureServices $structure_services;
53 protected ManipulatorServices $manipulator_services;
54 protected CopyrightServices $copyright_services;
55
56 public function __construct(
57 GlobalContainer $dic,
58 PathServices $path_services,
59 StructureServices $structure_services,
60 ManipulatorServices $manipulator_services,
61 CopyrightServices $copyright_services
62 ) {
63 $this->dic = $dic;
64 $this->path_services = $path_services;
65 $this->structure_services = $structure_services;
66 $this->manipulator_services = $manipulator_services;
67 $this->copyright_services = $copyright_services;
68 }
69
71 {
72 if (isset($this->standard_writer)) {
74 }
75 $dictionary = (new LOMDictionaryInitiator(
76 new TagFactory(),
77 $this->path_services->pathFactory(),
78 $this->path_services->navigatorFactory(),
79 $this->structure_services->structure()
80 ))->get();
81 return $this->standard_writer = new StandardWriter(
82 $dictionary,
84 $this->copyright_services->repository(),
85 $this->copyright_services->identifiersHandler(),
87 ),
88 $this->path_services->pathFactory(),
89 $this->manipulator_services->manipulator()
90 );
91 }
92
94 {
95 if (isset($this->standard_reader)) {
97 }
98 $dictionary = (new LOMDictionaryInitiator(
99 new TagFactory(),
100 $this->path_services->pathFactory(),
101 $this->path_services->navigatorFactory(),
102 $this->structure_services->structure()
103 ))->get();
104 $marker_factory = new MarkerFactory();
105 $copyright_handler = new CopyrightHandler(
106 $this->copyright_services->repository(),
107 $this->copyright_services->identifiersHandler(),
109 );
110 return $this->standard_reader = new StandardReader(
112 $marker_factory,
113 $this->manipulator_services->scaffoldProvider(),
114 $dictionary,
115 $copyright_handler
116 ),
117 new Legacy(
118 $marker_factory,
119 $this->manipulator_services->scaffoldProvider(),
120 $copyright_handler
121 )
122 );
123 }
124
126 {
127 if (isset($this->simple_dc_writer)) {
129 }
130
131 /*
132 * This should be replaced by a proper export API
133 * when it is available.
134 */
135 $export_service = new ExportService();
136 $data_factory = new DataFactory();
137
138 return $this->simple_dc_writer = new SimpleDC(
139 $this->path_services->pathFactory(),
140 $this->path_services->navigatorFactory(),
141 $data_factory,
143 $this->copyright_services->repository(),
144 $this->copyright_services->identifiersHandler(),
146 ),
147 new LinkGenerator(
148 $this->dic['static_url'],
149 $export_service,
150 $data_factory
151 )
152 );
153 }
154}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
Builds data types.
Definition: Factory.php:36
ManipulatorServices $manipulator_services
Definition: Services.php:53
__construct(GlobalContainer $dic, PathServices $path_services, StructureServices $structure_services, ManipulatorServices $manipulator_services, CopyrightServices $copyright_services)
Definition: Services.php:56
SimpleDCInterface $simple_dc_writer
Definition: Services.php:49
CopyrightServices $copyright_services
Definition: Services.php:54
StructureServices $structure_services
Definition: Services.php:52