devhelp/resource-core
Composer 安装命令:
composer require devhelp/resource-core
包简介
abstraction over resource that can read content of itself
README 文档
README
please check composer website for more information.
$ composer require 'devhelp/resource-core'
Purpose
Provides abstraction over resource that can read content of itself
Usage
Usage of FileResource
$resource = new FileResource($filePath); $resource->getContent(); // returns content of file at $filePath
Usage of ResourcesChain
$chain = new ResourcesChain([ new FileResource($filePath), new JsonResource() ]); $chain->getContent(); // returns json decoded as array from file at $filePath
Collecting Resources
ResourceCollector together with ResourceIterator implementations are designed to return collection of Resource instances.
There are no implementations of ResourceIterator but they might exist for example for:
- files
- arrays
- web pages
- etc...
$myIterator = new MyResourceIterator(); $collector = new ResourceCollector($myIterator); $resources = $collector->collect(); //returns Resource[]
Credits
Brought to you by : Devhelp.pl (http://devhelp.pl)
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2015-04-04