ILIAS  trunk Revision v11.0_alpha-1702-gfd3ecb7f852
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Services.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\ResourceStorage;
22 
44 
50 class Services
51 {
52  protected Subject $events;
53  protected Manager $manager;
55  protected Consumers $consumers;
57  protected Flavours $flavours;
59 
63  public function __construct(
64  StorageHandlerFactory $storage_handler_factory,
65  Repositories $repositories,
66  Artifacts $artifacts,
67  LockHandler $lock_handler,
68  FileNamePolicy $file_name_policy,
69  StreamAccess $stream_access,
70  Factory $machine_factory,
71  ?SrcBuilder $src_builder = null,
72  ?RepositoryPreloader $preloader = null
73  ) {
74  $this->events = new Subject();
75  $src_builder ??= new InlineSrcBuilder();
76  $file_name_policy_stack = new FileNamePolicyStack();
77  $file_name_policy_stack->addPolicy($file_name_policy);
78  $resource_builder = new ResourceBuilder(
79  $storage_handler_factory,
80  $repositories,
81  $lock_handler,
82  $stream_access,
83  $file_name_policy_stack
84  );
85  $collection_builder = new CollectionBuilder(
86  $repositories->getCollectionRepository(),
89  $lock_handler
90  );
91  $this->preloader = $preloader ?? new StandardRepositoryPreloader($repositories);
92  $this->manager = new Manager(
93  $resource_builder,
94  $collection_builder,
95  $this->preloader
96  );
97  $this->container_manager = new ContainerManager(
98  $resource_builder,
99  $collection_builder,
100  $this->preloader,
101  $this->events
102  );
103  $this->consumers = new Consumers(
104  new ConsumerFactory(
105  $stream_access,
106  $file_name_policy_stack
107  ),
108  $resource_builder,
109  $collection_builder,
110  $src_builder
111  );
112  $this->collections = new Collections(
113  $resource_builder,
114  $collection_builder,
115  $this->preloader,
116  $this->events
117  );
118 
119  $flavour_builder = new FlavourBuilder(
120  $repositories->getFlavourRepository(),
121  $machine_factory,
122  $resource_builder,
123  $storage_handler_factory,
124  $stream_access,
126  );
127 
128  $this->flavours = new Flavours(
129  $flavour_builder,
130  $resource_builder
131  );
132  }
133 
134  public function manage(): Manager
135  {
136  return $this->manager;
137  }
138 
140  {
142  }
143 
144  public function consume(): Consumers
145  {
146  return $this->consumers;
147  }
148 
149  public function collection(): Collections
150  {
151  return $this->collections;
152  }
153 
154  public function flavours(): Flavours
155  {
156  return $this->flavours;
157  }
158 
159  public function preload(array $identification_strings): void
160  {
161  $this->preloader->preload($identification_strings);
162  }
163 
164  public function events(): Subject
165  {
166  return $this->events;
167  }
168 }
__construct(StorageHandlerFactory $storage_handler_factory, Repositories $repositories, Artifacts $artifacts, LockHandler $lock_handler, FileNamePolicy $file_name_policy, StreamAccess $stream_access, Factory $machine_factory, ?SrcBuilder $src_builder=null, ?RepositoryPreloader $preloader=null)
Services constructor.
Definition: Services.php:63
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
RepositoryPreloader $preloader
Definition: Services.php:58
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ContainerManager $container_manager
Definition: Services.php:54
preload(array $identification_strings)
Definition: Services.php:159