ILIAS  release_8 Revision v8.24
class.ilCtrlSecurityArtifactObjective.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5/* Copyright (c) 2021 Thibeau Fuhrer <thf@studer-raimann.ch> Extended GPL, see docs/LICENSE */
6
7require_once __DIR__ . "/../../../../../libs/composer/vendor/autoload.php";
8
13
20{
24 public const ARTIFACT_PATH = "./Services/UICore/artifacts/ctrl_security.php";
25
29 public function getArtifactPath(): string
30 {
32 }
33
37 public function build(): Artifact
38 {
39 $finder = new ImplementationOfInterfaceFinder();
40
41 $security_information = [];
42 foreach ($finder->getMatchingClassNames(ilCtrlSecurityInterface::class) as $class) {
43 try {
44 $reflection = new ReflectionClass($class);
45
47 $gui_object = $reflection->newInstanceWithoutConstructor();
48
49 $security_information[strtolower($class)] = [
50 ilCtrlStructureInterface::KEY_UNSAFE_COMMANDS => $gui_object->getUnsafeGetCommands(),
51 ilCtrlStructureInterface::KEY_SAFE_COMMANDS => $gui_object->getSafePostCommands(),
52 ];
53 } catch (ReflectionException $e) {
54 continue;
55 }
56 }
57
58 return new ArrayArtifact($security_information);
59 }
60}
An array as an artifact.
This is an objective to build some artifact.
Class ilCtrlSecurityArtifactObjective.
An artifact is some file that is build on demand per installation and is not shipped with the ILIAS s...
Definition: Artifact.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...