PHPackages                             rollerworks/pdb-symfony-bridge - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rollerworks/pdb-symfony-bridge

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rollerworks/pdb-symfony-bridge
==============================

PHP domain-parser Bridge for Symfony Cache, HTTP Client and FrameworkBundle (optional)

v1.1.1(2mo ago)01.4k12MITPHPPHP ^8.2CI passing

Since Nov 2Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/rollerworks/PdbSfBridge)[ Packagist](https://packagist.org/packages/rollerworks/pdb-symfony-bridge)[ RSS](/packages/rollerworks-pdb-symfony-bridge/feed)WikiDiscussions main Synced 1mo ago

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

PHP Domain Parser Symfony-bridge
================================

[](#php-domain-parser-symfony-bridge)

This package provides a Symfony specific bridge for the [PHP domain-parser](https://github.com/jeremykendall/php-domain-parser)by Jeremy Kendall and Ignace Nyamagana Butera.

Providing a Cache adapter, HTTP Client adapter, and optional FrameworkBundle integration at `Rollerworks\Component\PdbSfBridge\Bundle\RollerworksPdbBundle`.

Installation
------------

[](#installation)

To install this package, add `rollerworks/pdb-symfony-bridge` to your composer.json:

```
$ php composer.phar require rollerworks/pdb-symfony-bridge
```

Now, [Composer](https://getcomposer.org/doc/00-intro.md) will automatically download all required files, and install them for you.

[Symfony Flex](https://symfony.com/doc/current/setup/flex.html) (with contrib) is assumed to enable the Bundle and add required configuration.

Otherwise add the following configuration:

Details```
rollerworks_pdb:
    cache_pool: 'rollerworks.cache.public_prefix_db'
    #manager: http # either: 'http' (default), 'static' (requires manual updates) or 'mock'

framework:
    cache:
        pools:
            # This name can be changed by setting `rollerworks_pdb.cache_pool` (**Don't reuse an existing cache pool!**)
            rollerworks.cache.public_prefix_db:
                adapter: cache.adapter.array # use a persistent adapter that can be easily invalidated like cache.adapter.memcached or cache.adapter.pdo
                default_lifetime: 604800 # one week, the cache should be automatically refreshed, unless manager=static is used
```

Requirements
------------

[](#requirements)

You need at least PHP 8.1, and internet access is recommended but not required.

The public-suffix and top-level domain needs to manually updated from time to time. When internet access is available the PdbManager will automatically download the list and store it in the cache.

If no internet access is available, the local cache needs to refreshed manually. (Current not supported yet).

Basic Usage
-----------

[](#basic-usage)

Use the `HttpUpdatedPdpManager` to get a PdbManager which automatically updates the local cache using the HttpClient.

```
