PHPackages                             ldl-framework/container-builder - 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. [Framework](/categories/framework)
4. /
5. ldl-framework/container-builder

ActiveLibrary[Framework](/categories/framework)

ldl-framework/container-builder
===============================

Combines different service files in different directories

03465PHP

Since Jul 27Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ldl-php/ldl-container-builder)[ Packagist](https://packagist.org/packages/ldl-framework/container-builder)[ RSS](/packages/ldl-framework-container-builder/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (13)Used By (0)

ldl-container-builder
=====================

[](#ldl-container-builder)

Builds a Symfony container from a collection of service files found in different directories The service files themselves can be written in different formats (yml, xml, ini or php)

This builder will compile all of those files to one format (yml, xml, ini or php)

##### Find all services.xml, services.ini, services.yml, services.php files on a directory, write result as out.xml

[](#find-all-servicesxml-servicesini-servicesyml-servicesphp-files-on-a-directory-write-result-as-outxml)

```
php bin/build container:build out.xml /path/to/your/project

```

##### Example 2, find all services.xml, load first custom1.xml and custom2.xml

[](#example-2-find-all-servicesxml-load-first-custom1xml-and-custom2xml)

```
php bin/build container:build out.xml xml -d /path/to/your/project -l services.xml -f path/to/custom1.xml, /path/to/custom2.xml

```

##### Example 2, find all services.xml, match compiler passes with a pattern

[](#example-2-find-all-servicesxml-match-compiler-passes-with-a-pattern)

```
php bin/build container:build out.xml xml -d /path/to/your/project -l services.xml -p MyCompilerpass.php

```

Compiler passes
---------------

[](#compiler-passes)

#### IMPORTANT: As we can't handle whatever you pass into a compiler pass constructor, every compiler pass you have must extend to LDLAbstractCompilerPass

[](#important--as-we-cant-handle-whatever-you-pass-into-a-compiler-pass-constructor--every-compiler-pass-you-have-must-extend-to-ldlabstractcompilerpass)

### Controlling compiler pass priority and type

[](#controlling-compiler-pass-priority-and-type)

For using compiler pass priority and type, make your compiler pass extends to LDLAbstractCompilerPass

##### Example

[](#example)

```
