ILIAS  release_8 Revision v8.24
ilAssQuestionProcessLockFileStorage Class Reference
+ Inheritance diagram for ilAssQuestionProcessLockFileStorage:
+ Collaboration diagram for ilAssQuestionProcessLockFileStorage:

Public Member Functions

 __construct (int $questionId, $userId)
 
 getPath ()
 
 create ()
 
- Public Member Functions inherited from ilFileSystemAbstractionStorage
 __construct (int $a_storage_type, bool $a_path_conversion, int $a_container_id)
 Constructor. More...
 
 fileExists (string $a_absolute_path)
 
 getContainerId ()
 
 writeToFile (string $a_data, $a_absolute_path)
 
 copyFile (string $a_from, string $a_to)
 
 create ()
 
 getAbsolutePath ()
 Calculates the full path on the filesystem. More...
 
 delete ()
 
 deleteDirectory (string $a_abs_name)
 
 deleteFile (string $a_abs_name)
 
 appendToPath (string $a_appendix)
 
 getStorageType ()
 
 getPath ()
 

Protected Member Functions

 getPathPrefix ()
 Get path prefix. More...
 
 getPathPostfix ()
 Get directory name. More...
 
- Protected Member Functions inherited from ilFileSystemAbstractionStorage
 getLegacyFullAbsolutePath (string $relative_path)
 
 getFileSystemService ()
 
 getPathPrefix ()
 Get path prefix. More...
 
 getPathPostfix ()
 Get directory name. More...
 
 getLegacyAbsolutePath ()
 Calculates the absolute filesystem storage location. More...
 
 init ()
 

Private Member Functions

 initSubPath ($userId)
 

Private Attributes

 $subPath
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFileSystemAbstractionStorage
static createPathFromId (int $a_container_id, string $a_name)
 
static _copyDirectory (string $a_sdir, string $a_tdir)
 
- Data Fields inherited from ilFileSystemAbstractionStorage
const STORAGE_WEB = 1
 
const STORAGE_DATA = 2
 
const STORAGE_SECURED = 3
 
- Protected Attributes inherited from ilFileSystemAbstractionStorage
string $path = null
 
ILIAS Filesystem Filesystems $file_system_service
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionProcessLockFileStorage::__construct ( int  $questionId,
  $userId 
)

Member Function Documentation

◆ create()

ilAssQuestionProcessLockFileStorage::create ( )

Reimplemented from ilFileSystemAbstractionStorage.

Definition at line 67 of file class.ilAssQuestionProcessLockFileStorage.php.

67 : void
68 {
69 set_error_handler(function ($severity, $message, $file, $line): void {
70 throw new ErrorException($message, $severity, 0, $file, $line);
71 });
72
73 try {
74 parent::create($this->getPath());
75 restore_error_handler();
76 } catch (Exception $e) {
77 restore_error_handler();
78 }
79
80 if (!$this->getFileSystemService()->has($this->path)) {
81 throw new ErrorException(sprintf('Could not find directory: %s', $this->getPath()));
82 }
83 }
has(string $class_name)
$message
Definition: xapiexit.php:32

References Vendor\Package\$e, $message, ilFileSystemAbstractionStorage\getFileSystemService(), getPath(), and ILIAS\GlobalScreen\has().

+ Here is the call graph for this function:

◆ getPath()

ilAssQuestionProcessLockFileStorage::getPath ( )

Reimplemented from ilFileSystemAbstractionStorage.

Definition at line 62 of file class.ilAssQuestionProcessLockFileStorage.php.

62 : string
63 {
64 return parent::getPath() . '/' . $this->subPath;
65 }

References $subPath.

Referenced by create().

+ Here is the caller graph for this function:

◆ getPathPostfix()

ilAssQuestionProcessLockFileStorage::getPathPostfix ( )
protected

Get directory name.

E.g for files => file Only relative path, no trailing slash '_<obj_id>' will be appended automatically

@access protected

Returns
string directory name

Reimplemented from ilFileSystemAbstractionStorage.

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

57 : string
58 {
59 return 'question';
60 }

◆ getPathPrefix()

ilAssQuestionProcessLockFileStorage::getPathPrefix ( )
protected

Get path prefix.

Prefix that will be prepended to the path No trailing slash. E.g ilFiles for files

@access protected

Returns
string path prefix e.g files

Reimplemented from ilFileSystemAbstractionStorage.

Definition at line 43 of file class.ilAssQuestionProcessLockFileStorage.php.

43 : string
44 {
45 return 'ilAssQuestionProcessLocks';
46 }

◆ initSubPath()

ilAssQuestionProcessLockFileStorage::initSubPath (   $userId)
private

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

85 : void
86 {
87 $userId = (string) $userId;
88
89 $path = array();
90
91 for ($i = 0, $max = strlen($userId); $i < $max; $i++) {
92 $path[] = substr($userId, $i, 1);
93 }
94
95 $this->subPath = implode('/', $path);
96 }
$i
Definition: metadata.php:41

References $i, and ilFileSystemAbstractionStorage\$path.

Referenced by __construct().

+ Here is the caller graph for this function:

Field Documentation

◆ $subPath

ilAssQuestionProcessLockFileStorage::$subPath
private

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

Referenced by getPath().


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