2017 © Pedro Peláez
 

library facade

A PHP5 library for accessing various services via a stream based request/response pattern

image

99designs/facade

A PHP5 library for accessing various services via a stream based request/response pattern

  • Wednesday, June 27, 2012
  • by lox
  • Repository
  • 44 Watchers
  • 5 Stars
  • 31,734 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Façade

Facade is an open-source library for memory-effecient consumption of stream-based protocols like HTTP., (*1)

Included is a streaming HTTP client and a streaming [AWS S3 client][2]. 99designs uses these to stream large designs from AWS to upstream clients without buffering the entire file in memory or on disk at any one time., (*2)

Examples

Streaming a file from disk to S3:, (*3)

<?php

$s3 = new Facade_S3(getenv('AWS_ACCESS_KEY_ID'), getenv('AWS_SECRET_ACCESS_KEY'));
$file = '/uploads/largeimage.jpg';

$response = $s3
    ->put("/llamas/largeimage.jpg")
    ->setStream(Facade_Stream::fromFile($file))
    ->setContentType('image/jpeg')
    ->setHeader('Content-MD5: '.base64_encode(md5_file($file, true)))
    ->send();

Streaming an S3 file to a client:, (*4)

<?php

$s3 = new Facade_S3(getenv('AWS_ACCESS_KEY_ID'), getenv('AWS_SECRET_ACCESS_KEY'));

$response = $s3
  ->get('/llamas/largeimage.jpg')
  ->send();

stream_copy_to_stream($response->getStream(), STDOUT);

The Versions

27/06 2012

dev-master

9999999-dev

A PHP5 library for accessing various services via a stream based request/response pattern

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

http s3 aws 99designs

12/06 2012

1.0.0

1.0.0.0

A PHP5 library for accessing various services via a stream based request/response pattern

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

http s3 aws 99designs