Skip to content
Permalink
Browse files

OXDEV-1287 Fix file name length issue

  • Loading branch information...
iegupov committed Jul 8, 2019
1 parent 508a09d commit cec3e562ae339a8a24f29fb447971418fb256782
@@ -19,5 +19,5 @@ public function get(): array;
/**
* @param array $data
*/
public function save(array $data);
public function save(array $data): void;
}
@@ -73,9 +73,10 @@ public function get(): array
/**
* @param array $data
*/
public function save(array $data)
public function save(array $data): void
{
$lock = $this->lockFactory->createLock($this->filePath);
$lock = $this->lockFactory->createLock($this->getLockId());
if ($lock->acquire(true)) {
try {
file_put_contents(
@@ -107,7 +108,7 @@ private function getLocatedFilePath(): string
/**
* Creates file directory if it doesn't exist.
*/
private function createFileDirectory()
private function createFileDirectory(): void
{
if (!$this->filesystemService->exists(\dirname($this->filePath))) {
$this->filesystemService->mkdir(\dirname($this->filePath));
@@ -117,8 +118,16 @@ private function createFileDirectory()
/**
* Creates file.
*/
private function createFile()
private function createFile(): void
{
$this->filesystemService->touch($this->filePath);
}
/**
* @return string
*/
private function getLockId(): string
{
return md5($this->filePath);
}
}

0 comments on commit cec3e56

Please sign in to comment.
You can’t perform that action at this time.