1 Star 6 Fork 3

lyxxxh/filestore

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
FileStoreAbstract.php 1.10 KB
Copy Edit Raw Blame History
lyxxxh authored 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

Search