snappymail/plugins/demo-account/storage.php

20 lines
632 B
PHP
Raw Normal View History

<?php
class DemoStorage extends \RainLoop\Providers\Storage\FileStorage
{
/**
2021-11-09 00:40:21 +08:00
* @param \RainLoop\Model\Account|string|null $mAccount
*/
2021-11-09 00:40:21 +08:00
protected function generateFileName($mAccount, int $iStorageType, string $sKey, bool $bMkDir = false, bool $bForDeleteAction = false) : string
{
2021-11-09 00:40:21 +08:00
if (\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY === $iStorageType) {
return parent::generateFileName($mAccount, $iStorageType, $sKey, $bMkDir, $bForDeleteAction);
}
2021-11-09 00:40:21 +08:00
return $this->sDataPath
.'/demo'
.'/'.static::fixName(\RainLoop\Utils::GetConnectionToken())
.'/'.($sKey ? static::fixName($sKey) : '');
}
}