diff options
Diffstat (limited to 'lib/Kolab/DAV/Locks/File.php')
-rw-r--r-- | lib/Kolab/DAV/Locks/File.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/Kolab/DAV/Locks/File.php b/lib/Kolab/DAV/Locks/File.php index 0d8d17b..dddd936 100644 --- a/lib/Kolab/DAV/Locks/File.php +++ b/lib/Kolab/DAV/Locks/File.php @@ -33,13 +33,20 @@ use Sabre\DAV\Locks\Backend\AbstractBackend; class File extends AbstractBackend { /** - * The storage file prefix + * The storage directory prefix * * @var string */ private $basePath; /** + * The directory to storage the file in + * + * @var string + */ + private $dataDir; + + /** * Constructor * * @param string $basePath base path to store lock files @@ -174,7 +181,14 @@ class File extends AbstractBackend */ protected function getLocksFile() { - return $this->basePath . '_' . str_replace('@', '_', HTTPBasic::$current_user); + if (!$this->dataDir) { + $this->dataDir = $this->basePath . '/' . str_replace('@', '_', HTTPBasic::$current_user); + + if (!is_dir($this->dataDir)) + mkdir($this->dataDir); + } + + return $this->dataDir . '/locks'; } /** |