ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilAssQuestionProcessLockFileStorage Class Reference
+ Inheritance diagram for ilAssQuestionProcessLockFileStorage:
+ Collaboration diagram for ilAssQuestionProcessLockFileStorage:

Public Member Functions

 __construct ($questionId, $userId)
 
 getPath ()
 
 create ()
 
- Public Member Functions inherited from ilFileSystemStorage
 __construct ($a_storage_type, $a_path_conversion, $a_container_id)
 Constructor. More...
 
 getContainerId ()
 
 create ()
 Create directory. More...
 
 getAbsolutePath ()
 Get absolute path of storage directory. More...
 
 writeToFile ($a_data, $a_absolute_path)
 Write data to file. More...
 
 deleteFile ($a_abs_name)
 Delete file. More...
 
 deleteDirectory ($a_abs_name)
 Delete directory. More...
 
 delete ()
 Delete complete directory. More...
 
 copyFile ($a_from, $a_to)
 Copy files. More...
 
 appendToPath ($a_appendix)
 
 getStorageType ()
 
 getPath ()
 Get path. More...
 
 __construct ($a_storage_type, $a_path_conversion, $a_container_id)
 Constructor. More...
 
 create ()
 Create directory. More...
 
 getAbsolutePath ()
 Get absolute path of storage directory. More...
 
 getShortPath ()
 
 rename ($from, $to)
 

Protected Member Functions

 getPathPrefix ()
 Get path prefix. More...
 
 getPathPostfix ()
 Get directory name. More...
 
- Protected Member Functions inherited from ilFileSystemStorage
 getPathPrefix ()
 Get path prefix. More...
 
 getPathPostfix ()
 Get directory name. More...
 
 init ()
 Read path info. More...
 
 getPathPrefix ()
 Get path prefix. More...
 
 getPathPostfix ()
 Get directory name. More...
 

Private Member Functions

 initSubPath ($userId)
 

Private Attributes

 $subPath
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFileSystemStorage
static _createPathFromId ($a_container_id, $a_name)
 Create a path from an id: e.g 12345 will be converted to 12/34/<name>_5. More...
 
static _copyDirectory ($a_source, $a_target)
 Copy directory and all contents. More...
 
static _createPathFromId ($a_container_id, $a_name)
 Create a path from an id: e.g 12345 will be converted to 12/34/<name>_5. More...
 
- Data Fields inherited from ilFileSystemStorage
const STORAGE_WEB = 1
 
const STORAGE_DATA = 2
 
const STORAGE_SECURED = 3
 
const FACTOR = 100
 
const MAX_EXPONENT = 3
 
const SECURED_DIRECTORY = "sec"
 
- Protected Attributes inherited from ilFileSystemStorage
 $path
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionProcessLockFileStorage::__construct (   $questionId,
  $userId 
)

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

References initSubPath(), and ilFileSystemStorage\STORAGE_DATA.

17  {
18  parent::__construct(ilFileSystemStorage::STORAGE_DATA, true, $questionId);
19 
20  $this->initSubPath($userId);
21  }
+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilAssQuestionProcessLockFileStorage::create ( )

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

References $file, $message, getPath(), and ilUtil\makeDirParents().

56  {
57  set_error_handler(function ($severity, $message, $file, $line) {
58  throw new ErrorException($message, $severity, 0, $file, $line);
59  });
60 
61  try {
63  restore_error_handler();
64  } catch (Exception $e) {
65  restore_error_handler();
66  }
67 
68  if (!file_exists($this->getPath())) {
69  throw new ErrorException(sprintf('Could not find directory: %s', $this->getPath()));
70  }
71 
72  return true;
73  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
catch(Exception $e) $message
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ Here is the call graph for this function:

◆ getPath()

ilAssQuestionProcessLockFileStorage::getPath ( )

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

References $subPath.

Referenced by create().

51  {
52  return parent::getPath() . '/' . $this->subPath;
53  }
+ 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

protected

Returns
string directory name

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

46  {
47  return 'question';
48  }

◆ getPathPrefix()

ilAssQuestionProcessLockFileStorage::getPathPrefix ( )
protected

Get path prefix.

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

protected

Returns
string path prefix e.g files

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

32  {
33  return 'ilAssQuestionProcessLocks';
34  }

◆ initSubPath()

ilAssQuestionProcessLockFileStorage::initSubPath (   $userId)
private

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

References $i, ilFileSystemStorage\$path, array, and string.

Referenced by __construct().

76  {
77  $userId = (string) $userId;
78 
79  $path = array();
80 
81  for ($i = 0, $max = strlen($userId); $i < $max; $i++) {
82  $path[] = substr($userId, $i, 1);
83  }
84 
85  $this->subPath = implode('/', $path);
86  }
Add rich text string
Create styles array
The data for the language used.
$i
Definition: disco.tpl.php:19
+ Here is the caller graph for this function:

Field Documentation

◆ $subPath

ilAssQuestionProcessLockFileStorage::$subPath
private

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

Referenced by getPath().


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