Skip to content
This repository was archived by the owner on Aug 13, 2023. It is now read-only.

Commit 7feea8e

Browse files
committed
add extension
1 parent 6221972 commit 7feea8e

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/CacheHelper/FileHelper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
class FileHelper extends Helper
66
{
77

8+
protected $extension = 'deimos-file';
9+
810
/**
911
* @inheritdoc
1012
*/

src/CacheHelper/Helper.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
abstract class Helper
66
{
77

8+
protected $extension;
9+
810
/**
911
* @var string
1012
*/
@@ -43,7 +45,7 @@ abstract protected function compare($original, $cache);
4345
*/
4446
public function getCachePath($originalData)
4547
{
46-
$basename = crc32($originalData) . '.deimos';
48+
$basename = crc32($originalData) . '.' . ($this->extension ?? 'deimos');
4749
$hash = $this->hash($originalData);
4850
$directories = str_split($hash, 2);
4951

src/CacheHelper/SliceHelper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
class SliceHelper extends Helper
66
{
77

8+
protected $extension = 'deimos-slice';
9+
810
/**
911
* @inheritdoc
1012
*/

0 commit comments

Comments
 (0)