PHPackages                             tourze/ip-collection-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tourze/ip-collection-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

tourze/ip-collection-bundle
===========================

IP地址收集和标记管理工具，支持多种IP来源同步

0.1.0(1y ago)03MITPHPPHP ^8.1CI passing

Since Apr 28Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/tourze/ip-collection-bundle)[ Packagist](https://packagist.org/packages/tourze/ip-collection-bundle)[ RSS](/packages/tourze-ip-collection-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (23)Versions (3)Used By (0)

IP Collection Bundle
====================

[](#ip-collection-bundle)

[![Latest Version](https://camo.githubusercontent.com/ac50c723140be5b9ffff461ec0722f3cd672ef1d21dceaa883f80b50272dd730/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f75727a652f69702d636f6c6c656374696f6e2d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/ip-collection-bundle)[![PHP Version](https://camo.githubusercontent.com/ee631d1b3535e8b3a99c9152d465e9db0c74b77d6c84694515f8ebc38cda9aea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d626c75653f7374796c653d666c61742d737175617265)](https://php.net)[![License](https://camo.githubusercontent.com/422db9fd40f5831c765cf6530b6750c081b696bd18d904cf89554df98c676277/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e3f7374796c653d666c61742d737175617265)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/b1afbd076bf7c6886389198140e8437dc89cb6e3574c38e68b13d72d02cddcb3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f75727a652f69702d636f6c6c656374696f6e2d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/ip-collection-bundle)[![Code Coverage](https://camo.githubusercontent.com/50a4fbc8e51d67d8814fd8ab90d2cbd132da38b8d00c18c96634f969c20867a8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d3130302532352d627269676874677265656e3f7374796c653d666c61742d737175617265)](#)

[English](README.md) | [中文](README.zh-CN.md)

A Symfony Bundle for collecting and managing IP address information from various sources including AWS, cloud providers, and BT trackers.

Features
--------

[](#features)

- Synchronize various public IP address lists
- Collect BT Tracker addresses
- Synchronize AWS IP address ranges
- IP address tagging and management
- Automated synchronization with cron jobs

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

[](#installation)

### Requirements

[](#requirements)

This bundle requires the following dependencies:

- PHP 8.1 or higher
- Symfony 7.3+
- Doctrine ORM 3.0+
- Additional packages:
    - `league/uri`: URI manipulation library
    - `nesbot/carbon`: Date manipulation library
    - `yiisoft/json`: JSON encoding/decoding
    - `tourze/doctrine-upsert-bundle`: Database upsert operations
    - `tourze/symfony-lock-command-bundle`: Command locking
    - `tourze/symfony-cron-job-bundle`: Cron job scheduling

### Install via Composer

[](#install-via-composer)

```
composer require tourze/ip-collection-bundle
```

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

[](#configuration)

Add the bundle to your `config/bundles.php`:

```
return [
    // ...
    IpCollectionBundle\IpCollectionBundle::class => ['all' => true],
];
```

Usage
-----

[](#usage)

### Commands

[](#commands)

The Bundle provides the following console commands:

- `game-boost:sync-cidr` - Synchronize IP address lists from various cloud providers and sources
- `ip-collection:sync-aws-ip-range` - Synchronize AWS IP address ranges
- `bt:sync-public-tracker` - Collect public BT Tracker addresses

All commands are configured with automatic cron scheduling and can also be executed manually.

#### Manual Execution

[](#manual-execution)

```
# Synchronize AWS IP ranges (runs every 6 hours)
php bin/console ip-collection:sync-aws-ip-range

# Sync CIDR lists from various cloud providers (runs every 6 hours)
php bin/console game-boost:sync-cidr

# Collect BT tracker addresses (runs daily at 6:33 AM)
php bin/console bt:sync-public-tracker
```

### Entities

[](#entities)

The Bundle includes the following entities:

- `IpTag` - Stores IP address tag information
- `BtTracker` - Stores BT Tracker information

### Advanced Usage

[](#advanced-usage)

#### Customizing IP Sources

[](#customizing-ip-sources)

You can extend the `SyncCidrListCommand` class to add your own IP data sources:

```
class CustomSyncCommand extends SyncCidrListCommand
{
    protected function getProviders(): \Traversable
    {
        // Add your custom providers here
        yield 'custom-source' => [
            'https://example.com/ip-list.txt',
        ];

        // Include default providers
        yield from parent::getProviders();
    }
}
```

#### Working with IP Tags

[](#working-with-ip-tags)

```
use IpCollectionBundle\Entity\IpTag;
use Doctrine\ORM\EntityManagerInterface;

// Find IPs by tag
$repository = $entityManager->getRepository(IpTag::class);
$awsIps = $repository->findBy(['tag' => 'aws-ipv4']);
$chinaIps = $repository->findBy(['tag' => 'geoip2-cn']);
$aliyunIps = $repository->findBy(['tag' => 'aliyun']);

// Check if an IP belongs to a specific provider
$isAwsIp = $repository->findOneBy([
    'address' => '203.0.113.0/24',
    'tag' => 'aws-ipv4'
]) !== null;
```

#### Working with BT Trackers

[](#working-with-bt-trackers)

```
use IpCollectionBundle\Entity\BtTracker;

// Get all active trackers
$trackerRepository = $entityManager->getRepository(BtTracker::class);
$trackers = $trackerRepository->findAll();

// Filter by protocol
$udpTrackers = array_filter($trackers, fn(BtTracker $tracker) =>
    str_starts_with($tracker->getUrl(), 'udp://')
);
```

Testing
-------

[](#testing)

Run the following command in the project root directory to execute tests:

```
vendor/bin/phpunit packages/ip-collection-bundle/tests
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING.md](../../CONTRIBUTING.md) for details on how to contribute to this project.

Changelog
---------

[](#changelog)

Please see [CHANGELOG.md](CHANGELOG.md) for information about recent changes.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance67

Regular maintenance activity

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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

Every ~6 days

Total

2

Last Release

369d ago

### Community

Maintainers

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

---

Top Contributors

[![tourze](https://avatars.githubusercontent.com/u/13899502?v=4)](https://github.com/tourze "tourze (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tourze-ip-collection-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/tourze-ip-collection-bundle/health.svg)](https://phpackages.com/packages/tourze-ip-collection-bundle)
```

###  Alternatives

[sylius/sylius

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

8.4k5.6M647](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M151](/packages/sulu-sulu)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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