百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
A

alice

> 后端框架
开源

表达性装置生成器

2.5K stars0 点赞1 次浏览
访问官网GitHub

工具介绍

表达性装置生成器

Alice - Expressive fixtures generator

Relying on [FakerPHP/Faker](https://github.com/FakerPHP/Faker), Alice allows you to create a ton of fixtures/fake data for use while developing or testing your project. It gives you a few essential tools to make it very easy to generate complex data with constraints in a readable and easy to edit way, so that everyone on your team can tweak the fixtures if needed. **Warning: this doc is for alice 3.0. If you want to check the documentation for 2.x, follow [this link](https://github.com/nelmio/alice/tree/2.x)**. **2.x is in maintenance mode: PRs are accepted, but no active development is done on it by the maintainers any longer.** ## Table of Contents 1. [Installation](#installation) 1. [Example](#example) 1. [Getting Started](doc/getting-started.md) 1. [Basic Usage](doc/getting-started.md#basic-usage) 1. [Framework integration](doc/getting-started.md#framework-integration) 1. [Symfony](doc/getting-started.md#symfony) 1. [Complete Reference](doc/complete-reference.md) 1. [Creating Fixtures](doc/complete-reference.md#creating-fixtures) 1. [YAML](doc/complete-reference.md#yaml) 1. [PHP](doc/complete-reference.md#php) 1. [JSON](doc/complete-reference.md#json) 1. [Fixture Ranges](doc/complete-reference.md#fixture-ranges) 1. [Fixture Lists](doc/complete-reference.md#fixture-lists) 1. [Fixture Reference](doc/complete-reference.md#fixture-reference) 1. [Calling Methods](doc/complete-reference.md#calling-methods) 1. [Method arguments with flags](doc/complete-reference.md#method-arguments-with-flags) 1. [Method arguments with parameters](doc/complete-reference.md#method-arguments-with-parameters) 1. [Specifying Constructor Arguments](doc/complete-reference.md#specifying-constructor-arguments) 1. [Using a factory / a named constructor](doc/complete-reference.md#using-a-factory--a-named-constructor) 1. [Optional Data](doc/complete-reference.md#optional-data) 1. [Handling Unique Constraints](doc/complete-reference.md#handling-unique-constraints) 1. [Handling Relations](doc/relations-handling.md) 1. [References](doc/relations-handling.md#references) 1. [Multiple References](doc/relations-handling.md#multiple-references) 1. [Self reference](doc/relations-handling.md#self-reference) 1. [Passing references to providers](doc/relations-handling.md#passing-references-to-providers) 1. [Keep Your Fixtures Dry](doc/fixtures-refactoring.md) 1. [Fixture Inheritance](doc/fixtures-refactoring.md#fixture-inheritance) 1. [Including files](doc/fixtures-refactoring.md#including-files) 1. [Variables](doc/fixtures-refactoring.md#variables) 1. [Parameters](doc/fixtures-refactoring.md#parameters) 1. [Static parameters](doc/fixtures-refactoring.md#static-parameters) 1. [Dynamic parameters](doc/fixtures-refactoring.md#dynamic-parameters) 1. [Composite parameters](doc/fixtures-refactoring.md#composite-parameters) 1. [Usage with functions (constructor included)](doc/fixtures-refactoring.md#usage-with-functions-constructor-included) 1. [Inject external parameters](doc/fixtures-refactoring.md#inject-external-parameters) 1. [Customize Data Generation](doc/customizing-data-generation.md) 1. [Faker Data](doc/customizing-data-generation.md#faker-data) 1. [Localized Fake Data](doc/customizing-data-generation.md#localized-fake-data) 1. [Random data](doc/customizing-data-generation.md#random-data) 1. [Default Providers](doc/customizing-data-generation.md#default-providers) 1. [Identity](doc/customizing-data-generation.md#identity) 1. [Current](doc/customizing-data-generation.md#current) 1. [Cast](doc/customizing-data-generation.md#cast) 1. [Custom Faker Data Providers](doc/customizing-data-generation.md#custom-faker-data-providers) 1. [Advanced Guide](doc/advanced-guide.md#advanced-guide) 1. [Performance](doc/advanced-guide.md#performance) 1. [Expression Language (DSL)](doc/advanced-guide.md#expression-language-dsl) 1. [Parameters](doc/advanced-guide.md#parameters) 1. [Functions](doc/advanced-guide.md#functions) 1. [Identity](doc/advanced-guide.md#identity) 1. [Arrays](doc/advanced-guide.md#arrays) 1. [Optional](doc/advanced-guide.md#optional) 1. [References](doc/advanced-guide.md#references) 1. [Property Reference](doc/advanced-guide.md#property-reference) 1. [Extending Alice](doc/advanced-guide.md#extending-alice) 1. [Custom Flag](doc/advanced-guide.md#custom-flag) 1. [Custom Instantiation](doc/advanced-guide.md#custom-instantiator) 1. [Custom Accessor](doc/advanced-guide.md#custom-accessor) 1. [Third-party libraries](#third-party-libraries) 1. [Symfony](#symfony) 1. [Nette](#nette) 1. [Zend Framework 2](#zend-framework-2) 1. [Framework Agnostic](#framework-agnostic) 1. [Contribute](CONTRIBUTING.md#contribute) 1. [Differences between 2.x and 3.x](CONTRIBUTING.md#differences-between-2x-and-3x) 1. [Architecture](CONTRIBUTING.md#architecture) 1. [FixtureBuilder](CONTRIBUTING.md#fixturebuilder) 1. [Generator](CONTRIBUTING.md#generator) 1. [Expression Language](CONTRIBUTING.md#expression-language) 1. [Contributing](CONTRIBUTING.md#contributing) 1. [Testing](CONTRIBUTING.md#testing) 1. [Profiling](CONTRIBUTING.md#profiling) 1. [Backward Compatibility Promise (BCP)](#backward-compatibility-promise-bcp) 1. [Upgrade](#upgrade) 1. [Breaking changes between Alice 2.x and 3.0](UPGRADE.md#breaking-changes-between-alice-2x-and-30) ## Installation This is installable via [Composer](https://getcomposer.org/) as [nelmio/alice](https://packagist.org/packages/nelmio/alice): composer require --dev nelmio/alice ## Example Here is a complete example of entity declaration: ```yaml Nelmio\Entity\User: user{1..10}: username: '' fullname: ' ' birthDate: '' email: '' favoriteNumber: '50%? ' Nelmio\Entity\Group: group1: name: Admins owner: '@user1' members: 'x @user*' created: '' updated: '' ``` You can then load them easily with: ```php $loader = new Nelmio\Alice\Loader\NativeLoader(); $objectSet = $loader->loadFile(__DIR__.'/fixtures.yml'); ``` Or load an array right away: ``` … ``` For more information, refer to [the documentation](#table-of-contents). ## Third-party libraries ### Framework Agnostic - [theofidry/AliceDataFixtures](https://github.com/theofidry/AliceDataFixtures) - [trappar/AliceGenerator](https://github.com/trappar/AliceGenerator) ### Symfony - [hautelook/AliceBundle](https://github.com/theofidry/AliceBundle) ### Nette - [Zenify/DoctrineFixtures](https://github.com/Zenify/DoctrineFixtures) ### WordPress - [rmp-up/wp-fixtures](https://github.com/rmp-up/wp-fixtures) ### Zend Framework 2: - [ma-si/aist-alice-fixtures](https://github.com/ma-si/aist-alice-fixtures) ## Contribute Check the [contribution guide](CONTRIBUTING.md). ## Backward Compatibility Promise (BCP) The policy is for the major part following the same as [Symfony's one][symfony-bc-policy] with a few changes or highlights: - Code marked with `@private` or `@internal` are excluded from the BCP - `Nelmio\Alice\Loader\NativeLoader` is excluded from the BCP: as it is the no DIC solution, registring a new service may require a new method, in which case your code may break if you have already declared that method. To avoid that, please beware of the naming of your methods to avoid any conflicts. ## Upgrade Check the [upgrade guide](UPGRADE.md). [symfony-bc-policy]: https://symfony.com/doc/current/contributing/code/bc.html

GitHub Issues· 0 开放

在 GitHub 查看全部

暂无开放 Issues,或尚未同步最近议题。

核心特点

  • •theofidry/AliceDataFixtures
  • •trappar/AliceGenerator
  • •hautelook/AliceBundle
  • •Zenify/DoctrineFixtures
  • •rmp-up/wp-fixtures
  • •ma-si/aist-alice-fixtures
  • •Code marked with @private or @internal are excluded from the BCP
  • •Nelmio\Alice\Loader\NativeLoader is excluded from the BCP: as it is the no DIC solution, registring a new service

> 标签

PHPaliceexpression-languagefakerfixture

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类后端框架
定价开源

> 相关工具

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架