ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilWACSecurePath.php
Go to the documentation of this file.
1<?php
2require_once('./Services/ActiveRecord/class.ActiveRecord.php');
3
11
17 static function returnDbTableName() {
18 return 'il_wac_secure_path';
19 }
20
21
28 public static function getCheckingInstance(ilWACPath $ilWACPath) {
32 $obj = self::find($ilWACPath->getModuleType());
33 if (!$obj) {
34 ilWACLog::getInstance()->write('No Checking Instance found for id: ' . $ilWACPath->getSecurePathId());
35
36 return null;
37 }
38 $secure_path_checking_class = $obj->getComponentDirectory() . '/classes/class.' . $obj->getCheckingClass() . '.php';
39 if (!file_exists($secure_path_checking_class)) {
40 ilWACLog::getInstance()->write('Checking Instance not found in path: ' . $secure_path_checking_class);
41
42 return null;
43 }
44
45 require_once($secure_path_checking_class);
46 $class_name = $obj->getCheckingClass();
47
48 return new $class_name();
49 }
50
51
55 public function hasCheckingInstance() {
57 }
58
59
69 protected $path = '';
77 protected $component_directory = '';
85 protected $checking_class = '';
93 protected $in_sec_folder = false;
97 protected $has_checking_instance = false;
98
99
103 public function getPath() {
104 return $this->path;
105 }
106
107
111 public function setPath($path) {
112 $this->path = $path;
113 }
114
115
119 public function getComponentDirectory() {
120 preg_match("/[\\\|\\/](Services|Modules|Customizing)[\\\|\\/].*/u", $this->component_directory, $matches);
121
122 return '.' . $matches[0];
123 }
124
125
130 $this->component_directory = $component_directory;
131 }
132
133
137 public function getCheckingClass() {
139 }
140
141
146 $this->checking_class = $checking_class;
147 }
148
149
154 $this->has_checking_instance = $has_checking_instance;
155 }
156
157
161 public function getInSecFolder() {
163 }
164
165
170 $this->in_sec_folder = $in_sec_folder;
171 }
172}
Class ActiveRecord.
An exception for terminatinating execution or to throw for unit testing.
static getInstance()
Class ilWACPath.
Class ilWACSecurePath.
setInSecFolder($in_sec_folder)
setComponentDirectory($component_directory)
setCheckingClass($checking_class)
setHasCheckingInstance($has_checking_instance)