ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilCtrlSecurityArtifactObjective.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 require_once __DIR__ . "/../../../../../../vendor/composer/vendor/autoload.php";
22 
27 
34 {
35 
36  public function getArtifactName(): string
37  {
38  return "ctrl_security";
39  }
40 
41 
45  public function build(): Artifact
46  {
47  $finder = new ImplementationOfInterfaceFinder();
48 
49  $security_information = [];
50  foreach ($finder->getMatchingClassNames(ilCtrlSecurityInterface::class) as $class) {
51  try {
52  $reflection = new ReflectionClass($class);
53 
55  $gui_object = $reflection->newInstanceWithoutConstructor();
56 
57  $security_information[strtolower($class)] = [
58  ilCtrlStructureInterface::KEY_UNSAFE_COMMANDS => $gui_object->getUnsafeGetCommands(),
59  ilCtrlStructureInterface::KEY_SAFE_COMMANDS => $gui_object->getSafePostCommands(),
60  ];
61  } catch (ReflectionException $e) {
62  continue;
63  }
64  }
65 
66  return new ArrayArtifact($security_information);
67  }
68 }
build()
Build the artifact based.
This is an objective to build some artifact.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrlSecurityArtifactObjective.
An array as an artifact.
An artifact is some file that is build on demand per installation and is not shipped with the ILIAS s...
Definition: Artifact.php:27