etel/sqlite-file-storage 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

etel/sqlite-file-storage

Composer 安装命令:

composer require etel/sqlite-file-storage

包简介

File storage backed by a single SQLite database with streaming, compression and encryption support.

README 文档

README

CI Status codecov Latest Stable Version License PHP Version Require

Etel SQLite file storage

File storage backed by a single SQLite database, with S3-like semantics: one database file is one storage node (bucket), objects are identified by flat path-like keys. Content is processed strictly in chunks (never fully in memory), with optional streaming compression (zlib family, brotli) and authenticated streaming encryption (libsodium secretstream, XChaCha20-Poly1305). Identical content is deduplicated via refcounting.

Quick start

use Etel\SqliteFileStorage\{ArrayKeyProvider, Compression, Encryption, PutOptions, StorageFactory, StorageOptions};

$storage = new StorageFactory()->open('/var/data/bucket-main.db', new StorageOptions(
    defaultCompression: Compression::Zlib,
    defaultEncryption: Encryption::XChaCha20Poly1305,
    keyProvider: new ArrayKeyProvider(['key-2026' => $rawKey32bytes], 'key-2026')
));

$info = $storage->putObject('invoices/2026/0001.pdf', fopen('/tmp/upload.pdf', 'rb'));

$object = $storage->getObject('invoices/2026/0001.pdf');
$stream = $object->getContentStream();   // decrypted + decompressed, lazy, chunked

foreach ($storage->listObjects(prefix: 'invoices/2026/') as $item) {
    echo $item->key, ' ', $item->size, "\n";
}

Requirements

PHP >= 8.4 with ext-sqlite3, ext-zlib. Optional: ext-sodium (encryption), ext-brotli (brotli compression), ext-fileinfo (MIME detection).

Development

Docker is the reference environment: PHP 8.4 (the minimum supported version) with all optional extensions, including ext-brotli, so the full test matrix runs there.

docker compose build
docker compose run --rm php composer install
docker compose run --rm php vendor/bin/phpunit
docker compose run --rm php vendor/bin/phpunit --coverage-html coverage
docker compose run --rm php vendor/bin/phpstan analyse --memory-limit=1G
docker compose run --rm php vendor/bin/php-cs-fixer fix

Tests that need an extension missing on the host (e.g. brotli) are skipped automatically.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固