ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilWACPath Class Reference

Class ilWACPath. More...

+ Collaboration diagram for ilWACPath:

Public Member Functions

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

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

Static Protected Attributes

static $image_suffixes = ['png', 'jpg', 'jpeg', 'gif', 'svg']
 
static $video_suffixes = ['mp4', 'm4v', 'mov', 'wmv', 'webm']
 
static $audio_suffixes = ['mp3', 'aiff', 'aif', 'm4a', 'wav']
 

Detailed Description

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,
bool  $normalize = true 
)

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

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

125  {
126  if ($normalize) {
127  $path = $this->normalizePath($path);
128  }
129 
130  $this->setOriginalRequest($path);
131 
132  $re = '/' . self::REGEX . '/';
133  preg_match($re, $path, $result);
134 
135  $result['path_without_query'] = strstr(
136  parse_url($path)['path'],
137  '/data/',
138  false
139  );
140 
141  foreach ($result as $k => $v) {
142  if (is_numeric($k)) {
143  unset($result[$k]);
144  }
145  }
146 
147  $moduleId = strstr($result['module_identifier'] ?? '', "/", true);
148  $moduleId = $moduleId === false ? '' : $moduleId;
149 
150  $this->setPrefix($result['prefix'] ?? '');
151  $this->setClient($result['client'] ?? '');
152  $this->setAppendix($result['appendix'] ?? '');
153  $this->setModuleIdentifier($moduleId);
154  $this->setModuleType($result['module_type'] ?? '');
155 
156  $modulePath = null;
157 
158  if ($this->getModuleIdentifier()) {
159  $modulePath = strstr($result['module_path'] ?? '', $this->getModuleIdentifier(), true);
160  $modulePath = '.' . ($modulePath === false ? '' : $modulePath);
161  } else {
162  $modulePath = ('.' . ($result['module_path'] ?? ''));
163  }
164 
165  $this->setModulePath((string) $modulePath);
166  $this->setInSecFolder(($result['sec'] ?? null) === 'sec/');
167  $this->setPathWithoutQuery('.' . ($result['path_without_query'] ?? ''));
168  $this->setPath('.' . ($result['path'] ?? ''));
169  $this->setSecurePath('.' . ($result['secure_path_id'] ?? ''));
170  $this->setSecurePathId($result['module_type'] ?? '');
171  // Pathinfo
172  $parts = parse_url($path);
173  $this->setFileName(basename($parts['path']));
174  if (isset($parts['query'])) {
175  $parts_query = $parts['query'];
176  $this->setQuery($parts_query);
177  parse_str($parts_query, $query);
178  $this->setParameters($query);
179  }
180  $this->setSuffix(pathinfo($parts['path'], PATHINFO_EXTENSION));
181  $this->handleParameters();
182  }
setPathWithoutQuery($path_without_query)
setQuery($query)
$result
setModulePath($module_path)
setClient($client)
setParameters(array $parameters)
setModuleType($module_type)
setSuffix($suffix)
setSecurePath($secure_path)
setModuleIdentifier($module_identifier)
setPrefix($prefix)
normalizePath(string $path)
setSecurePathId($secure_path_id)
setFileName($file_name)
setAppendix($appendix)
setOriginalRequest($original_request)
setInSecFolder($in_sec_folder)
+ Here is the call graph for this function:

Member Function Documentation

◆ fileExists()

ilWACPath::fileExists ( )
Returns
bool

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

References getPathWithoutQuery().

445  {
446  return (bool) is_file($this->getPathWithoutQuery());
447  }
+ Here is the call graph for this function:

◆ getAppendix()

ilWACPath::getAppendix ( )
Returns
string

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

References $appendix.

324  {
325  return (string) $this->appendix;
326  }

◆ getAudioSuffixes()

static ilWACPath::getAudioSuffixes ( )
static
Returns
array

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

222  {
223  return (array) self::$audio_suffixes;
224  }

◆ getCleanURLdecodedPath()

ilWACPath::getCleanURLdecodedPath ( )

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

Returns
string

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

References getPathWithoutQuery().

589  {
590  return rawurldecode($this->getPathWithoutQuery());
591  }
+ Here is the call graph for this function:

◆ getClient()

ilWACPath::getClient ( )
Returns
string

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

References $client.

540  {
541  return (string) $this->client;
542  }

◆ getDirName()

ilWACPath::getDirName ( )
Returns
string

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

References getPathWithoutQuery().

362  {
363  return (string) dirname($this->getPathWithoutQuery());
364  }
+ Here is the call graph for this function:

◆ getFileName()

ilWACPath::getFileName ( )
Returns
string

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

References $file_name.

Referenced by ilObjUserAccess\canBeDelivered().

627  {
628  return (string) $this->file_name;
629  }
+ Here is the caller graph for this function:

◆ getImageSuffixes()

static ilWACPath::getImageSuffixes ( )
static
Returns
array

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

240  {
241  return (array) self::$image_suffixes;
242  }

◆ getModuleIdentifier()

ilWACPath::getModuleIdentifier ( )
Returns
string

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

References $module_identifier.

Referenced by __construct().

722  {
723  return (string) $this->module_identifier;
724  }
+ Here is the caller graph for this function:

◆ getModulePath()

ilWACPath::getModulePath ( )
Returns
string

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

References $module_path.

343  {
344  return (string) $this->module_path;
345  }

◆ getModuleType()

ilWACPath::getModuleType ( )
Returns
string

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

References $module_type.

Referenced by ilWACSecurePath\hasCheckingInstanceRegistered(), and ilWACSecurePath\returnDbTableName().

703  {
704  return (string) $this->module_type;
705  }
+ Here is the caller graph for this function:

◆ getOriginalRequest()

ilWACPath::getOriginalRequest ( )
Returns
string

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

References $original_request.

646  {
647  return (string) $this->original_request;
648  }

◆ getParameters()

ilWACPath::getParameters ( )
Returns
array

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

References $parameters.

Referenced by handleParameters().

204  {
205  return (array) $this->parameters;
206  }
+ Here is the caller graph for this function:

◆ getPath()

◆ getPathWithoutQuery()

ilWACPath::getPathWithoutQuery ( )
Returns
string

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

References $path_without_query.

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

371  {
372  return (string) $this->path_without_query;
373  }
+ Here is the caller graph for this function:

◆ getPrefix()

ilWACPath::getPrefix ( )
Returns
string

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

References $prefix.

305  {
306  return (string) $this->prefix;
307  }

◆ getQuery()

ilWACPath::getQuery ( )
Returns
string

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

References $query.

608  {
609  return (string) $this->query;
610  }

◆ getSecurePath()

ilWACPath::getSecurePath ( )
Returns
string

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

References $secure_path.

665  {
666  return (string) $this->secure_path;
667  }

◆ getSecurePathId()

ilWACPath::getSecurePathId ( )
Returns
string

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

References $secure_path_id.

Referenced by ilObjFileAccess\canBeDelivered(), and ilWACSecurePath\returnDbTableName().

559  {
560  return (string) $this->secure_path_id;
561  }
+ Here is the caller graph for this function:

◆ getSuffix()

ilWACPath::getSuffix ( )
Returns
string

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

References $suffix.

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

399  {
400  return (string) $this->suffix;
401  }
+ Here is the caller graph for this function:

◆ getTimestamp()

ilWACPath::getTimestamp ( )
Returns
int

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

References $timestamp.

501  {
502  return (int) $this->timestamp;
503  }

◆ getToken()

ilWACPath::getToken ( )
Returns
string

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

References $token.

481  {
482  return (string) $this->token;
483  }

◆ getTTL()

ilWACPath::getTTL ( )
Returns
int

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

References $ttl.

521  {
522  return (int) $this->ttl;
523  }

◆ getVideoSuffixes()

static ilWACPath::getVideoSuffixes ( )
static
Returns
array

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

258  {
259  return (array) self::$video_suffixes;
260  }

◆ handleParameters()

ilWACPath::handleParameters ( )
protected

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

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

Referenced by __construct().

186  {
187  $param = $this->getParameters();
189  $this->setToken($param[ilWACSignedPath::WAC_TOKEN_ID]);
190  }
192  $this->setTimestamp(intval($param[ilWACSignedPath::WAC_TIMESTAMP_ID]));
193  }
194  if (isset($param[ilWACSignedPath::WAC_TTL_ID])) {
195  $this->setTTL(intval($param[ilWACSignedPath::WAC_TTL_ID]));
196  }
197  }
setToken($token)
$param
Definition: xapitoken.php:29
setTimestamp($timestamp)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasTimestamp()

ilWACPath::hasTimestamp ( )
Returns
bool

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

463  {
464  return (bool) ($this->timestamp !== 0);
465  }

◆ hasToken()

ilWACPath::hasToken ( )
Returns
bool

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

454  {
455  return (bool) ($this->token !== '');
456  }

◆ hasTTL()

ilWACPath::hasTTL ( )
Returns
bool

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

472  {
473  return (bool) ($this->ttl !== 0);
474  }

◆ isAudio()

ilWACPath::isAudio ( )
Returns
bool

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

References getSuffix().

Referenced by isStreamable().

427  {
428  return (bool) in_array(strtolower($this->getSuffix()), self::$audio_suffixes);
429  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isImage()

ilWACPath::isImage ( )
Returns
bool

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

References getSuffix().

390  {
391  return (bool) in_array(strtolower($this->getSuffix()), self::$image_suffixes);
392  }
+ Here is the call graph for this function:

◆ isInSecFolder()

ilWACPath::isInSecFolder ( )
Returns
bool

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

References $in_sec_folder.

684  {
685  return (bool) $this->in_sec_folder;
686  }

◆ isStreamable()

ilWACPath::isStreamable ( )
Returns
bool

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

References isAudio(), and isVideo().

418  {
419  return (bool) ($this->isAudio() || $this->isVideo());
420  }
+ Here is the call graph for this function:

◆ isVideo()

ilWACPath::isVideo ( )
Returns
bool

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

References getSuffix().

Referenced by isStreamable().

436  {
437  return (bool) in_array(strtolower($this->getSuffix()), self::$video_suffixes);
438  }
+ 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 271 of file class.ilWACPath.php.

References $query, and ilWACException\NOT_FOUND.

Referenced by __construct().

271  : string
272  {
273  $path = ltrim($path, '.');
274  $path = rawurldecode($path);
275 
276  // cut everything before "data/" (for installations using a subdirectory)
277  $path = strstr($path, '/' . self::DIR_DATA . '/');
278 
279  $original_path = parse_url($path, PHP_URL_PATH);
280  $query = parse_url($path, PHP_URL_QUERY);
281 
282  $real_data_dir = realpath("./" . self::DIR_DATA);
283  $realpath = realpath("." . $original_path);
284 
285  if (strpos($realpath, (string) $real_data_dir) !== 0) {
286  throw new ilWACException(ilWACException::NOT_FOUND, "Path is not in data directory");
287  }
288 
289  $normalized_path = ltrim(
290  str_replace(
291  $real_data_dir,
292  '',
293  $realpath
294  ),
295  '/'
296  );
297 
298  return "/" . self::DIR_DATA . '/' . $normalized_path . (!empty($query) ? '?' . $query : '');
299  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ setAppendix()

ilWACPath::setAppendix (   $appendix)
Parameters
string$appendix

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

References $appendix.

Referenced by __construct().

333  {
334  assert(is_string($appendix));
335  $this->appendix = $appendix;
336  }
+ Here is the caller graph for this function:

◆ setAudioSuffixes()

static ilWACPath::setAudioSuffixes ( array  $audio_suffixes)
static
Parameters
array$audio_suffixes

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

References $audio_suffixes.

231  {
232  self::$audio_suffixes = $audio_suffixes;
233  }
static $audio_suffixes

◆ setClient()

ilWACPath::setClient (   $client)
Parameters
string$client

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

References $client.

Referenced by __construct().

549  {
550  assert(is_string($client));
551  $this->client = $client;
552  }
+ Here is the caller graph for this function:

◆ setFileName()

ilWACPath::setFileName (   $file_name)
Parameters
string$file_name

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

References $file_name.

Referenced by __construct().

636  {
637  assert(is_string($file_name));
638  $this->file_name = $file_name;
639  }
+ Here is the caller graph for this function:

◆ setImageSuffixes()

static ilWACPath::setImageSuffixes ( array  $image_suffixes)
static
Parameters
array$image_suffixes

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

References $image_suffixes.

249  {
250  self::$image_suffixes = $image_suffixes;
251  }
static $image_suffixes

◆ setInSecFolder()

ilWACPath::setInSecFolder (   $in_sec_folder)
Parameters
bool$in_sec_folder

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

References $in_sec_folder.

Referenced by __construct().

693  {
694  assert(is_bool($in_sec_folder));
695  $this->in_sec_folder = $in_sec_folder;
696  }
+ Here is the caller graph for this function:

◆ setModuleIdentifier()

ilWACPath::setModuleIdentifier (   $module_identifier)
Parameters
string$module_identifier

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

References $module_identifier.

Referenced by __construct().

731  {
732  assert(is_string($module_identifier));
733  $this->module_identifier = $module_identifier;
734  }
+ Here is the caller graph for this function:

◆ setModulePath()

ilWACPath::setModulePath (   $module_path)
Parameters
string$module_path

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

References $module_path.

Referenced by __construct().

352  {
353  assert(is_string($module_path));
354  $this->module_path = $module_path;
355  }
+ Here is the caller graph for this function:

◆ setModuleType()

ilWACPath::setModuleType (   $module_type)
Parameters
string$module_type

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

References $module_type.

Referenced by __construct().

712  {
713  assert(is_string($module_type));
714  $this->module_type = $module_type;
715  }
+ Here is the caller graph for this function:

◆ setOriginalRequest()

ilWACPath::setOriginalRequest (   $original_request)
Parameters
string$original_request

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

References $original_request.

Referenced by __construct().

655  {
656  assert(is_string($original_request));
657  $this->original_request = $original_request;
658  }
+ Here is the caller graph for this function:

◆ setParameters()

ilWACPath::setParameters ( array  $parameters)
Parameters
array$parameters

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

References $parameters.

Referenced by __construct().

213  {
214  $this->parameters = $parameters;
215  }
+ Here is the caller graph for this function:

◆ setPath()

ilWACPath::setPath (   $path)
Parameters
string$path

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

References $path.

Referenced by __construct().

598  {
599  assert(is_string($path));
600  $this->path = $path;
601  }
+ Here is the caller graph for this function:

◆ setPathWithoutQuery()

ilWACPath::setPathWithoutQuery (   $path_without_query)
Parameters
string$path_without_query

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

References $path_without_query.

Referenced by __construct().

380  {
381  assert(is_string($path_without_query));
382  $this->path_without_query = $path_without_query;
383  }
+ Here is the caller graph for this function:

◆ setPrefix()

ilWACPath::setPrefix (   $prefix)
Parameters
string$prefix

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

References $prefix.

Referenced by __construct().

314  {
315  assert(is_string($prefix));
316  $this->prefix = $prefix;
317  }
+ Here is the caller graph for this function:

◆ setQuery()

ilWACPath::setQuery (   $query)
Parameters
string$query

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

References $query.

Referenced by __construct().

617  {
618  assert(is_string($query));
619  $this->query = $query;
620  }
+ Here is the caller graph for this function:

◆ setSecurePath()

ilWACPath::setSecurePath (   $secure_path)
Parameters
string$secure_path

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

References $secure_path.

Referenced by __construct().

674  {
675  assert(is_string($secure_path));
676  $this->secure_path = $secure_path;
677  }
+ Here is the caller graph for this function:

◆ setSecurePathId()

ilWACPath::setSecurePathId (   $secure_path_id)
Parameters
string$secure_path_id

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

References $secure_path_id.

Referenced by __construct().

568  {
569  assert(is_string($secure_path_id));
570  $this->secure_path_id = $secure_path_id;
571  }
+ Here is the caller graph for this function:

◆ setSuffix()

ilWACPath::setSuffix (   $suffix)
Parameters
string$suffix

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

References $suffix.

Referenced by __construct().

408  {
409  assert(is_string($suffix));
410  $this->suffix = $suffix;
411  }
+ Here is the caller graph for this function:

◆ setTimestamp()

ilWACPath::setTimestamp (   $timestamp)
Parameters
int$timestamp

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

References $timestamp, and ilWACSignedPath\WAC_TIMESTAMP_ID.

Referenced by handleParameters().

510  {
511  assert(is_int($timestamp));
512  $this->parameters[ilWACSignedPath::WAC_TIMESTAMP_ID] = $timestamp;
513  $this->timestamp = $timestamp;
514  }
+ Here is the caller graph for this function:

◆ setToken()

ilWACPath::setToken (   $token)
Parameters
string$token

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

References $token, and ilWACSignedPath\WAC_TOKEN_ID.

Referenced by handleParameters().

490  {
491  assert(is_string($token));
492  $this->parameters[ilWACSignedPath::WAC_TOKEN_ID] = $token;
493  $this->token = $token;
494  }
+ Here is the caller graph for this function:

◆ setTTL()

ilWACPath::setTTL (   $ttl)
Parameters
int$ttl

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

References $ttl, and ilWACSignedPath\WAC_TTL_ID.

Referenced by handleParameters().

530  {
531  $this->parameters[ilWACSignedPath::WAC_TTL_ID] = $ttl;
532  $this->ttl = $ttl;
533  }
+ Here is the caller graph for this function:

◆ setVideoSuffixes()

static ilWACPath::setVideoSuffixes ( array  $video_suffixes)
static
Parameters
array$video_suffixes

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

References $video_suffixes.

267  {
268  self::$video_suffixes = $video_suffixes;
269  }
static $video_suffixes

Field Documentation

◆ $appendix

ilWACPath::$appendix = ''
protected

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

Referenced by getAppendix(), and setAppendix().

◆ $audio_suffixes

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

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

Referenced by setAudioSuffixes().

◆ $client

ilWACPath::$client = ''
protected

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

Referenced by getClient(), and setClient().

◆ $file_name

ilWACPath::$file_name = ''
protected

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

Referenced by getFileName(), and setFileName().

◆ $image_suffixes

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

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

Referenced by setImageSuffixes().

◆ $in_sec_folder

ilWACPath::$in_sec_folder = false
protected

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

Referenced by isInSecFolder(), and setInSecFolder().

◆ $module_identifier

ilWACPath::$module_identifier = ''
protected

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

Referenced by getModuleIdentifier(), and setModuleIdentifier().

◆ $module_path

ilWACPath::$module_path = ''
protected

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

Referenced by getModulePath(), and setModulePath().

◆ $module_type

ilWACPath::$module_type = ''
protected

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

Referenced by getModuleType(), and setModuleType().

◆ $original_request

ilWACPath::$original_request = ''
protected

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

Referenced by getOriginalRequest(), and setOriginalRequest().

◆ $parameters

ilWACPath::$parameters = []
protected

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

Referenced by getParameters(), and setParameters().

◆ $path

ilWACPath::$path = ''
protected

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

Referenced by getPath(), and setPath().

◆ $path_without_query

ilWACPath::$path_without_query = ''
protected

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

Referenced by getPathWithoutQuery(), and setPathWithoutQuery().

◆ $prefix

ilWACPath::$prefix = ''
protected

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

Referenced by getPrefix(), and setPrefix().

◆ $query

ilWACPath::$query = ''
protected

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

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

◆ $secure_path

ilWACPath::$secure_path = ''
protected

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

Referenced by getSecurePath(), and setSecurePath().

◆ $secure_path_id

ilWACPath::$secure_path_id = ''
protected

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

Referenced by getSecurePathId(), and setSecurePathId().

◆ $suffix

ilWACPath::$suffix = ''
protected

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

Referenced by getSuffix(), and setSuffix().

◆ $timestamp

ilWACPath::$timestamp = 0
protected

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

Referenced by getTimestamp(), and setTimestamp().

◆ $token

ilWACPath::$token = ''
protected

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

Referenced by getToken(), and setToken().

◆ $ttl

ilWACPath::$ttl = 0
protected

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

Referenced by getTTL(), and setTTL().

◆ $video_suffixes

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

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

Referenced by 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: