ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilWACSecurePath.php
Go to the documentation of this file.
1<?php
2
26{
31 public static function returnDbTableName(): string
32 {
33 return 'il_wac_secure_path';
34 }
35
47 public static function getCheckingInstance(ilWACPath $ilWACPath): ilWACCheckingClass
48 {
52 $obj = self::find($ilWACPath->getModuleType());
53 if ($obj === null) {
54 throw new ilWACException(
56 'No Checking Instance found for id: ' . $ilWACPath->getSecurePathId()
57 );
58 }
59
60 // $secure_path_checking_class = $obj->getComponentDirectory() . '/classes/class.' . $obj->getCheckingClass() . '.php';
61 if (!class_exists($obj->getCheckingClass())) {
62 throw new ilWACException(
64 'Checking Instance not found: ' . $obj->getCheckingClass()
65 );
66 }
67 $class_name = $obj->getCheckingClass();
68
69 return new $class_name();
70 }
71
79 public static function hasCheckingInstanceRegistered(ilWACPath $ilWACPath): bool
80 {
81 $obj = self::find($ilWACPath->getModuleType());
82 return !is_null($obj);
83 }
84
85 public function hasCheckingInstance(): bool
86 {
88 }
89
97 protected ?string $path = '';
103 protected string $component_directory = '';
109 protected string $checking_class = '';
115 protected bool $in_sec_folder = false;
116 protected bool $has_checking_instance = false;
117
118 public function getPath(): string
119 {
120 return (string) $this->path;
121 }
122
123 public function setPath(string $path): void
124 {
125 $this->path = $path;
126 }
127
128 public function getComponentDirectory(): string
129 {
130 preg_match("/[\\\|\\/](Services|Modules|Customizing)[\\\|\\/].*/u", $this->component_directory, $matches);
131
132 return '.' . $matches[0];
133 }
134
135 public function setComponentDirectory(string $component_directory): void
136 {
137 $this->component_directory = $component_directory;
138 }
139
140 public function getCheckingClass(): string
141 {
143 }
144
145 public function setCheckingClass(string $checking_class): void
146 {
147 $this->checking_class = $checking_class;
148 }
149
151 {
152 $this->has_checking_instance = $has_checking_instance;
153 }
154
155 public function setInSecFolder(bool $in_sec_folder): void
156 {
157 $this->in_sec_folder = $in_sec_folder;
158 }
159}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
bool $in_sec_folder
@con_has_field true @con_fieldtype integer @con_length 1
static hasCheckingInstanceRegistered(ilWACPath $ilWACPath)
Searches a checking instance for the given wac path.
string $checking_class
@con_has_field true @con_fieldtype text @con_length 256
setCheckingClass(string $checking_class)
setHasCheckingInstance(bool $has_checking_instance)
setComponentDirectory(string $component_directory)
string $path
@con_is_primary true @con_is_unique true @con_has_field true @con_fieldtype text @con_length 64
static returnDbTableName()
@description Return the Name of your Database Table
setInSecFolder(bool $in_sec_folder)
string $component_directory
@con_has_field true @con_fieldtype text @con_length 256
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...