RepositoryPHPESSpain
theofidry

theofidry/AliceDataFixtures

Nelmio Alice extension to persist the loaded fixtures.

322stars
76forks
5issues
0views

🔌 AliceDataFixtures: Lớp lưu trữ cho Nelmio Alice 3.x

Bổ sung lớp persistence cho Nelmio Alice 3.x, tự động tải và lưu trữ fixture vào CSDL qua Symfony hoặc standalone.

AliceDataFixtures là một thư viện PHP mở rộng từ Nelmio Alice 3.x — phiên bản này không còn tích hợp sẵn lớp lưu trữ (persistence layer). Thư viện này điền đất hụt đó, cho phép tải các fixture định nghĩa bằng YAML và lưu trữ chúng trực tiếp vào cơ sở dữ liệu thông qua nhiều driver khác nhau. Dự án hỗ trợ Symfony 7.4+, Doctrine ORM 3.3+, Doctrine ODM 5.1+, Doctrine PHPCR 2.0+ và Eloquent 12.0+.

✨ Điểm nổi bật

  • Hỗ trợ đa driver: Tương thích với Doctrine ORM, MongoDB ODM, PHPCR và Eloquent ORM.
  • Tự động kích hoạt dịch vụ: Nếu bundle tương ứng được phát hiện (ví dụ DoctrineORMBundle), dịch vụ driver sẽ được bật tự động.
  • Cấu hình linh hoạt: Cho phép thiết lập default_purge_mode (delete/truncate/no_purge) và bật/tắt từng driver.
  • Dễ tích hợp Symfony: Hỗ trợ cài đặt với Flex hoặc thủ công, qua container service.
  • Tải fixture từ YAML: Định nghĩa fixture bằng YAML và tải chúng bằng LoaderInterface.
  • Hỗ trợ xóa dữ liệu cũ: Tự động purge bảng trước khi insert để tránh trùng lặp.
  • Dùng trong test: Dễ dàng tích hợp với PHPUnit hoặc Behat để khởi tạo dữ liệu mẫu.

💡 Vì sao đáng chú ý

Khác với các phiên bản trước của Nelmio Alice, AliceDataFixtures tách rời hoàn toàn lớp lưu trữ ra khỏi core — giúp dự án nhẹ hơn và linh hoạt hơn khi kết hợp với nhiều loại ORM/ODM khác nhau. Đây là lựa chọn lý tưởng cho các dự án Symfony cần quản lý fixture phức tạp mà không muốn viết thủ công logic xóa/lưu dữ liệu.


#PHP #Symfony #Doctrine #Fixtures #Alice #TiniX

Similar Projects

Discover other similar projects and AI models.

RepositoryPHP
nelmio/alice

Expressive fixtures generator

2.5k
Jun 15, 2026
RepositoryPHP
symfony/symfony

The Symfony PHP framework

31.2k
Oct 20, 2026
RepositoryPHP
getgrav/grav

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony

15.7k
Oct 20, 2026
RepositoryPHP
api-platform/api-platform

🕸️ Create REST and GraphQL APIs, scaffold Jamstack webapps, stream changes in real-time.

9.2k
Sep 1, 2026
RepositoryPHP
Sylius/Sylius

Headless open-source eCommerce platform on top of PHP/Symfony/API Platform

8.6k
Oct 24, 2026
RepositoryPHP
doctrine/DoctrineBundle

Symfony Bundle for Doctrine ORM and DBAL

4.8k
Oct 21, 2026
RepositoryPHP
EasyCorp/EasyAdminBundle

EasyAdmin is a fast, beautiful and modern admin generator for Symfony applications.

4.3k
Oct 22, 2026
RepositoryPHP
doctrine/DoctrineMigrationsBundle

Symfony integration for the doctrine/migrations library

4.3k
Aug 31, 2026
RepositoryPHP
sensiolabs/SensioFrameworkExtraBundle

An extension to Symfony FrameworkBundle that adds annotation configuration for Controller classes

3.3k
Feb 24, 2023