定制 innmind/filesystem 二次开发

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

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

innmind/filesystem

Composer 安装命令:

composer require innmind/filesystem

包简介

Filesystem abstraction layer

关键字:

README 文档

README

Build Status codecov Type Coverage

Filesystem abstraction layer, the goal is to provide a model where you design how you put your files into directories without worrying where it will be persisted.

Documentation

Installation

composer install innmind/filesystem

Usage

The whole model is structured around files, directories, contents and adapters. File, Directory and Content are immutable objects.

Example:

use Innmind\Filesystem\{
    File,
    File\Content,
    Directory,
    Adapter,
};
use Innmind\Url\Path;

$directory = Directory::named('uploads')->add(
    File::named(
        $_FILES['my_upload']['name'],
        Content::ofString(\file_get_contents($_FILES['my_upload']['tmp_name'])),
    ),
);
$adapter = Adapter::mount(Path::of('/var/www/web/'))->unwrap();
$_ = $adapter
    ->add($directory)
    ->unwrap();

This example show you how you can create a new directory uploads in the folder /var/www/web/ of your filesystem and create the uploaded file into it.

Note

For performance reasons the filesystem adapter only persist to disk the files that have changed (achievable via the immutable nature of file objects).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-04-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固