--- breadcrumb: - What's new? - Version 3.2 summary-order: 7;98 keywords: - release - new features - "3.2" --- # What's new in 3.2 Version 3.2 adds cache drivers for multi-server deployments, database migrations, a metrics endpoint for queues, and closes several security holes of the debug tools. ## Cache drivers Two cache drivers are added. The Redis driver shares the cache between servers, and the fallback driver keeps the application working when a driver fails: ```php $cache = new FallbackCacheDriver([ new RedisCacheDriver($redis, 'my-project'), new FileCacheDriver('/var/cache'), new MemoryCacheDriver(), ]); ``` A factory builds the driver from an array of options, a JSON file or environment variables. See [Cache](../guides/cache.md). ## Database migrations The Hector ORM package runs database migrations from the command line: ```bash # Apply all pending migrations $ vendor/bin/berlioz hector:migrate # Roll back migrations $ vendor/bin/berlioz hector:migrate:down # Show the status of migrations (applied / pending) $ vendor/bin/berlioz hector:migrate:status ``` See [Database migrations](../guides/orm/hector.md#database-migrations). ## Queue metrics over HTTP The metrics of the `queue:size` command can be served over HTTP, so that a Prometheus server scrapes them directly. The endpoint is disabled by default: ```json { "berlioz": { "queues": { "metrics": { "enable": true, "path": "/metrics/queues", "ip": ["127.0.0.1", "10.0.0.0/8"] } } } } ``` See [HTTP endpoint](../guides/queues.md#http-endpoint). ## Debug tools - **Snapshot retention:** old debug snapshots are deleted automatically, according to a maximum age and a maximum number of files. The `berlioz:debug-clear` command deletes them on demand. See [Snapshot retention](../getting-started/debug.md#snapshot-retention). - **SQL queries:** the debug console highlights slow queries and detects duplicate queries. See [Debug console](../guides/orm/hector.md#debug-console). - **Cache:** the debug console clears the internal cache, OPcache and the cache directories. ## Other new features - **HTTP client:** the default adapter, `AutoAdapter`, uses cURL when the extension is installed and PHP streams otherwise. See [AutoAdapter](../components/http-client.md#autoadapter). ## Security changes These changes can require an action when you upgrade: - **Debug IP restriction:** the `X-Forwarded-For` header is no longer trusted by default. Behind a reverse proxy, declare its address in `berlioz.proxies.trusted`. See [Client IP resolution behind a proxy](../getting-started/debug.md#client-ip-resolution-behind-a-proxy). - **Debug console:** every page of the console is restricted to debug mode and to the allowed IPs. Other requests get a 404 error. - **`berlioz:system` job handler:** it is no longer registered by default, and it runs commands without a shell. See [`berlioz:system`](../guides/queues.md#berliozsystem). - **HTTP messages and mails:** line breaks are rejected in header names and values, to prevent header injection. - **Cache files:** cache directories and files are created with restrictive permissions.