PHPackages                             cloudfoundry-community/php-cf-service-broker - 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. cloudfoundry-community/php-cf-service-broker

ActiveLibrary[API Development](/categories/api)

cloudfoundry-community/php-cf-service-broker
============================================

A Cloud Foundry service broker made for Cloud Foundry

1.5.0(11y ago)4263[2 issues](https://github.com/cloudfoundry-community/php-cf-service-broker/issues)MITPHPPHP &gt;=5.5

Since May 11Pushed 7y ago38 watchersCompare

[ Source](https://github.com/cloudfoundry-community/php-cf-service-broker)[ Packagist](https://packagist.org/packages/cloudfoundry-community/php-cf-service-broker)[ RSS](/packages/cloudfoundry-community-php-cf-service-broker/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (12)Versions (4)Used By (0)

Cloud Foundry PHP Service Broker
================================

[](#cloud-foundry-php-service-broker)

[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE) [![Stories in Ready](https://camo.githubusercontent.com/10f41e33081a11bb05ecb5836ff7bc62d6ab8a87dda45c37a8b916e3688de638/68747470733a2f2f62616467652e776166666c652e696f2f636c6f7564666f756e6472792d636f6d6d756e6974792f7068702d63662d736572766963652d62726f6b65722e706e673f6c6162656c3d7265616479267469746c653d5265616479)](https://waffle.io/cloudfoundry-community/php-cf-service-broker) [![Build Status](https://camo.githubusercontent.com/3304c530f9dd577e6bc8f9a54507aaa7f717efd7976f2e16afc91ea3b738a16e/68747470733a2f2f7472617669732d63692e6f72672f636c6f7564666f756e6472792d636f6d6d756e6974792f7068702d63662d736572766963652d62726f6b65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/cloudfoundry-community/php-cf-service-broker) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/c35f4dab8ccb0fbf05400bd3dd249598ba177ca3617756a0299be255128f108f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636c6f7564666f756e6472792d636f6d6d756e6974792f7068702d63662d736572766963652d62726f6b65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/cloudfoundry-community/php-cf-service-broker/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/b2d2bf8d8950435e3e605d2e835d630ed7352279952b0d741b2244fd003c58ab/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636c6f7564666f756e6472792d636f6d6d756e6974792f7068702d63662d736572766963652d62726f6b65722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/cloudfoundry-community/php-cf-service-broker/?branch=master)

Php project for creating service brokers compatible with Open Service Broker API.

This project for example can be used to quickly implement new service brokers for Kubernetes or [Cloud Foundry](http://docs.cloudfoundry.org/services/overview.html).

Compatibility
-------------

[](#compatibility)

- [Open Service Broker API](https://github.com/openservicebrokerapi/servicebroker): 2.14
    - Asynchronous operations are not supported
- Kubernetes
    - v1.10
    - Kubernetes Service Catalog: v0.1.35
- Cloud Foundry
    - [cf-release](https://github.com/cloudfoundry/cf-release): 192 or later
    - [Pivotal CF](http://www.pivotal.io/platform-as-a-service/pivotal-cf): Expected 1.4

Quick start
-----------

[](#quick-start)

1. Clone this repo or use `composer create-project cloudfoundry-community/php-cf-service-broker`
2. Add your service inside [/config/services.json](https://github.com/cloudfoundry-community/php-cf-service-broker/blob/master/config/services.json) (remove example first)
3. Create a user by doing this in command line: `php bin/addUser.php [user_name] [password]`
4. (optional) Change configuration inside [/config/config.yml](https://github.com/cloudfoundry-community/php-cf-service-broker/blob/master/config/config.yml)
5. Create the logic inside [/src/Sphring/MicroWebFramework/ServiceBroker/DefaultServiceBroker.php](https://github.com/cloudfoundry-community/php-cf-service-broker/blob/master/src/Sphring/MicroWebFramework/ServiceBroker/DefaultServiceBroker.php)(I suggest to see the [doc](http://docs.cloudfoundry.org/services/api.html), no need to follow rest url project handle it)
6. Register your new service broker

    - in Kubernetes

        by following
    - in Cloud Foundry

        by following
7. Service broker is ready and follow rest url given by the [doc](http://docs.cloudfoundry.org/services/api.html)

Configuration
-------------

[](#configuration)

### Common

[](#common)

See [/config/config.yml](https://github.com/cloudfoundry-community/php-cf-service-broker/blob/master/config/config.yml).

### Database

[](#database)

By default this project use an sqlite database, change to another database by modifying this file: [/config/doctrine-driver.yml](https://github.com/cloudfoundry-community/php-cf-service-broker/blob/master/config/doctrine-driver.yml)

Adjust logging
--------------

[](#adjust-logging)

See `app/app.php`.

By default this application logs only warnings to stdout.

To enable logging to file you can uncomment `$logger->pushHandler` line.

To adjust log level you can change `\Monolog\Logger::*` value. For example, to set logging level to debug you can set the value to `\Monolog\Logger::DEBUG`. See [Monolog logger source code](https://github.com/Seldaek/monolog/blob/1.23.0/src/Monolog/Logger.php) for details.

Add more service broker
-----------------------

[](#add-more-service-broker)

You can add an infinity of service broker to do this follow these steps:

- Add another service inside [/config/services.json](https://github.com/cloudfoundry-community/php-cf-service-broker/blob/master/config/services.json)
- Create a new service broker class and extend [Sphring\\MicroWebFramework\\ServiceBroker\\AbstractServiceBroker](https://github.com/cloudfoundry-community/php-cf-service-broker/blob/master/src/Sphring/MicroWebFramework/ServiceBroker/AbstractServiceBroker.php)
- Register your new broker by adding entry in [/sphring/service-broker.yml](https://github.com/cloudfoundry-community/php-cf-service-broker/blob/master/config/services.json) like this: ```
    service.broker.[your broker name]:
         class: Sphring\MicroWebFramework\ServiceBroker\[your broker class name]
         extend: service.broker.abstract
    ```
- Add in this same file a new entry in `service.broker.list`, example: ```
    service.broker.list:
      class: \ArrayObject
      constructor:
          1:
            ref:
              default: service.broker.default
              [service name from services.json]: service.broker.[your broker name]
    ```
- Unvalidate cache by doing in command line `touch sphring/main.yml` or set cache to `false` inside [/config/config.yml](https://github.com/cloudfoundry-community/php-cf-service-broker/blob/master/config/config.yml)
- Your new service broker is available

Run as a Cloud Foundry app
--------------------------

[](#run-as-a-cloud-foundry-app)

1. Create a database service which his name follow this regex: `/.*(postgres|pgsql|db|database|my|maria|oracle|oci).*/i` (**note**: add in `composer.json` other pdo driver than pdo\_mysql)
2. Push the app (run `cf push`)
3. Bind your database service on your app
4. Restage your app
5. Service broker app is ready try go to `http://your_url/v2/catalog` you should see your catalog

Development environment
-----------------------

[](#development-environment)

### Router for PHP embedded web server

[](#router-for-php-embedded-web-server)

```
cd app
php -S 0.0.0.0:8888 ../config/routes/router.php
```

### Tests

[](#tests)

Tests use [PHPUnit](https://phpunit.de/). Run with your command line: `vendor/bin/phpunit --bootstrap tests\bootstrap.php --no-configuration tests`

#### Add a service to test

[](#add-a-service-to-test)

1. Update [services.json](https://github.com/cloudfoundry-community/php-cf-service-broker/blob/master/tests/Sphring/MicroWebFramework/Resources/Sphring/services.json) inside tests configuration directory.
2. Update [service-broker.yml](https://github.com/cloudfoundry-community/php-cf-service-broker/blob/master/tests/Sphring/MicroWebFramework/Resources/Sphring/service-broker.yml) inside tests configuration directory.
3. Run `vendor/bin/phpunit --bootstrap tests\bootstrap.php --no-configuration tests`

See also
--------

[](#see-also)

Open Service Broker API:

-

K8s Service Catalog:

- [Service Catalog documentation in the official K8s documentation](https://v1-10.docs.kubernetes.io/docs/concepts/extend-kubernetes/service-catalog/)
- [Service Catalog documentation at the official site of K8s Service Catalog](https://svc-cat.io/docs/)
- [Service Catalog datastructures and interfaces in its source code](https://github.com/kubernetes-incubator/service-catalog/blob/v0.1.35/pkg/apis/servicecatalog/v1beta1/types.go)
- [Compatibility of Service Catalog with Open Service Broker API](https://github.com/openservicebrokerapi/servicebroker/blob/master/compatibility.md)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 60% 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

Every ~1 days

Total

3

Last Release

4024d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b9ba88d407b0fba1107b4644f27fbabe80a816da59208e2907f7d3902c8f862d?d=identicon)[ArthurHlt](/maintainers/ArthurHlt)

---

Top Contributors

[![dshiryaev-plesk](https://avatars.githubusercontent.com/u/19424413?v=4)](https://github.com/dshiryaev-plesk "dshiryaev-plesk (21 commits)")[![ArthurHlt](https://avatars.githubusercontent.com/u/5410858?v=4)](https://github.com/ArthurHlt "ArthurHlt (14 commits)")

---

Tags

cloudCloud FoundryCfService Broker

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cloudfoundry-community-php-cf-service-broker/health.svg)

```
[![Health](https://phpackages.com/badges/cloudfoundry-community-php-cf-service-broker/health.svg)](https://phpackages.com/packages/cloudfoundry-community-php-cf-service-broker)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[google/cloud

Google Cloud Client Library

1.2k16.2M53](/packages/google-cloud)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[alibabacloud/client

Alibaba Cloud Client for PHP - Use Alibaba Cloud in your PHP project

2223.5M367](/packages/alibabacloud-client)[partitech/php-mistral

Connect to Mistral | Anthropic | Xai | Hugging Face | LamaC++ | Vllm | Ollama

2624.1k1](/packages/partitech-php-mistral)[forme/framework

An MVC framework for WordPress.

175.0k3](/packages/forme-framework)

PHPackages © 2026

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