2017 © Pedro Peláez
 

library php-common-helper

image

bronto/php-common-helper

  • Monday, June 20, 2016
  • by philcali
  • Repository
  • 8 Watchers
  • 0 Stars
  • 22,662 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 14 % Grown

The README.md

Bronto PHP Common Library

This package is archived and no longer maintained., (*1)

This package contains a number of common scripts and utilities used throughout the PHP packages provided by Bronto., (*2)

Provided is a set of functional utilties and a chainable object that wraps an associative array., (*3)

Transfer

The library ships with a pretty nice cURL transfer impl, (*4)

<?php

$json = new \Bronto\Serialize\Json\Standard();
$curls = new \Bronto\Transfer\Curl\Adapter();
$request = $curls->createRequest('GET', 'http://some-resource.com');
$response = $request->respond();

$data = $json->decode($response->body());

$multi = new \Bronto\Transfer\Curl\Multi();
// Below are the defaults
$multi
    ->setMaxConnections(10)
    ->setPipeLining(true)
    ->setExecuteEagerly(true);
foreach ($data as $customer) {
    $request = $curls->createRequest('POST', 'http://some-resource.com')
        ->header('Authorization', 'Bearer: abc123')
        ->header('Content-Type', $json->getMimeType())
        ->body($json->encode($customer))
        ->on('complete', function($response) {
            var_dump($response);
        });
    $multi->add($request);
}
$multi->complete();

The Versions

20/06 2016

dev-master

9999999-dev https://github.com/bronto/php-common-helper

  Sources   Download

Apache-2.0

The Development Requires

php common bronto

20/06 2016

1.0.1

1.0.1.0 https://github.com/bronto/php-common-helper

  Sources   Download

Apache-2.0

The Development Requires

php common bronto

15/08 2015

1.0.0

1.0.0.0 http://dev.bronto.com

  Sources   Download

Apache-2.0

The Development Requires

php common bronto