Download the PHP package dualmedia/disable-orm-bundle without Composer

On this page you can find all versions of the php package dualmedia/disable-orm-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 disable-orm-bundle

Packagist Downloads

DisableORM Bundle

A Symfony + Doctrine bundle to allow disabling fields from being seen by DoctrineORM.

Why

This bundle will allow you to seamlessly update your application, assuming you have multiple versions running at the same time, with different database expectations.

While adding new entities is not an issue, as they're simply not present in the old application versions, this is not the case for entities being modified. You must either shut down all instances before running migrations which could cause differences in database schema expectations or... use this bundle.

With this, you're able to safely "remove" a field, so that the old version of the application can still use it before update, and the new one can ignore it.

As this modifies the ORM metadata the field is transparently removed from ORM and is not usable outside of raw SQL queries.

Install

Simply composer require dualmedia/disable-orm-bundle

Then add the bundle to your config/bundles.php file like so

Setup

You must manually set the doctrine class metadata factory name value under your entity manager to use this bundle.

Config

Usage

The #[DisableORM] attribute prevents doctrine from loading and creating the column from the database.

You should set a default value for the column before this, as otherwise you might get issues inserting new entities!

Use your entities as usual, when you decide you want to remove a field from it simply add #[DisableORM] on it, then update your application once.

From then, you can safely remove the field with a migration while not causing any downtime.

Example

PHPStan Rule

Simply add the following to your PHPStan config to enable a simple check for your entities (only applies if you're using PHP8 Attributes)

Git change detection

To prevent breaking your application on accident you may add the script in /scripts to your CI to automatically detect possibly incorrect removals of fields.

As when using this bundle it is expected, that a removed field WILL contain the DisableORM attribute, before being deleted, because of that, we can catch invalid field removals in the CI steps.

A Gitlab CI declaration is provided in the .gitlab-ci.job.yml file, simply include it and then extend it as required.


All versions of disable-orm-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
doctrine/doctrine-bundle Version ^2 || ^3
doctrine/orm Version ^3
symfony/framework-bundle Version ^6.4 || ^7.4 || ^8.0
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 dualmedia/disable-orm-bundle contains the following files

Loading the files please wait ...