PHPackages                             tourze/digital-ocean-domain-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/digital-ocean-domain-bundle

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

tourze/digital-ocean-domain-bundle
==================================

DigitalOcean域名管理

0.0.2(4mo ago)00MITPHPCI passing

Since May 24Pushed 4mo ago1 watchersCompare

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

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

DigitalOcean Domain Management Bundle
=====================================

[](#digitalocean-domain-management-bundle)

[![PHP Version](https://camo.githubusercontent.com/092d545f529c0bc11f393035f40f9cced2c9db2a0d148532f4fc2aa5409dc992/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d3737374242342e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)[![Build Status](https://camo.githubusercontent.com/c27a457659b89ee4f1f80f7995c559dd37f2051bde7167ad25791e5c5c92cc8e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6275696c642d70617373696e672d627269676874677265656e2e737667)](#)[![Code Coverage](https://camo.githubusercontent.com/b3545ae1bcdb4ea486f71f87b43001e82dd21933bc8035d44601706c851265da/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d3130302532352d627269676874677265656e2e737667)](#)

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

This bundle provides support for DigitalOcean domain and DNS record management.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Installation](#installation)
- [Dependencies](#dependencies)
    - [Required Dependencies](#required-dependencies)
    - [Optional Dependencies](#optional-dependencies)
- [Usage](#usage)
    - [Domain Management](#domain-management)
    - [Domain Record Management](#domain-record-management)
    - [Data Synchronization](#data-synchronization)
- [Console Commands](#console-commands)
- [Bidirectional Sync](#bidirectional-sync)
- [Configuration](#configuration)
- [Advanced Usage](#advanced-usage)
    - [Error Handling](#error-handling)
    - [Batch Operations](#batch-operations)
    - [Custom Queries](#custom-queries)
- [Documentation](#documentation)
- [License](#license)

Features
--------

[](#features)

- Domain management: create, query, delete domains
- Domain record management: create, query, update, delete domain records
- Data synchronization: sync domains and records from DigitalOcean to local database
- Console commands: convenient command-line tools for domain and record management
- Bidirectional sync: support for two-way sync between local database and remote DigitalOcean

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

[](#installation)

```
composer require tourze/digital-ocean-domain-bundle
```

Dependencies
------------

[](#dependencies)

### Required Dependencies

[](#required-dependencies)

- PHP ^8.1
- Symfony ^7.3
- Doctrine ORM ^3.0
- tourze/digital-ocean-account-bundle ^0.1

### Optional Dependencies

[](#optional-dependencies)

- tourze/doctrine-indexed-bundle - for database index support
- tourze/doctrine-timestamp-bundle - for timestamp field support
- tourze/symfony-aop-doctrine-bundle - for AOP support

Usage
-----

[](#usage)

### Domain Management

[](#domain-management)

```
// Get domain list
$domains = $domainService->listDomains();

// Get single domain
$domain = $domainService->getDomain('example.com');

// Create domain
$domain = $domainService->createDomain('example.com', '123.456.789.10');

// Delete domain
$result = $domainService->deleteDomain('example.com');
```

### Domain Record Management

[](#domain-record-management)

```
// Get domain record list
$records = $domainService->listDomainRecords('example.com');

// Get single domain record
$record = $domainService->getDomainRecord('example.com', 12345);

// Create domain record
$record = $domainService->createDomainRecord(
    'example.com',
    'A',
    'www',
    '123.456.789.10'
);

// Update domain record
$record = $domainService->updateDomainRecord(
    'example.com',
    12345,
    'A',
    'www',
    '123.456.789.11'
);

// Delete domain record
$result = $domainService->deleteDomainRecord('example.com', 12345);
```

### Data Synchronization

[](#data-synchronization)

```
// Sync all domains
$domains = $domainService->syncDomains();

// Sync records for specific domain
$records = $domainService->syncDomainRecords('example.com');
```

Console Commands
----------------

[](#console-commands)

This bundle provides several console commands for managing domains and records:

```
# Sync all domains
php bin/console digital-ocean:domain:sync

# Sync records for single domain
php bin/console digital-ocean:domain:sync-records example.com

# Sync all domain records
php bin/console digital-ocean:domain:sync-records

# List domain records (query local database)
php bin/console digital-ocean:domain:record:list example.com

# List domain records (query remote API directly)
php bin/console digital-ocean:domain:record:list example.com --remote

# Filter records by type
php bin/console digital-ocean:domain:record:list example.com --type=A

# Search records by name
php bin/console digital-ocean:domain:record:list example.com --name=www

# Create domain record
php bin/console digital-ocean:domain:record:create example.com A www 123.456.789.10

# Create MX record
php bin/console digital-ocean:domain:record:create example.com MX mail 123.456.789.10 --priority=10

# Update domain record
php bin/console digital-ocean:domain:record:update example.com 12345 --data=123.456.789.11

# Update remote record with local data
php bin/console digital-ocean:domain:record:update example.com 12345 --local

# Delete domain record
php bin/console digital-ocean:domain:record:delete example.com 12345
```

Bidirectional Sync
------------------

[](#bidirectional-sync)

This bundle supports bidirectional synchronization between local database and remote DigitalOcean:

1. From remote to local: use `digital-ocean:domain:sync-records` command or `syncDomainRecords` method
2. From local to remote: use `digital-ocean:domain:record:update` command with `--local` flag

This allows you to manage DNS records locally and then push changes to DigitalOcean, or pull the latest changes from DigitalOcean to your local database.

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

[](#configuration)

This bundle depends on the configuration service provided by `digital-ocean-account-bundle`. Make sure the API token is properly configured.

Advanced Usage
--------------

[](#advanced-usage)

### Error Handling

[](#error-handling)

```
try {
    $record = $domainService->createDomainRecord(
        'example.com',
        'A',
        'www',
        '123.456.789.10'
    );
} catch (\DigitalOceanDomainBundle\Exception\ConfigurationException $e) {
    // Handle configuration errors
    $logger->error('DigitalOcean configuration error: ' . $e->getMessage());
} catch (\Exception $e) {
    // Handle other errors
    $logger->error('Failed to create domain record: ' . $e->getMessage());
}
```

### Batch Operations

[](#batch-operations)

```
// Batch sync multiple domain records
$domains = ['example.com', 'test.com', 'demo.com'];
$results = [];

foreach ($domains as $domain) {
    try {
        $records = $domainService->syncDomainRecords($domain);
        $results[$domain] = ['success' => true, 'count' => count($records)];
    } catch (\Exception $e) {
        $results[$domain] = ['success' => false, 'error' => $e->getMessage()];
    }
}
```

### Custom Queries

[](#custom-queries)

```
// Use Repository for custom queries
$domainRepository = $em->getRepository(Domain::class);
$domainRecordRepository = $em->getRepository(DomainRecord::class);

// Find domains created within specific time range
$domains = $domainRepository->createQueryBuilder('d')
    ->where('d.createTime BETWEEN :start AND :end')
    ->setParameter('start', new \DateTime('2023-01-01'))
    ->setParameter('end', new \DateTime('2023-12-31'))
    ->getQuery()
    ->getResult();

// Count records by type
$recordCounts = $domainRecordRepository->createQueryBuilder('dr')
    ->select('dr.type, COUNT(dr.id) as count')
    ->groupBy('dr.type')
    ->getQuery()
    ->getResult();
```

Documentation
-------------

[](#documentation)

For more information, please refer to the [DigitalOcean API Documentation](https://docs.digitalocean.com/reference/api/api-reference/#tag/Domains).

License
-------

[](#license)

MIT

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance74

Regular maintenance activity

Popularity0

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

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 ~208 days

Total

2

Last Release

144d ago

### Community

Maintainers

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

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tourze-digital-ocean-domain-bundle/health.svg)

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

###  Alternatives

[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[sulu/sulu

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

1.3k1.3M152](/packages/sulu-sulu)[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)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)

PHPackages © 2026

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