定制 ddruganov/php-transactional-filesystem 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

ddruganov/php-transactional-filesystem

Composer 安装命令:

composer require ddruganov/php-transactional-filesystem

包简介

Perform transactional file operations just like you would with a database

README 文档

README

Virtual file system that applies changes to the real file system on commit

Installation

composer require ddruganov/php-transactional-filesystem

TODO:

  • check permissions when creating files and folder in virtual filesystem
  • record mode that files and folders are to be created with

How-to

$folder = '/opt/your-folder';
$file = "$folder/test.txt";

// work with a transaction
$transactionalFileSystem = new TransactionalFileSystem();
$transactionalFileSystem->createFolder($folder);
$transactionalFileSystem->writeFile($file, 'some string content');
$transactionalFileSystem->commit();

// check that files are actually created
$realFileSystem = new RealFileSystem();
$realFileSystem->getFolderStatus($folder); // will be FileSystemUnitStatus::EXISTS
$realFileSystem->getFileStatus($file); // will be FileSystemUnitStatus::EXISTS

// delete the file
$transactionalFileSystem = new TransactionalFileSystem();
$transactionalFileSystem->deleteFile($file);
$transactionalFileSystem->commit();

// check that files are actually deleted
$realFileSystem = new RealFileSystem();
$realFileSystem->getFolderStatus($folder); // will be FileSystemUnitStatus::EXISTS
$realFileSystem->getFileStatus($file); // will be FileSystemUnitStatus::NOT_FOUND

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2022-05-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固