16 const REGEX =
"(?<prefix>.*?)(?<path>(?<path_without_query>(?<secure_path_id>(?<module_path>\/data\/(?<client>[\w-\.]*)\/(?<sec>sec\/|)(?<module_type>.*?)\/(?<module_identifier>.*\/|)))(?<appendix>[^\?\n]*)).*)";
132 $re =
'/' . self::REGEX .
'/';
135 foreach (
$result as $k => $v) {
136 if (is_numeric($k)) {
157 $parts = parse_url(
$path);
159 if (isset($parts[
'query'])) {
160 $parts_query = $parts[
'query'];
162 parse_str($parts_query,
$query);
165 $this->
setSuffix(pathinfo($parts[
'path'], PATHINFO_EXTENSION));
324 return in_array(strtolower($this->
getSuffix()), self::$image_suffixes);
356 return in_array(strtolower($this->
getSuffix()), self::$audio_suffixes);
364 return in_array(strtolower($this->
getSuffix()), self::$video_suffixes);
380 return ($this->token !=
'');
388 return ($this->timestamp != 0);
396 return ($this->ttl != 0);
An exception for terminatinating execution or to throw for unit testing.
setOriginalRequest($original_request)
setSecurePathId($secure_path_id)
setParameters($parameters)
static getAudioSuffixes()
static setAudioSuffixes($audio_suffixes)
static getImageSuffixes()
setModuleIdentifier($module_identifier)
static setImageSuffixes($image_suffixes)
setModulePath($module_path)
const REGEX
Copy this without to regex101.com and test with some URL of files.
setModuleType($module_type)
__construct($path)
ilWACPath constructor.
setInSecFolder($in_sec_folder)
static setVideoSuffixes($video_suffixes)
setSecurePath($secure_path)
setPathWithoutQuery($path_without_query)
static getVideoSuffixes()