mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-10 15:08:28 +03:00
Put a garbage collector in demo plugin
This commit is contained in:
parent
5ba3d2edcd
commit
e4e86d0347
2 changed files with 10 additions and 5 deletions
|
|
@ -11,9 +11,14 @@ class DemoStorage extends \RainLoop\Providers\Storage\FileStorage
|
|||
return parent::generateFileName($mAccount, $iStorageType, $sKey, $bMkDir, $bForDeleteAction);
|
||||
}
|
||||
|
||||
return $this->sDataPath
|
||||
.'/demo'
|
||||
.'/'.static::fixName(\RainLoop\Utils::GetConnectionToken())
|
||||
.'/'.($sKey ? static::fixName($sKey) : '');
|
||||
$sDataPath = "{$this->sDataPath}/demo";
|
||||
if (\is_dir($sDataPath) && 0 === \random_int(0, 100)) {
|
||||
\MailSo\Base\Utils::RecRmDir("{$this->sDataPath}/demo");
|
||||
}
|
||||
|
||||
$sDataPath .= '/' . static::fixName(\RainLoop\Utils::GetConnectionToken());
|
||||
\is_dir($sDataPath) || \mkdir($sDataPath, 0700, true);
|
||||
|
||||
return $sDataPath . '/' . ($sKey ? static::fixName($sKey) : '');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class FileStorage implements \RainLoop\Providers\Storage\IStorage
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $sDataPath;
|
||||
protected $sDataPath;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue