1 Star 6 Fork 3

lyxxxh/filestore

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
FileStoreAbstract.php 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
lyxxxh 提交于 2020-04-02 21:15 +08:00 . add
<?php
namespace Xxh\FileStore\Service;
abstract class FileStoreAbstract
{
protected $config;
protected $client = null;
//初始化配置
abstract function __construct();
/*
*文件是否存在
* @return bool
*/
abstract function fileExists($path);
/*
* 根据文件的md5保存
*@return string 保存文件的路径
*/
abstract function store($file);
/*
* 域名 + 文件保存路径
* @return string 返回文件的完整路径
*/
abstract function url($path);
/*
* @param $filename 文件名
* @param $str 要写入的字符串
* @return 路径
*/
abstract function put($filename,$str);
//增加云存储文件路径
protected function addPrefix($filename)
{
return $this->config['save_path'].$filename;
}
//链接对象
protected function getClient()
{
return $this->client;
}
// 根据文件的md5生成名称
protected function hashFileName($file)
{
return md5_file($file->getPathname()).'.'.$file->getExtension();
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lyxxxh/filestore.git
git@gitee.com:lyxxxh/filestore.git
lyxxxh
filestore
filestore
master

搜索帮助