2017 © Pedro Peláez
 

library resource-core

abstraction over resource that can read content of itself

image

devhelp/resource-core

abstraction over resource that can read content of itself

  • Saturday, April 4, 2015
  • by devhelp
  • Repository
  • 4 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Installation

please check composer website for more information., (*1)

$ composer require 'devhelp/resource-core'

Purpose

Provides abstraction over resource that can read content of itself, (*2)

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., (*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[]

Credits

Brought to you by : Devhelp.pl (http://devhelp.pl), (*5)

The Versions

04/04 2015

dev-master

9999999-dev

abstraction over resource that can read content of itself

  Sources   Download

The Requires

  • php >=5.3

 

The Development Requires