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));
173 $this->
setToken($param[ilWACSignedPath::WAC_TOKEN_ID]);
176 $this->
setTimestamp($param[ilWACSignedPath::WAC_TIMESTAMP_ID]);
179 $this->
setTTL($param[ilWACSignedPath::WAC_TTL_ID]);
204 return self::$audio_suffixes;
220 return self::$image_suffixes;
236 return self::$video_suffixes;
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);
setPathWithoutQuery($path_without_query)
setModulePath($module_path)
static setAudioSuffixes($audio_suffixes)
setModuleType($module_type)
static getAudioSuffixes()
setSecurePath($secure_path)
setModuleIdentifier($module_identifier)
static getVideoSuffixes()
static getImageSuffixes()
Create styles array
The data for the language used.
static setImageSuffixes($image_suffixes)
const REGEX
Copy this without to regex101.com and test with some URL of files.
__construct($path)
ilWACPath constructor.
static setVideoSuffixes($video_suffixes)
setParameters($parameters)
setSecurePathId($secure_path_id)
setOriginalRequest($original_request)
setInSecFolder($in_sec_folder)