/** * 恢复版本 * @param $signature * @param $filePath * @return mixed */ public function recover($signature, $filePath) { $share = new MiniShare(); $minFileMeta = $share->getMinFileMetaByPath($filePath); $filePath = $minFileMeta["ori_path"]; return MiniFile::getInstance()->recover($this->user["id"], $filePath, $signature); }
/** * 獲取文本文件信息! * @param $path * @param $signature * @return mixed */ public function txtContent($path, $signature) { $share = new MiniShare(); $fileBiz = new FileBiz(); $canRead = $fileBiz->privilege($path); if (!$canRead) { throw new MFileopsException(Yii::t('api', 'no permission'), MConst::HTTP_CODE_409); } $minFileMeta = $share->getMinFileMetaByPath($path); $file = array(); $content = MiniFile::getInstance()->getTxtContent($minFileMeta['ori_path'], $signature); $file['content'] = $content; $file['type'] = $minFileMeta['mime_type']; return $file; }