ILIAS  release_8 Revision v8.24
class.ilWACSecurePath.php
Go to the documentation of this file.
1<?php
25{
30 public static function returnDbTableName(): string
31 {
32 return 'il_wac_secure_path';
33 }
34
46 public static function getCheckingInstance(ilWACPath $ilWACPath): ilWACCheckingClass
47 {
51 $obj = self::find($ilWACPath->getModuleType());
52 if ($obj === null) {
53 throw new ilWACException(
55 'No Checking Instance found for id: ' . $ilWACPath->getSecurePathId()
56 );
57 }
58
59 $secure_path_checking_class = $obj->getComponentDirectory() . '/classes/class.' . $obj->getCheckingClass() . '.php';
60 if (!file_exists($secure_path_checking_class)) {
61 throw new ilWACException(
63 'Checking Instance not found in path: ' . $secure_path_checking_class
64 );
65 }
66 $class_name = $obj->getCheckingClass();
67
68 return new $class_name();
69 }
70
78 public static function hasCheckingInstanceRegistered(ilWACPath $ilWACPath): bool
79 {
80 $obj = self::find($ilWACPath->getModuleType());
81 return !is_null($obj);
82 }
83
84 public function hasCheckingInstance(): bool
85 {
87 }
88
96 protected ?string $path = '';
102 protected string $component_directory = '';
108 protected string $checking_class = '';
114 protected bool $in_sec_folder = false;
115 protected bool $has_checking_instance = false;
116
117 public function getPath(): string
118 {
119 return (string) $this->path;
120 }
121
122 public function setPath(string $path): void
123 {
124 $this->path = $path;
125 }
126
127 public function getComponentDirectory(): string
128 {
129 preg_match("/[\\\|\\/](Services|Modules|Customizing)[\\\|\\/].*/u", $this->component_directory, $matches);
130
131 return '.' . $matches[0];
132 }
133
134 public function setComponentDirectory(string $component_directory): void
135 {
136 $this->component_directory = $component_directory;
137 }
138
139 public function getCheckingClass(): string
140 {
142 }
143
144 public function setCheckingClass(string $checking_class): void
145 {
146 $this->checking_class = $checking_class;
147 }
148
150 {
151 $this->has_checking_instance = $has_checking_instance;
152 }
153
154 public function setInSecFolder(bool $in_sec_folder): void
155 {
156 $this->in_sec_folder = $in_sec_folder;
157 }
158}
Class ActiveRecord.
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...