PHPackages                             24hoursmedia/tesla-client-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. 24hoursmedia/tesla-client-bundle

AbandonedArchivedSymfony-bundle[API Development](/categories/api)

24hoursmedia/tesla-client-bundle
================================

client bundle

v1.0.0(12y ago)051MITPHP

Since Jun 20Pushed 12y agoCompare

[ Source](https://github.com/24HOURSMEDIA/TeslaClientBundle)[ Packagist](https://packagist.org/packages/24hoursmedia/tesla-client-bundle)[ Docs](http://www.24hoursmedia.com/tesla)[ RSS](/packages/24hoursmedia-tesla-client-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

TeslaClientBundle for Symfony 2
===============================

[](#teslaclientbundle-for-symfony-2)

---

Symfony bundle that provides:

- http client
- caching for http client
- proxy

Requests to a client are done through a subclass of SF's Request instances.

installation
------------

[](#installation)

Via composer:

(1) add following lines to composer.json:

```
"require": {
	(...)
	"24hoursmedia/tesla-client-bundle": "master-dev"
	(...)
}

```

(2) run composer update

```
php composer.phar update

```

(3) add bundle to AppKernel.php

```
$bundles = array(
	(....)
	new Tesla\Bundle\ClientBundle\TeslaClientBundle()
);

```

history
-------

[](#history)

20131125 added possibility to directly inject additional curl options into client and proxy service

examples
--------

[](#examples)

### http client

[](#http-client)

create client from a factory and do a request:

```
use Tesla\Bundle\ClientBundle\Client\HttpClientFactory;
use Tesla\Bundle\ClientBundle\Client\HttpClientInterface;
use Tesla\Bundle\ClientBundle\Client\TeslaRequest;
use Tesla\Bundle\ClientBundle\Client\TeslaResponse;

/* @var $factory HttpClientFactory */
$factory = $client->getContainer()->get('tesla_client.http_client_factory');
/* @var $client HttpClientInterface */
$http = $factory->get($baseUrl);

$request = $http->createRequest('http://www.example.com');
// (add headers and other request stuff here) //
$response = $http->execute($request);
$format = $response->getFormat(); // (json etc)
$content = $response->getContent();
$status = $response->getStatusCode();

```

### create http client in services.yml

[](#create-http-client-in-servicesyml)

configure an http client as a service which can be obtained through the container:

```
acme.http_client:
    class: %tesla_client.http_client.class%
    factory_service: tesla_client.http_client_factory
    factory_method: get
    arguments:
        - http://www.example.com

```

### create http proxy as a service in services.yml

[](#create-http-proxy-as-a-service-in-servicesyml)

create a proxy service that proxies requests from  &amp;  to :

```
acme.http_proxy_example:
    class: %tesla_client.http_proxy.class%
    factory_service: tesla_client.httpproxy_factory
    factory_method: get
    arguments:
        - http://www.example.com
    calls:
        - [addTranslationUrl, ["http://foo"]]
        - [addTranslationUrl, ["http://bar/sub"]]

```

### use a proxy

[](#use-a-proxy)

example of using a proxy defined as a service:

```
use Tesla\Bundle\ClientBundle\Proxy\HttpProxy;

/* @var $proxy HttpProxy */
$proxy = $client->getContainer()->get('tesla_client.http_proxy_example');

// foo host gets proxied to example.com
$responseContent = $proxy->execute($proxy->createRequest('http://foo'))->getContent();
$this->assertContains('example', $responseContent);
// foo bar/sub gets proxied to example.com
$responseContent = $proxy->execute($proxy->createRequest('http://bar/sub'))->getContent();

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4707d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bff0ffa7c1cac050de6fd11c9ffb0bd942fec23829c1093903d8cfaa889bde3c?d=identicon)[24HOURSMEDIA](/maintainers/24HOURSMEDIA)

---

Top Contributors

[![24HOURSMEDIA](https://avatars.githubusercontent.com/u/4735950?v=4)](https://github.com/24HOURSMEDIA "24HOURSMEDIA (54 commits)")

### Embed Badge

![Health badge](/badges/24hoursmedia-tesla-client-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/24hoursmedia-tesla-client-bundle/health.svg)](https://phpackages.com/packages/24hoursmedia-tesla-client-bundle)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M453](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
