Download the PHP package kraz/doctrine-context-bundle without Composer

On this page you can find all versions of the php package kraz/doctrine-context-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package doctrine-context-bundle

Doctrine Context Bundle

CI Packagist Version

A Symfony bundle that makes working with multiple Doctrine entity managers or DBAL connections painless. It wraps the standard Doctrine commands so that a single command can target one specific context or fan out across all of them automatically. The only hard dependency is doctrine/dbal - ORM and Migrations support are both optional.

The problem

When a project has more than one entity manager or DBAL connection, running the same operation across all of them requires repeating the command manually once per context:

There is also a subtle schema-pollution problem: after running migrations, doctrine:schema:update and doctrine:schema:validate see the migration metadata table (e.g. doctrine_migration_versions) as an unmanaged table and report it as something to drop or as a validation error.

What this bundle does

Requirements

Dependency Version
PHP >= 8.4
doctrine/doctrine-bundle ^3.2
doctrine/doctrine-migrations-bundle ^4.0 (optional)
doctrine/orm ^3.6 (optional)

Installation

Register the bundle in config/bundles.php if you are not using Symfony Flex:

Configuration

Register each entity manager or connection that should be treated as a named context. You may use entity_managers (requires doctrine/orm) or connections, but not both for the same name.

The migration-related options (migrations_paths, storage, services, etc.) are only available when doctrine/doctrine-migrations-bundle is installed. Without it, a context is configured with just its name.

DBAL only (no ORM, no Migrations)

With DBAL connections and Migrations

With entity managers (ORM) and Migrations

With entity managers (ORM), no Migrations

Requiring explicit context selection

Set explicit_context: true to prevent any wrapped command from fanning out over all contexts unless the caller deliberately opts in with --ctx-all. Every invocation must target a specific context or pass --ctx-all explicitly, making accidental mass operations impossible.

With this option active, the following is an error:

Provide a context or opt into all:

Full configuration reference

The migration-related keys below are only accepted when doctrine/doctrine-migrations-bundle is installed.

Usage

Run migrations for all contexts

Omitting --em / --conn fans the command out across every registered context:

Output will be grouped by context:

Target a specific context

Target a subset of contexts

Use the plural form of each option to pass multiple context names. Values can be supplied as separate arguments or as a comma-separated list - both forms are equivalent and may be combined:

Option Plural / multi-value form Applicable commands
--em --ems ORM and migration commands
--conn --conns Migration and database commands
--connection --connections Database commands

Continue past failures with --ctx-isolation

By default, a failure in one context stops execution when executed in non-interactive mode. Use --ctx-isolation to continue with the remaining contexts regardless:

Run over all contexts explicitly with --ctx-all

--ctx-all behaves identically to omitting a specific context (fans out over every registered context), but makes the intent explicit. It is required when explicit_context: true is configured and no specific context is given:

Create databases

All supported commands

Always available (DBAL only):

Command Description
doctrine:database:create Create the database for each registered context

When doctrine/doctrine-migrations-bundle is installed:

Command Description
doctrine:migrations:migrate Execute migrations
doctrine:migrations:diff Generate a migration by diffing the schema
doctrine:migrations:generate Generate a blank migration class
doctrine:migrations:execute Execute or revert a specific migration
doctrine:migrations:status Show the migration status
doctrine:migrations:list List available migrations
doctrine:migrations:current Show the current migration version
doctrine:migrations:latest Show the latest available version
doctrine:migrations:up-to-date Check if the schema is up to date
doctrine:migrations:rollup Roll up migrations into a single version
doctrine:migrations:version Manually add/delete versions from the table
doctrine:migrations:dump-schema Dump the schema for a mapping
doctrine:migrations:sync-metadata-storage Sync the metadata storage

When doctrine/orm is installed:

Command Description
doctrine:schema:create Create schema across all entity managers
doctrine:schema:validate Validate schema across all entity managers
doctrine:mapping:info Show mapping info across all entity managers

Schema filter

When doctrine/doctrine-migrations-bundle is installed, the bundle automatically registers a DBAL schema filter per context that hides the migration metadata table from doctrine:schema:update and doctrine:schema:validate. This prevents those commands from flagging the migration table as an unmanaged or extra table.

The filter activates only during schema update/validate commands and is otherwise transparent.

Acknowledgements

The idea behind this bundle is credited to DoctrineMigrationsMultipleDatabaseBundle which was heavily refactored to support Symfony 8 and some functional enhancements.

License

This bundle is licensed under the MIT License. See the LICENSE file for details.


All versions of doctrine-context-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
doctrine/doctrine-bundle Version ^3.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kraz/doctrine-context-bundle contains the following files

Loading the files please wait ...