定制 dspacelabs/filesystem 二次开发

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

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

dspacelabs/filesystem

Composer 安装命令:

composer require dspacelabs/filesystem

包简介

Filesystem abstract for PHP

关键字:

README 文档

README

Filesystem is generic PHP wrapper around the filesystem that allows you to setup your application to store files almost anywhere. The problem this solves is that during development you want to store things on disk, next you deploy your application to Heroku and now you are having to deal with messy code that is checking to see if you are on localhost or on a Heroku instance.

Features

  • Store assets on:
    • Local Disk
    • S3
    • More coming soon
  • Mock Filesystem for testing
  • Support for logging using psr/log package

Installation

Stable: Packagist

Development: Packagist Pre Release

composer require "dspacelabs/filesystem:0.1@dev"

Configuration

Each adapter has it's own configuration, I've tried to document that in the adapter files. Use the source.

Usage

<?php

$adapter    = new \Dspacelabs\Component\Filesystem\Adapter\LocalAdapter('/tmp');
$filesystem = new \Dspacelabs\Component\Filesystem\Filesystem($adapter);

// Everything uses the `dspace` protocol, you can swap out different adapters
// but the protocol will always stay the same.
$handle = fopen('dspace://file.txt', 'w+');
fwrite($handle, 'testing');
fclose($handle);
$ cat /tmp/file.txt
testing

For more usage example, check out the tests directory.

Testing

Just run phpunit to run all the tests.

phpunit

Change Log

See CHANGELOG.md.

License

Packagist

See LICENSE.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-09