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