ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilWACPath Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilWACPath:

Public Member Functions

 __construct (string $path)
 
 getParameters ()
 
 setParameters (array $parameters)
 
 getPrefix ()
 
 setPrefix (string $prefix)
 
 getAppendix ()
 
 setAppendix (string $appendix)
 
 getModulePath ()
 
 setModulePath (string $module_path)
 
 getDirName ()
 
 getPathWithoutQuery ()
 
 setPathWithoutQuery (string $path_without_query)
 
 isImage ()
 
 getSuffix ()
 
 setSuffix (string $suffix)
 
 isStreamable ()
 
 isAudio ()
 
 isVideo ()
 
 fileExists ()
 
 hasToken ()
 
 hasTimestamp ()
 
 hasTTL ()
 
 getToken ()
 
 setToken (string $token)
 
 getTimestamp ()
 
 setTimestamp (int $timestamp)
 
 getTTL ()
 
 setTTL (int $ttl)
 
 getClient ()
 
 setClient (string $client)
 
 getSecurePathId ()
 
 setSecurePathId (string $secure_path_id)
 
 getPath ()
 
 getCleanURLdecodedPath ()
 Returns a clean (everything behind ? is removed and rawurldecoded path. More...
 
 setPath (string $path)
 
 getQuery ()
 
 setQuery (string $query)
 
 getFileName ()
 
 setFileName (string $file_name)
 
 getOriginalRequest ()
 
 setOriginalRequest (string $original_request)
 
 getSecurePath ()
 
 setSecurePath (string $secure_path)
 
 isInSecFolder ()
 
 setInSecFolder (bool $in_sec_folder)
 
 getModuleType ()
 
 setModuleType (string $module_type)
 
 getModuleIdentifier ()
 
 setModuleIdentifier (string $module_identifier)
 

Static Public Member Functions

static getAudioSuffixes ()
 
static setAudioSuffixes (array $audio_suffixes)
 
static getImageSuffixes ()
 
static setImageSuffixes (array $image_suffixes)
 
static getVideoSuffixes ()
 
static setVideoSuffixes (array $video_suffixes)
 

Data Fields

const DIR_DATA = "data"
 
const DIR_SEC = "sec"
 
const REGEX = "(?<prefix>.*?)(?<path>(?<path_without_query>(?<secure_path_id>(?<module_path>\/data\/(?<client>[\w\-\.]*)\/(?<sec>sec\/|)(?<module_type>.*?)\/(?<module_identifier>.*\/|)))(?<appendix>[^\?\n]*)).*)"
 Copy this without to regex101.com and test with some URL of files. More...
 

Protected Member Functions

 handleParameters ()
 
 normalizePath (string $path)
 

Protected Attributes

string $client = ''
 
array $parameters = []
 
bool $in_sec_folder = false
 
string $token = ''
 
int $timestamp = 0
 
int $ttl = 0
 
string $secure_path = ''
 
string $secure_path_id = ''
 
string $original_request = ''
 
string $file_name = ''
 
string $query = ''
 
string $suffix = ''
 
string $prefix = ''
 
string $appendix = ''
 
string $module_path = ''
 
string $path = ''
 
string $module_type = ''
 
string $module_identifier = ''
 
string $path_without_query = ''
 

Static Protected Attributes

static array $image_suffixes
 
static array $video_suffixes
 
static array $audio_suffixes
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilWACPath

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
1.0.0

Definition at line 26 of file class.ilWACPath.php.

Constructor & Destructor Documentation

◆ __construct()

ilWACPath::__construct ( string  $path)

Definition at line 88 of file class.ilWACPath.php.

89 {
90 $path = $this->normalizePath($path);
91
93 $re = '/' . self::REGEX . '/';
94 preg_match($re, $path, $result);
95
96 $result['path_without_query'] = strstr(
97 parse_url($path)['path'],
98 '/data/',
99 false
100 );
101
102
103 foreach (array_keys(array_keys($result)) as $k) {
104 if (is_numeric($k)) {
105 unset($result[$k]);
106 }
107 }
108
109 $moduleId = strstr(
110 !isset($result['module_identifier']) || is_null($result['module_identifier']) ? '' : $result['module_identifier'],
111 '/',
112 true
113 );
114 $moduleId = $moduleId === false ? '' : $moduleId;
115
116 $this->setPrefix(!isset($result['prefix']) || is_null($result['prefix']) ? '' : $result['prefix']);
117 $this->setClient(!isset($result['client']) || is_null($result['client']) ? '' : $result['client']);
118 $this->setAppendix(!isset($result['appendix']) || is_null($result['appendix']) ? '' : $result['appendix']);
119 $this->setModuleIdentifier($moduleId);
120 $this->setModuleType(!isset($result['module_type']) || is_null($result['module_type']) ? '' : $result['module_type']);
121
122 if ($this->getModuleIdentifier() !== '' && $this->getModuleIdentifier() !== '0') {
123 $module_path = strstr(
124 !isset($result['module_path']) || is_null($result['module_path']) ? '' : $result['module_path'],
125 $this->getModuleIdentifier(),
126 true
127 );
128 $module_path = '.' . ($module_path === false ? '' : $module_path);
129 } else {
130 $module_path = ('.' . (!isset($result['module_path']) || is_null($result['module_path']) ? '' : $result['module_path']));
131 }
132
134 $this->setInSecFolder(isset($result['sec']) && $result['sec'] === 'sec/');
135 $this->setPathWithoutQuery(
136 '.' . (!isset($result['path_without_query']) || is_null($result['path_without_query']) ? '' : $result['path_without_query'])
137 );
138 $this->setPath('.' . (!isset($result['path']) || is_null($result['path']) ? '' : $result['path']));
139 $this->setSecurePath(
140 '.' . (!isset($result['secure_path_id']) || is_null($result['secure_path_id']) ? '' : $result['secure_path_id'])
141 );
142 $this->setSecurePathId(!isset($result['module_type']) || is_null($result['module_type']) ? '' : $result['module_type']);
143 // Pathinfo
144 $parts = parse_url($path);
145 $this->setFileName(basename($parts['path']));
146 if (isset($parts['query'])) {
147 $parts_query = $parts['query'];
148 $this->setQuery($parts_query);
149 parse_str($parts_query, $query);
150 $this->setParameters($query);
151 }
152 $this->setSuffix(pathinfo($parts['path'], PATHINFO_EXTENSION));
153 $this->handleParameters();
154 }
setQuery(string $query)
setInSecFolder(bool $in_sec_folder)
setAppendix(string $appendix)
setModuleIdentifier(string $module_identifier)
string $module_path
setSecurePath(string $secure_path)
setModulePath(string $module_path)
setPrefix(string $prefix)
setOriginalRequest(string $original_request)
setFileName(string $file_name)
setClient(string $client)
setModuleType(string $module_type)
normalizePath(string $path)
setSecurePathId(string $secure_path_id)
setSuffix(string $suffix)
setPathWithoutQuery(string $path_without_query)
setParameters(array $parameters)
setPath(string $path)
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61

References $module_path, $parts, $path, $query, getModuleIdentifier(), handleParameters(), normalizePath(), setAppendix(), setClient(), setFileName(), setInSecFolder(), setModuleIdentifier(), setModulePath(), setModuleType(), setOriginalRequest(), setParameters(), setPath(), setPathWithoutQuery(), setPrefix(), setQuery(), setSecurePath(), setSecurePathId(), and setSuffix().

+ Here is the call graph for this function:

Member Function Documentation

◆ fileExists()

ilWACPath::fileExists ( )

Definition at line 343 of file class.ilWACPath.php.

343 : bool
344 {
345 return is_file($this->getPathWithoutQuery());
346 }

References getPathWithoutQuery().

+ Here is the call graph for this function:

◆ getAppendix()

ilWACPath::getAppendix ( )

Definition at line 275 of file class.ilWACPath.php.

275 : string
276 {
277 return $this->appendix;
278 }
string $appendix

References $appendix.

Referenced by ilWACSignedResourceStorage\canBeDelivered().

+ Here is the caller graph for this function:

◆ getAudioSuffixes()

static ilWACPath::getAudioSuffixes ( )
static
Returns
string[]

Definition at line 189 of file class.ilWACPath.php.

189 : array
190 {
192 }
static array $audio_suffixes

References $audio_suffixes.

◆ getCleanURLdecodedPath()

ilWACPath::getCleanURLdecodedPath ( )

Returns a clean (everything behind ? is removed and rawurldecoded path.

Definition at line 424 of file class.ilWACPath.php.

424 : string
425 {
426 $string = $this->getPathWithoutQuery();
427 return rawurldecode($string);
428 }

References getPathWithoutQuery().

Referenced by ilWebAccessChecker\check().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getClient()

ilWACPath::getClient ( )

Definition at line 396 of file class.ilWACPath.php.

396 : string
397 {
398 return $this->client;
399 }
string $client

References $client.

◆ getDirName()

ilWACPath::getDirName ( )

Definition at line 295 of file class.ilWACPath.php.

295 : string
296 {
297 return dirname($this->getPathWithoutQuery());
298 }

References getPathWithoutQuery().

+ Here is the call graph for this function:

◆ getFileName()

ilWACPath::getFileName ( )

Definition at line 445 of file class.ilWACPath.php.

445 : string
446 {
447 return $this->file_name;
448 }
string $file_name

References $file_name.

Referenced by ilObjUserAccess\canBeDelivered().

+ Here is the caller graph for this function:

◆ getImageSuffixes()

static ilWACPath::getImageSuffixes ( )
static
Returns
string[]

Definition at line 205 of file class.ilWACPath.php.

205 : array
206 {
208 }
static array $image_suffixes

References $image_suffixes.

◆ getModuleIdentifier()

ilWACPath::getModuleIdentifier ( )

Definition at line 495 of file class.ilWACPath.php.

495 : string
496 {
498 }
string $module_identifier

References $module_identifier.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ getModulePath()

ilWACPath::getModulePath ( )

Definition at line 285 of file class.ilWACPath.php.

285 : string
286 {
287 return $this->module_path;
288 }

References $module_path.

◆ getModuleType()

ilWACPath::getModuleType ( )

Definition at line 485 of file class.ilWACPath.php.

485 : string
486 {
487 return $this->module_type;
488 }
string $module_type

References $module_type.

Referenced by ilWebAccessChecker\check(), and ilWACSecurePath\hasCheckingInstanceRegistered().

+ Here is the caller graph for this function:

◆ getOriginalRequest()

ilWACPath::getOriginalRequest ( )

Definition at line 455 of file class.ilWACPath.php.

455 : string
456 {
458 }
string $original_request

References $original_request.

◆ getParameters()

ilWACPath::getParameters ( )
Returns
string[]

Definition at line 173 of file class.ilWACPath.php.

173 : array
174 {
175 return $this->parameters;
176 }
array $parameters

References $parameters.

Referenced by handleParameters().

+ Here is the caller graph for this function:

◆ getPath()

ilWACPath::getPath ( )

◆ getPathWithoutQuery()

ilWACPath::getPathWithoutQuery ( )

Definition at line 300 of file class.ilWACPath.php.

300 : string
301 {
303 }
string $path_without_query

References $path_without_query.

Referenced by fileExists(), getCleanURLdecodedPath(), and getDirName().

+ Here is the caller graph for this function:

◆ getPrefix()

ilWACPath::getPrefix ( )

Definition at line 265 of file class.ilWACPath.php.

265 : string
266 {
267 return $this->prefix;
268 }
string $prefix

References $prefix.

◆ getQuery()

ilWACPath::getQuery ( )

Definition at line 435 of file class.ilWACPath.php.

435 : string
436 {
437 return $this->query;
438 }

References $query.

◆ getSecurePath()

ilWACPath::getSecurePath ( )

Definition at line 465 of file class.ilWACPath.php.

465 : string
466 {
467 return $this->secure_path;
468 }
string $secure_path

References $secure_path.

◆ getSecurePathId()

ilWACPath::getSecurePathId ( )

Definition at line 406 of file class.ilWACPath.php.

406 : string
407 {
409 }
string $secure_path_id

References $secure_path_id.

◆ getSuffix()

ilWACPath::getSuffix ( )

Definition at line 315 of file class.ilWACPath.php.

315 : string
316 {
317 return $this->suffix;
318 }
string $suffix

References $suffix.

Referenced by isAudio(), isImage(), and isVideo().

+ Here is the caller graph for this function:

◆ getTimestamp()

ilWACPath::getTimestamp ( )

Definition at line 374 of file class.ilWACPath.php.

374 : int
375 {
376 return $this->timestamp;
377 }

References $timestamp.

◆ getToken()

ilWACPath::getToken ( )

Definition at line 363 of file class.ilWACPath.php.

363 : string
364 {
365 return $this->token;
366 }

References $token.

◆ getTTL()

ilWACPath::getTTL ( )

Definition at line 385 of file class.ilWACPath.php.

385 : int
386 {
387 return $this->ttl;
388 }

References $ttl.

◆ getVideoSuffixes()

static ilWACPath::getVideoSuffixes ( )
static
Returns
string[]

Definition at line 221 of file class.ilWACPath.php.

221 : array
222 {
224 }
static array $video_suffixes

References $video_suffixes.

◆ handleParameters()

ilWACPath::handleParameters ( )
protected

Definition at line 156 of file class.ilWACPath.php.

156 : void
157 {
158 $param = $this->getParameters();
160 $this->setToken($param[ilWACSignedPath::WAC_TOKEN_ID]);
161 }
163 $this->setTimestamp((int) $param[ilWACSignedPath::WAC_TIMESTAMP_ID]);
164 }
166 $this->setTTL((int) $param[ilWACSignedPath::WAC_TTL_ID]);
167 }
168 }
setToken(string $token)
setTTL(int $ttl)
setTimestamp(int $timestamp)
$param
Definition: xapitoken.php:46

References $param, getParameters(), setTimestamp(), setToken(), setTTL(), ilWACSignedPath\WAC_TIMESTAMP_ID, ilWACSignedPath\WAC_TOKEN_ID, and ilWACSignedPath\WAC_TTL_ID.

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasTimestamp()

ilWACPath::hasTimestamp ( )

Definition at line 353 of file class.ilWACPath.php.

353 : bool
354 {
355 return ($this->timestamp !== 0);
356 }

◆ hasToken()

ilWACPath::hasToken ( )

Definition at line 348 of file class.ilWACPath.php.

348 : bool
349 {
350 return ($this->token !== '');
351 }

◆ hasTTL()

ilWACPath::hasTTL ( )

Definition at line 358 of file class.ilWACPath.php.

358 : bool
359 {
360 return ($this->ttl !== 0);
361 }

◆ isAudio()

ilWACPath::isAudio ( )

Definition at line 333 of file class.ilWACPath.php.

333 : bool
334 {
335 return in_array(strtolower($this->getSuffix()), self::$audio_suffixes);
336 }

References getSuffix().

Referenced by isStreamable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isImage()

ilWACPath::isImage ( )

Definition at line 310 of file class.ilWACPath.php.

310 : bool
311 {
312 return in_array(strtolower($this->getSuffix()), self::$image_suffixes);
313 }

References getSuffix().

+ Here is the call graph for this function:

◆ isInSecFolder()

ilWACPath::isInSecFolder ( )

Definition at line 475 of file class.ilWACPath.php.

475 : bool
476 {
478 }
bool $in_sec_folder

References $in_sec_folder.

Referenced by ilWebAccessChecker\check().

+ Here is the caller graph for this function:

◆ isStreamable()

ilWACPath::isStreamable ( )

Definition at line 325 of file class.ilWACPath.php.

325 : bool
326 {
327 if ($this->isAudio()) {
328 return true;
329 }
330 return $this->isVideo();
331 }

References isAudio(), and isVideo().

+ Here is the call graph for this function:

◆ isVideo()

ilWACPath::isVideo ( )

Definition at line 338 of file class.ilWACPath.php.

338 : bool
339 {
340 return in_array(strtolower($this->getSuffix()), self::$video_suffixes);
341 }

References getSuffix().

Referenced by isStreamable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ normalizePath()

ilWACPath::normalizePath ( string  $path)
protected

Definition at line 234 of file class.ilWACPath.php.

234 : string
235 {
236 $path = ltrim($path, '.');
237 $path = rawurldecode($path);
238
239 // cut everything before "data/" (for installations using a subdirectory)
240 $path = strstr($path, '/' . self::DIR_DATA . '/') ?: $path;
241 $path = ltrim($path, '/');
242
243 $original_path = parse_url($path, PHP_URL_PATH);
244 $query = parse_url($path, PHP_URL_QUERY);
245
246 $real_data_dir = realpath("./" . self::DIR_DATA);
247 $realpath = realpath("./" . $original_path);
248
249 if (!str_starts_with($realpath, $real_data_dir)) {
250 throw new ilWACException(ilWACException::NOT_FOUND, "Path is not in data directory");
251 }
252
253 $normalized_path = ltrim(
254 str_replace(
255 $real_data_dir,
256 '',
257 $realpath
258 ),
259 '/'
260 );
261
262 return "/" . self::DIR_DATA . '/' . $normalized_path . (empty($query) ? '' : '?' . $query);
263 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $path, $query, and ilWACException\NOT_FOUND.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setAppendix()

ilWACPath::setAppendix ( string  $appendix)

Definition at line 280 of file class.ilWACPath.php.

280 : void
281 {
282 $this->appendix = $appendix;
283 }

References $appendix.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setAudioSuffixes()

static ilWACPath::setAudioSuffixes ( array  $audio_suffixes)
static
Parameters
string[]$audio_suffixes

Definition at line 197 of file class.ilWACPath.php.

197 : void
198 {
199 self::$audio_suffixes = $audio_suffixes;
200 }

References $audio_suffixes.

◆ setClient()

ilWACPath::setClient ( string  $client)

Definition at line 401 of file class.ilWACPath.php.

401 : void
402 {
403 $this->client = $client;
404 }

References $client, and ILIAS\UI\examples\Progress\Bar\client().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFileName()

ilWACPath::setFileName ( string  $file_name)

Definition at line 450 of file class.ilWACPath.php.

450 : void
451 {
452 $this->file_name = $file_name;
453 }

References $file_name.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setImageSuffixes()

static ilWACPath::setImageSuffixes ( array  $image_suffixes)
static
Parameters
string[]$image_suffixes

Definition at line 213 of file class.ilWACPath.php.

213 : void
214 {
215 self::$image_suffixes = $image_suffixes;
216 }

References $image_suffixes.

◆ setInSecFolder()

ilWACPath::setInSecFolder ( bool  $in_sec_folder)

Definition at line 480 of file class.ilWACPath.php.

480 : void
481 {
482 $this->in_sec_folder = $in_sec_folder;
483 }

References $in_sec_folder.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setModuleIdentifier()

ilWACPath::setModuleIdentifier ( string  $module_identifier)

Definition at line 500 of file class.ilWACPath.php.

500 : void
501 {
502 $this->module_identifier = $module_identifier;
503 }

References $module_identifier.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setModulePath()

ilWACPath::setModulePath ( string  $module_path)

Definition at line 290 of file class.ilWACPath.php.

290 : void
291 {
292 $this->module_path = $module_path;
293 }

References $module_path.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setModuleType()

ilWACPath::setModuleType ( string  $module_type)

Definition at line 490 of file class.ilWACPath.php.

490 : void
491 {
492 $this->module_type = $module_type;
493 }

References $module_type.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setOriginalRequest()

ilWACPath::setOriginalRequest ( string  $original_request)

Definition at line 460 of file class.ilWACPath.php.

460 : void
461 {
462 $this->original_request = $original_request;
463 }

References $original_request.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setParameters()

ilWACPath::setParameters ( array  $parameters)
Parameters
string[]$parameters

Definition at line 181 of file class.ilWACPath.php.

181 : void
182 {
183 $this->parameters = $parameters;
184 }

References $parameters, and ILIAS\UI\examples\Prompt\Standard\parameters().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPath()

ilWACPath::setPath ( string  $path)

Definition at line 430 of file class.ilWACPath.php.

430 : void
431 {
432 $this->path = $path;
433 }

References $path.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setPathWithoutQuery()

ilWACPath::setPathWithoutQuery ( string  $path_without_query)

Definition at line 305 of file class.ilWACPath.php.

305 : void
306 {
307 $this->path_without_query = $path_without_query;
308 }

References $path_without_query.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setPrefix()

ilWACPath::setPrefix ( string  $prefix)

Definition at line 270 of file class.ilWACPath.php.

270 : void
271 {
272 $this->prefix = $prefix;
273 }

References $prefix.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setQuery()

ilWACPath::setQuery ( string  $query)

Definition at line 440 of file class.ilWACPath.php.

440 : void
441 {
442 $this->query = $query;
443 }

References $query.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setSecurePath()

ilWACPath::setSecurePath ( string  $secure_path)

Definition at line 470 of file class.ilWACPath.php.

470 : void
471 {
472 $this->secure_path = $secure_path;
473 }

References $secure_path.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setSecurePathId()

ilWACPath::setSecurePathId ( string  $secure_path_id)

Definition at line 411 of file class.ilWACPath.php.

411 : void
412 {
413 $this->secure_path_id = $secure_path_id;
414 }

References $secure_path_id.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setSuffix()

ilWACPath::setSuffix ( string  $suffix)

Definition at line 320 of file class.ilWACPath.php.

320 : void
321 {
322 $this->suffix = $suffix;
323 }

References $suffix.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setTimestamp()

ilWACPath::setTimestamp ( int  $timestamp)

Definition at line 379 of file class.ilWACPath.php.

379 : void
380 {
382 $this->timestamp = $timestamp;
383 }

References $timestamp, ILIAS\UI\examples\Prompt\Standard\parameters(), and ilWACSignedPath\WAC_TIMESTAMP_ID.

Referenced by handleParameters().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setToken()

ilWACPath::setToken ( string  $token)

Definition at line 368 of file class.ilWACPath.php.

368 : void
369 {
371 $this->token = $token;
372 }

References $token, ILIAS\UI\examples\Prompt\Standard\parameters(), and ilWACSignedPath\WAC_TOKEN_ID.

Referenced by handleParameters().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTTL()

ilWACPath::setTTL ( int  $ttl)

Definition at line 390 of file class.ilWACPath.php.

390 : void
391 {
393 $this->ttl = $ttl;
394 }

References $ttl, ILIAS\UI\examples\Prompt\Standard\parameters(), and ilWACSignedPath\WAC_TTL_ID.

Referenced by handleParameters().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setVideoSuffixes()

static ilWACPath::setVideoSuffixes ( array  $video_suffixes)
static
Parameters
string[]$video_suffixes

Definition at line 229 of file class.ilWACPath.php.

229 : void
230 {
231 self::$video_suffixes = $video_suffixes;
232 }

References $video_suffixes.

Field Documentation

◆ $appendix

string ilWACPath::$appendix = ''
protected

Definition at line 81 of file class.ilWACPath.php.

Referenced by getAppendix(), and setAppendix().

◆ $audio_suffixes

array ilWACPath::$audio_suffixes
staticprotected
Initial value:
= [
'mp3',
'aiff',
'aif',
'm4a',
'wav',
]

Definition at line 57 of file class.ilWACPath.php.

Referenced by getAudioSuffixes(), and setAudioSuffixes().

◆ $client

string ilWACPath::$client = ''
protected

Definition at line 65 of file class.ilWACPath.php.

Referenced by getClient(), and setClient().

◆ $file_name

string ilWACPath::$file_name = ''
protected

Definition at line 77 of file class.ilWACPath.php.

Referenced by getFileName(), and setFileName().

◆ $image_suffixes

array ilWACPath::$image_suffixes
staticprotected
Initial value:
= [
'png',
'jpg',
'jpeg',
'gif',
'svg',
]

Definition at line 37 of file class.ilWACPath.php.

Referenced by getImageSuffixes(), and setImageSuffixes().

◆ $in_sec_folder

bool ilWACPath::$in_sec_folder = false
protected

Definition at line 70 of file class.ilWACPath.php.

Referenced by isInSecFolder(), and setInSecFolder().

◆ $module_identifier

string ilWACPath::$module_identifier = ''
protected

Definition at line 85 of file class.ilWACPath.php.

Referenced by getModuleIdentifier(), and setModuleIdentifier().

◆ $module_path

string ilWACPath::$module_path = ''
protected

Definition at line 82 of file class.ilWACPath.php.

Referenced by __construct(), getModulePath(), and setModulePath().

◆ $module_type

string ilWACPath::$module_type = ''
protected

Definition at line 84 of file class.ilWACPath.php.

Referenced by getModuleType(), and setModuleType().

◆ $original_request

string ilWACPath::$original_request = ''
protected

Definition at line 76 of file class.ilWACPath.php.

Referenced by getOriginalRequest(), and setOriginalRequest().

◆ $parameters

array ilWACPath::$parameters = []
protected

Definition at line 69 of file class.ilWACPath.php.

Referenced by getParameters(), and setParameters().

◆ $path

string ilWACPath::$path = ''
protected

Definition at line 83 of file class.ilWACPath.php.

Referenced by __construct(), getPath(), normalizePath(), and setPath().

◆ $path_without_query

string ilWACPath::$path_without_query = ''
protected

Definition at line 86 of file class.ilWACPath.php.

Referenced by getPathWithoutQuery(), and setPathWithoutQuery().

◆ $prefix

string ilWACPath::$prefix = ''
protected

Definition at line 80 of file class.ilWACPath.php.

Referenced by getPrefix(), and setPrefix().

◆ $query

string ilWACPath::$query = ''
protected

Definition at line 78 of file class.ilWACPath.php.

Referenced by __construct(), getQuery(), normalizePath(), and setQuery().

◆ $secure_path

string ilWACPath::$secure_path = ''
protected

Definition at line 74 of file class.ilWACPath.php.

Referenced by getSecurePath(), and setSecurePath().

◆ $secure_path_id

string ilWACPath::$secure_path_id = ''
protected

Definition at line 75 of file class.ilWACPath.php.

Referenced by getSecurePathId(), and setSecurePathId().

◆ $suffix

string ilWACPath::$suffix = ''
protected

Definition at line 79 of file class.ilWACPath.php.

Referenced by getSuffix(), and setSuffix().

◆ $timestamp

int ilWACPath::$timestamp = 0
protected

Definition at line 72 of file class.ilWACPath.php.

Referenced by getTimestamp(), and setTimestamp().

◆ $token

string ilWACPath::$token = ''
protected

Definition at line 71 of file class.ilWACPath.php.

Referenced by getToken(), and setToken().

◆ $ttl

int ilWACPath::$ttl = 0
protected

Definition at line 73 of file class.ilWACPath.php.

Referenced by getTTL(), and setTTL().

◆ $video_suffixes

array ilWACPath::$video_suffixes
staticprotected
Initial value:
= [
'mp4',
'm4v',
'mov',
'wmv',
'webm',
]

Definition at line 47 of file class.ilWACPath.php.

Referenced by getVideoSuffixes(), and setVideoSuffixes().

◆ DIR_DATA

const ilWACPath::DIR_DATA = "data"

Definition at line 28 of file class.ilWACPath.php.

◆ DIR_SEC

const ilWACPath::DIR_SEC = "sec"

Definition at line 29 of file class.ilWACPath.php.

◆ REGEX

const ilWACPath::REGEX = "(?<prefix>.*?)(?<path>(?<path_without_query>(?<secure_path_id>(?<module_path>\/data\/(?<client>[\w\-\.]*)\/(?<sec>sec\/|)(?<module_type>.*?)\/(?<module_identifier>.*\/|)))(?<appendix>[^\?\n]*)).*)"

Copy this without to regex101.com and test with some URL of files.

Definition at line 33 of file class.ilWACPath.php.


The documentation for this class was generated from the following file: