ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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, bool $normalize=true)
 
 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 25 of file class.ilWACPath.php.

Constructor & Destructor Documentation

◆ __construct()

ilWACPath::__construct ( string  $path,
bool  $normalize = true 
)

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

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

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

Member Function Documentation

◆ fileExists()

ilWACPath::fileExists ( )

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

References getPathWithoutQuery().

340  : bool
341  {
342  return is_file($this->getPathWithoutQuery());
343  }
+ Here is the call graph for this function:

◆ getAppendix()

ilWACPath::getAppendix ( )

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

References $appendix.

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

◆ getAudioSuffixes()

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

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

190  : array
191  {
192  return self::$audio_suffixes;
193  }

◆ getCleanURLdecodedPath()

ilWACPath::getCleanURLdecodedPath ( )

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

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

References getPathWithoutQuery().

421  : string
422  {
423  return rawurldecode($this->getPathWithoutQuery());
424  }
+ Here is the call graph for this function:

◆ getClient()

ilWACPath::getClient ( )

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

References $client.

393  : string
394  {
395  return $this->client;
396  }
string $client

◆ getDirName()

ilWACPath::getDirName ( )

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

References getPathWithoutQuery().

295  : string
296  {
297  return dirname($this->getPathWithoutQuery());
298  }
+ Here is the call graph for this function:

◆ getFileName()

ilWACPath::getFileName ( )

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

References $file_name.

Referenced by ilObjUserAccess\canBeDelivered().

441  : string
442  {
443  return $this->file_name;
444  }
string $file_name
+ Here is the caller graph for this function:

◆ getImageSuffixes()

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

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

206  : array
207  {
208  return self::$image_suffixes;
209  }

◆ getModuleIdentifier()

ilWACPath::getModuleIdentifier ( )

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

References $module_identifier.

Referenced by __construct().

491  : string
492  {
494  }
string $module_identifier
+ Here is the caller graph for this function:

◆ getModulePath()

ilWACPath::getModulePath ( )

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

References $module_path.

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

◆ getModuleType()

ilWACPath::getModuleType ( )

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

References $module_type.

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

481  : string
482  {
483  return $this->module_type;
484  }
string $module_type
+ Here is the caller graph for this function:

◆ getOriginalRequest()

ilWACPath::getOriginalRequest ( )

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

References $original_request.

451  : string
452  {
454  }
string $original_request

◆ getParameters()

ilWACPath::getParameters ( )
Returns
string[]

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

References $parameters.

Referenced by handleParameters().

174  : array
175  {
176  return $this->parameters;
177  }
array $parameters
+ Here is the caller graph for this function:

◆ getPath()

◆ getPathWithoutQuery()

ilWACPath::getPathWithoutQuery ( )

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

References $path_without_query.

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

300  : string
301  {
303  }
string $path_without_query
+ Here is the caller graph for this function:

◆ getPrefix()

ilWACPath::getPrefix ( )

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

References $prefix.

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

◆ getQuery()

ilWACPath::getQuery ( )

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

References $query.

431  : string
432  {
433  return $this->query;
434  }

◆ getSecurePath()

ilWACPath::getSecurePath ( )

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

References $secure_path.

461  : string
462  {
463  return $this->secure_path;
464  }
string $secure_path

◆ getSecurePathId()

ilWACPath::getSecurePathId ( )

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

References $secure_path_id.

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

403  : string
404  {
405  return $this->secure_path_id;
406  }
string $secure_path_id
+ Here is the caller graph for this function:

◆ getSuffix()

ilWACPath::getSuffix ( )

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

References $suffix.

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

315  : string
316  {
317  return $this->suffix;
318  }
string $suffix
+ Here is the caller graph for this function:

◆ getTimestamp()

ilWACPath::getTimestamp ( )

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

References $timestamp.

371  : int
372  {
373  return $this->timestamp;
374  }

◆ getToken()

ilWACPath::getToken ( )

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

References $token.

360  : string
361  {
362  return $this->token;
363  }

◆ getTTL()

ilWACPath::getTTL ( )

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

References $ttl.

382  : int
383  {
384  return $this->ttl;
385  }

◆ getVideoSuffixes()

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

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

222  : array
223  {
224  return self::$video_suffixes;
225  }

◆ handleParameters()

ilWACPath::handleParameters ( )
protected

Definition at line 157 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().

157  : void
158  {
159  $param = $this->getParameters();
161  $this->setToken($param[ilWACSignedPath::WAC_TOKEN_ID]);
162  }
164  $this->setTimestamp((int) $param[ilWACSignedPath::WAC_TIMESTAMP_ID]);
165  }
166  if (isset($param[ilWACSignedPath::WAC_TTL_ID])) {
167  $this->setTTL((int) $param[ilWACSignedPath::WAC_TTL_ID]);
168  }
169  }
setTTL(int $ttl)
setTimestamp(int $timestamp)
$param
Definition: xapitoken.php:46
setToken(string $token)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasTimestamp()

ilWACPath::hasTimestamp ( )

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

350  : bool
351  {
352  return ($this->timestamp !== 0);
353  }

◆ hasToken()

ilWACPath::hasToken ( )

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

345  : bool
346  {
347  return ($this->token !== '');
348  }

◆ hasTTL()

ilWACPath::hasTTL ( )

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

355  : bool
356  {
357  return ($this->ttl !== 0);
358  }

◆ isAudio()

ilWACPath::isAudio ( )

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

References getSuffix().

Referenced by isStreamable().

330  : bool
331  {
332  return in_array(strtolower($this->getSuffix()), self::$audio_suffixes);
333  }
+ 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.

References getSuffix().

310  : bool
311  {
312  return in_array(strtolower($this->getSuffix()), self::$image_suffixes);
313  }
+ Here is the call graph for this function:

◆ isInSecFolder()

ilWACPath::isInSecFolder ( )

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

References $in_sec_folder.

471  : bool
472  {
473  return $this->in_sec_folder;
474  }
bool $in_sec_folder

◆ isStreamable()

ilWACPath::isStreamable ( )

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

References isAudio(), and isVideo().

325  : bool
326  {
327  return ($this->isAudio() || $this->isVideo());
328  }
+ Here is the call graph for this function:

◆ isVideo()

ilWACPath::isVideo ( )

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

References getSuffix().

Referenced by isStreamable().

335  : bool
336  {
337  return in_array(strtolower($this->getSuffix()), self::$video_suffixes);
338  }
+ 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 235 of file class.ilWACPath.php.

References $query, and ilWACException\NOT_FOUND.

Referenced by __construct().

235  : string
236  {
237  $path = ltrim($path, '.');
238  $path = rawurldecode($path);
239 
240  // cut everything before "data/" (for installations using a subdirectory)
241  $path = strstr($path, '/' . self::DIR_DATA . '/');
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 (strpos($realpath, $real_data_dir) !== 0) {
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  }
+ Here is the caller graph for this function:

◆ setAppendix()

ilWACPath::setAppendix ( string  $appendix)

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

References $appendix.

Referenced by __construct().

280  : void
281  {
282  $this->appendix = $appendix;
283  }
string $appendix
+ Here is the caller graph for this function:

◆ setAudioSuffixes()

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

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

References $audio_suffixes.

198  : void
199  {
200  self::$audio_suffixes = $audio_suffixes;
201  }
static array $audio_suffixes

◆ setClient()

ilWACPath::setClient ( string  $client)

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

References $client.

Referenced by __construct().

398  : void
399  {
400  $this->client = $client;
401  }
string $client
+ Here is the caller graph for this function:

◆ setFileName()

ilWACPath::setFileName ( string  $file_name)

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

References $file_name.

Referenced by __construct().

446  : void
447  {
448  $this->file_name = $file_name;
449  }
string $file_name
+ Here is the caller graph for this function:

◆ setImageSuffixes()

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

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

References $image_suffixes.

214  : void
215  {
216  self::$image_suffixes = $image_suffixes;
217  }
static array $image_suffixes

◆ setInSecFolder()

ilWACPath::setInSecFolder ( bool  $in_sec_folder)

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

References $in_sec_folder.

Referenced by __construct().

476  : void
477  {
478  $this->in_sec_folder = $in_sec_folder;
479  }
bool $in_sec_folder
+ Here is the caller graph for this function:

◆ setModuleIdentifier()

ilWACPath::setModuleIdentifier ( string  $module_identifier)

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

References $module_identifier.

Referenced by __construct().

496  : void
497  {
498  $this->module_identifier = $module_identifier;
499  }
string $module_identifier
+ Here is the caller graph for this function:

◆ setModulePath()

ilWACPath::setModulePath ( string  $module_path)

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

References $module_path.

Referenced by __construct().

290  : void
291  {
292  $this->module_path = $module_path;
293  }
string $module_path
+ Here is the caller graph for this function:

◆ setModuleType()

ilWACPath::setModuleType ( string  $module_type)

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

References $module_type.

Referenced by __construct().

486  : void
487  {
488  $this->module_type = $module_type;
489  }
string $module_type
+ Here is the caller graph for this function:

◆ setOriginalRequest()

ilWACPath::setOriginalRequest ( string  $original_request)

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

References $original_request.

Referenced by __construct().

456  : void
457  {
458  $this->original_request = $original_request;
459  }
string $original_request
+ Here is the caller graph for this function:

◆ setParameters()

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

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

References $parameters.

Referenced by __construct().

182  : void
183  {
184  $this->parameters = $parameters;
185  }
array $parameters
+ Here is the caller graph for this function:

◆ setPath()

ilWACPath::setPath ( string  $path)

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

References $path.

Referenced by __construct().

426  : void
427  {
428  $this->path = $path;
429  }
+ Here is the caller graph for this function:

◆ setPathWithoutQuery()

ilWACPath::setPathWithoutQuery ( string  $path_without_query)

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

References $path_without_query.

Referenced by __construct().

305  : void
306  {
307  $this->path_without_query = $path_without_query;
308  }
string $path_without_query
+ Here is the caller graph for this function:

◆ setPrefix()

ilWACPath::setPrefix ( string  $prefix)

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

References $prefix.

Referenced by __construct().

270  : void
271  {
272  $this->prefix = $prefix;
273  }
string $prefix
+ Here is the caller graph for this function:

◆ setQuery()

ilWACPath::setQuery ( string  $query)

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

References $query.

Referenced by __construct().

436  : void
437  {
438  $this->query = $query;
439  }
+ Here is the caller graph for this function:

◆ setSecurePath()

ilWACPath::setSecurePath ( string  $secure_path)

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

References $secure_path.

Referenced by __construct().

466  : void
467  {
468  $this->secure_path = $secure_path;
469  }
string $secure_path
+ Here is the caller graph for this function:

◆ setSecurePathId()

ilWACPath::setSecurePathId ( string  $secure_path_id)

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

References $secure_path_id.

Referenced by __construct().

408  : void
409  {
410  $this->secure_path_id = $secure_path_id;
411  }
string $secure_path_id
+ Here is the caller graph for this function:

◆ setSuffix()

ilWACPath::setSuffix ( string  $suffix)

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

References $suffix.

Referenced by __construct().

320  : void
321  {
322  $this->suffix = $suffix;
323  }
string $suffix
+ Here is the caller graph for this function:

◆ setTimestamp()

ilWACPath::setTimestamp ( int  $timestamp)

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

References $timestamp, and ilWACSignedPath\WAC_TIMESTAMP_ID.

Referenced by handleParameters().

376  : void
377  {
378  $this->parameters[ilWACSignedPath::WAC_TIMESTAMP_ID] = $timestamp;
379  $this->timestamp = $timestamp;
380  }
+ Here is the caller graph for this function:

◆ setToken()

ilWACPath::setToken ( string  $token)

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

References $token, and ilWACSignedPath\WAC_TOKEN_ID.

Referenced by handleParameters().

365  : void
366  {
367  $this->parameters[ilWACSignedPath::WAC_TOKEN_ID] = $token;
368  $this->token = $token;
369  }
+ Here is the caller graph for this function:

◆ setTTL()

ilWACPath::setTTL ( int  $ttl)

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

References $ttl, and ilWACSignedPath\WAC_TTL_ID.

Referenced by handleParameters().

387  : void
388  {
389  $this->parameters[ilWACSignedPath::WAC_TTL_ID] = $ttl;
390  $this->ttl = $ttl;
391  }
+ Here is the caller graph for this function:

◆ setVideoSuffixes()

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

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

References $video_suffixes.

230  : void
231  {
232  self::$video_suffixes = $video_suffixes;
233  }
static array $video_suffixes

Field Documentation

◆ $appendix

string ilWACPath::$appendix = ''
protected

Definition at line 80 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 56 of file class.ilWACPath.php.

Referenced by setAudioSuffixes().

◆ $client

string ilWACPath::$client = ''
protected

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

Referenced by getClient(), and setClient().

◆ $file_name

string ilWACPath::$file_name = ''
protected

Definition at line 76 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 36 of file class.ilWACPath.php.

Referenced by setImageSuffixes().

◆ $in_sec_folder

bool ilWACPath::$in_sec_folder = false
protected

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

Referenced by isInSecFolder(), and setInSecFolder().

◆ $module_identifier

string ilWACPath::$module_identifier = ''
protected

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

Referenced by getModuleIdentifier(), and setModuleIdentifier().

◆ $module_path

string ilWACPath::$module_path = ''
protected

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

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

◆ $module_type

string ilWACPath::$module_type = ''
protected

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

Referenced by getModuleType(), and setModuleType().

◆ $original_request

string ilWACPath::$original_request = ''
protected

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

Referenced by getOriginalRequest(), and setOriginalRequest().

◆ $parameters

array ilWACPath::$parameters = []
protected

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

Referenced by getParameters(), and setParameters().

◆ $path

string ilWACPath::$path = ''
protected

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

Referenced by getPath(), and setPath().

◆ $path_without_query

string ilWACPath::$path_without_query = ''
protected

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

Referenced by getPathWithoutQuery(), and setPathWithoutQuery().

◆ $prefix

string ilWACPath::$prefix = ''
protected

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

Referenced by getPrefix(), and setPrefix().

◆ $query

string ilWACPath::$query = ''
protected

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

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

◆ $secure_path

string ilWACPath::$secure_path = ''
protected

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

Referenced by getSecurePath(), and setSecurePath().

◆ $secure_path_id

string ilWACPath::$secure_path_id = ''
protected

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

Referenced by getSecurePathId(), and setSecurePathId().

◆ $suffix

string ilWACPath::$suffix = ''
protected

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

Referenced by getSuffix(), and setSuffix().

◆ $timestamp

int ilWACPath::$timestamp = 0
protected

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

Referenced by getTimestamp(), and setTimestamp().

◆ $token

string ilWACPath::$token = ''
protected

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

Referenced by getToken(), and setToken().

◆ $ttl

int ilWACPath::$ttl = 0
protected

Definition at line 72 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 46 of file class.ilWACPath.php.

Referenced by setVideoSuffixes().

◆ DIR_DATA

const ilWACPath::DIR_DATA = "data"

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

◆ DIR_SEC

const ilWACPath::DIR_SEC = "sec"

Definition at line 28 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 32 of file class.ilWACPath.php.


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