Git Product home page Git Product logo

guzzlebundle's Introduction

GuzzleBundle

Introduction

GuzzleBundle is a Symfony2 bundle for integrating the Guzzle PHP library in your project.

It’s not quite finished.

Installation

Install Guzzle:

git submodule add git://github.com/guzzle/guzzle.git vendor/guzzle

Install GuzzleBundle:

git submodule add git://github.com/ddeboer/GuzzleBundle vendor/bundles/Ddeboer/GuzzleBundle

Autoloader

Add Guzzle and Ddeboer namespace to your autoloader:

// app/autoload.php
$loader->registerNamespaces(array(
	// ...
	'Guzzle'           => __DIR__.'/../vendor/guzzle/src',
	'Ddeboer'          => __DIR__.'/../vendor/bundles',
	// ...
));

Application kernel

Add GuzzleBundle to your application kernel:

// app/AppKernel.php
public function registerBundles()
{
	// ...
	new Ddeboer\GuzzleBundle\DdeboerGuzzleBundle(),
	// ...
}

Configure the Guzzle service builder

// app/config/config.yml
ddeboer_guzzle: 
  service_builder:
    configuration_file: "%kernel.root_dir%/config/webservices.xml"
    cache: 
      adapter: doctrine
      driver: apc

And add a Guzzle services configuration file. See the Guzzle documentation.

// app/config/webservices.xml
<?xml version="1.0" ?>
<guzzle>
    <clients>
        <!-- Abstract service to store AWS account credentials -->
        <client name="abstract.aws">
            <param name="access_key" value="12345" />
            <param name="secret_key" value="abcd" />
        </client>
        <!-- Amazon S3 client that extends the abstract client -->
        <client name="s3" classs="Guzzle.Aws.S3.S3Client" extends="abstract.aws">
            <param name="devpay_product_token" value="XYZ" />
            <param name="devpay_user_token" value="123" />
        </client>
        <client name="simple_db" class="Guzzle.Aws.SimpleDb.SimpleDbClient" extends="abstract.aws" />
        <client name="sqs" class="Guzzle.Aws.Sqs.SqsClient" extends="abstract.aws" />
        <!-- Unfuddle client -->
        <client name="unfuddle" class="Guzzle.Unfuddle.UnfuddleClient">
            <param name="username" value="test-user" />
            <param name="password" value="my-password" />
            <param name="subdomain" value="my-subdomain" />
        </client>
    </clients>
</guzzle>

guzzlebundle's People

Contributors

ddeboer avatar ftassi avatar gimler avatar patrick-mcdougle avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

predakanga wchoy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.