19 declare(strict_types=1);
37 public function getPathname(
string $extension =
'',
string $additional =
''): string
39 if ($this->path !==
null) {
42 if ($extension ===
'') {
43 throw new \ilException(
'Missing file extension! Please pass a file extension of type string.');
46 if (substr_count($extension,
'.') > 1 || (strpos($extension,
'.') !==
false && strpos($extension,
'.') !== 0)) {
47 throw new \ilException(
'Please use at most one dot in your file extension.');
50 if (strpos($extension,
'.') === 0) {
51 $extension = substr($extension, 1);
54 $corrected_additional =
'_';
55 if ($additional !==
'') {
56 if (strpos($additional,
'__') === 0) {
57 throw new ilException(
'The additional file part may not contain __ at the beginning!');
60 $corrected_additional =
'__' . $additional .
'_';
64 . $corrected_additional . $this->test_id .
'.' . $extension;
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getPathname(string $extension='', string $additional='')
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
__construct(private int $test_id)