承接 n11t/hash-file-service 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

n11t/hash-file-service

Composer 安装命令:

composer require n11t/hash-file-service

包简介

Service to persist files based on there hashed content

README 文档

README

pipeline status coverage report

HashFileService

Service to persist files based on there hashed content

Sample

Use the service to persist content or files.

Code

<?php

$calculator = new \N11t\HashFileService\HashCalculator\GenericHashCalculator('sha1');

$directory = sys_get_temp_dir() . '/hash-service';
$service = new \N11t\HashFileService\HashFileService($directory, $calculator);

$content = "Hello World\n";
echo $service->persistByContent($content);
echo PHP_EOL;

$file = sys_get_temp_dir() . '/test.txt';
echo $service->persistByFile($file);
echo PHP_EOL;

$handle = fopen($file, 'rb+');
echo $service->persistByResource($handle);
echo PHP_EOL;

Output

/tmp/hash-service/2e/a47907b71df53d55ff2d8e5d6c0da6e6a39c84
/tmp/hash-service/2e/a47907b71df53d55ff2d8e5d6c0da6e6a39c84
/tmp/hash-service/2e/a47907b71df53d55ff2d8e5d6c0da6e6a39c84

统计信息

  • 总下载量: 12
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固