dev-master
9999999-devabstraction over resource that can read content of itself
The Requires
- php >=5.3
The Development Requires
Wallogit.com
2017 © Pedro Peláez
abstraction over resource that can read content of itself
please check composer website for more information., (*1)
$ composer require 'devhelp/resource-core'
Provides abstraction over resource that can read content of itself, (*2)
$resource = new FileResource($filePath); $resource->getContent(); // returns content of file at $filePath
$chain = new ResourcesChain([
new FileResource($filePath),
new JsonResource()
]);
$chain->getContent(); // returns json decoded as array from file at $filePath
ResourceCollector together with ResourceIterator implementations are designed to return collection of Resource instances., (*3)
There are no implementations of ResourceIterator but they might exist for example for: - files - arrays - web pages - etc..., (*4)
$myIterator = new MyResourceIterator(); $collector = new ResourceCollector($myIterator); $resources = $collector->collect(); //returns Resource[]
Brought to you by : Devhelp.pl (http://devhelp.pl), (*5)
abstraction over resource that can read content of itself