> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# blackfireio/php

This orb installs and configures Blackfire for PHP.
You need an account on https://blackfire.io to use this orb.

Blackfire is the Code Performance Management solution for developers
to find and fix performance bottlenecks in dev, test/staging and production.

It makes it possible to drill down to function/method call level to understand and fix performance bottlenecks.
Its wide variety of automation options makes it a breathe to add it to a development and testing workflow.


## Commands

### setup

Installs and configures Blackfire for PHP.
This includes the probe, the agent, the CLI and the player.

Note that this will also disable XDebug as it can conflict with Blackfire probe.

You won't have to consider the parameters if you already have defined the following environment variables
in your CirceCI project: BLACKFIRE_SERVER_ID, BLACKFIRE_SERVER_TOKEN, BLACKFIRE_CLIENT_ID, BLACKFIRE_CLIENT_TOKEN.

If you have set them with different names, you must pass them explicitly as parameters.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `server_id` | env_var_name | BLACKFIRE_SERVER_ID | Environment variable name in which your server ID is stored. |
| `server_token` | env_var_name | BLACKFIRE_SERVER_TOKEN | Environment variable name in which your server token is stored. |
| `client_id` | env_var_name | BLACKFIRE_CLIENT_ID | Environment variable name in which your client ID is stored. |
| `client_token` | env_var_name | BLACKFIRE_CLIENT_TOKEN | Environment variable name in which your client token is stored. |

### disable-xdebug

Disables XDebug, as Blackfire may conflict with it.

### install-player

Installs Blackfire player, to run your scenarios.

## Examples

### blackfire_php_default_env_vars

Easily install and configure Blackfire for PHP.

You must setup the following environment variables in your CircleCI project:
    - BLACKFIRE_SERVER_ID - You Blackfire server ID
    - BLACKFIRE_SERVER_TOKEN - You Blackfire server token
    - BLACKFIRE_CLIENT_ID - You Blackfire client ID
    - BLACKFIRE_CLIENT_TOKEN - You Blackfire client token


```yaml
version: 2.1
orbs:
  blackfire: blackfireio/php@x.y
jobs:
  blackfire-example:
    docker:
      - image: circleci/php:7.3-node
    steps:
      - checkout
      - blackfire/setup
```

### blackfire_php_custom_env_vars

Easily install and configure Blackfire for PHP.

You must setup the following environment variables in your CircleCI project:
    - MY_BF_SERVER_ID - You Blackfire server ID
    - MY_BF_SERVER_TOKEN - You Blackfire server token
    - MY_BF_CLIENT_ID - You Blackfire client ID
    - MY_BF_CLIENT_TOKEN - You Blackfire client token


```yaml
version: 2.1
orbs:
  blackfire: blackfireio/php@x.y
jobs:
  blackfire-example:
    docker:
      - image: circleci/php:7.3-node
    steps:
      - checkout
      - blackfire/setup:
          server_id: MY_BF_SERVER_ID
          server_token: MY_BF_SERVER_TOKEN
          client_id: MY_BF_CLIENT_ID
          client_token: MY_BF_CLIENT_TOKEN
```