ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilTestProcessLockFileStorage.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Services/FileSystem/classes/class.ilFileSystemStorage.php';
5
13{
14 public function __construct(int $contextId)
15 {
17 }
18
27 protected function getPathPrefix()
28 {
29 return 'ilTestProcessLocks';
30 }
31
41 protected function getPathPostfix()
42 {
43 return 'context';
44 }
45
46 public function create()
47 {
48 set_error_handler(function ($severity, $message, $file, $line) {
49 throw new ErrorException($message, $severity, 0, $file, $line);
50 });
51
52 try {
54 restore_error_handler();
55 } catch (Exception $e) {
56 restore_error_handler();
57 }
58
59 if (!file_exists($this->getPath())) {
60 throw new ErrorException(sprintf('Could not find directory: %s', $this->getPath()));
61 }
62
63 return true;
64 }
65}
An exception for terminatinating execution or to throw for unit testing.
static makeDirParents($a_dir)
Create a new directory and all parent directories.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$message
Definition: xapiexit.php:14