basilicom/flysystem-pdo 问题修复 & 功能扩展

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

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

basilicom/flysystem-pdo

最新稳定版本:v1.1.1

Composer 安装命令:

composer require basilicom/flysystem-pdo

包简介

Flysystem v3 adapter for PDO

README 文档

README

Psalm coverage Psalm level

A (very simple) Flysystem v3 adapter for PDO/MySQL`. Based on the https://github.com/thephpleague/flysystem-memory implementation.

Installation

$ composer require basilicom/flysystem-pdo`

Prepare a (MySQL) table:

create table files (
	bucket varchar(32) not null default 'default',
	path varchar(255) not null,
	isFile tinyint not null default 1,
	mimeType varchar(64) not null default '',
	contents longblob not null,
	size int unsigned not null default 0,
	checksum varchar(256) not null,
	lastModified datetime,
	visibility varchar(64),
	PRIMARY KEY(bucket, path)
);

Usage

use League\Flysystem\Filesystem;
use Basilicom\Flysystem\Pdo\PdoAdapter;

$pdo = new PDO('mysql:host=mysql;dbname=mydb', 'myuser', 'mypass');
$adapter = new \Basilicom\Flysystem\Pdo\PdoAdapter($pdo);

$flysystem = new Filesystem($adapter);

Example

$path = 'my/path/to/file.txt';
$contents = 'Lorem Ipsum';
$flysystem->write($path, $contents);

Tests

This library uses the FilesystemAdapterTestCase provided by league/flysystem-adapter-test-utilities, so it performs integration tests that need a real PDO connection.

To run tests, provide a MySQL database with the files table schema, duplicate the phpunit.xml.dist file into phpunit.xml and fill all the environment variables, then run:

$ composer test

This will run PHP-CS-Fixer,[Psalm][3] and [PHPUnit][4], but you can run them individually like this:

$ composer phpcsfixer
$ composer psalm
$ composer phpunit

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2023-02-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固