Download the PHP package runopencode/doctrine-naming-strategy-bundle without Composer

On this page you can find all versions of the php package runopencode/doctrine-naming-strategy-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-naming-strategy-bundle

Doctrine naming strategy bundle

Packagist Scrutinizer Code Quality Build Status Code Coverage Build Status

SensioLabsInsight

Default Symfony2 Doctrine naming strategy doctrine.orm.naming_strategy.underscore for Entity tables is really great and we usually use it without any modifications. However, generated table names sometimes can be too ambiguous and conflicting, especially if vendor bundles are used, or there is a possibility to reuse some of the code from previous projects.

Common practice is, as always, to take over the control of setting names for Entity tables explicitly.

However, this can be really painful for lazy developers.

Modifying naming strategy to the rescue

In Doctrine2, it is quite possible with ease to take over the control of the naming strategy (for details see this Doctrine "Implementing a NamingStrategy") article), while Symfony2 in process of construction of Doctrine service, fetch naming strategy implementation as a service (see this Stackowerflow question and answer).

In that matter, the purpose of this bundle is to provide you with additional naming strategies which would allow you to keep good quality naming convention for your Entity tables, prevent table name conflicts and still be lazy about it.

Naming strategies within the bundle

Provided naming strategies within the bundles are:

Installing the bundle

You can install this bundle by using composer:

php composer require "runopencode/doctrine-naming-strategy-bundle"                            

or you can add bundle name to your composer.json and execute php composer update command.

After that, all you need is to add the bundle to your config/bundles.php file:

<?php 

return [
    // ... other bundles
    RunOpenCode\Bundle\DoctrineNamingStrategy\DoctrineNamingStrategyBundle::class => [ 'all' => true ],
];               

And in your project config/packages/doctrine.yml you should define which naming strategy you would like to use:

doctrine:
    orm:
        naming_strategy: [SERVICE NAME OF NAMING STRATEGY THAT YOU WOULD LIKE TO USE]

NOTE: Adding this bundle to your project make sense only at the very beginning of the project, PRIOR to materialization of the tables into database. Otherwise, it will give you a quite an issue if you do not use properly namers and their possibility to define white and black lists.

Naming strategies configuration options

Options for runopencode.doctrine.orm.naming_strategy.underscored_bundle_prefix

NOTE: You can either use whitelist or blacklist or none, but never booth.

Configuration example

runopencode_doctrine_naming_strategy:
    underscored_bundle_prefix:
        case: lowercase
        map:
            MyLongNameOfTheBundle: my_prefix
            MyOtherLongNameOfTheBundle: my_prefix_2
        blacklist:
            - DoNotPrefixThisBundle         

Options for runopencode.doctrine.orm.naming_strategy.underscored_class_namespace_prefix

NOTE: You can either use whitelist or blacklist or none, but never booth.

Configuration example

runopencode_doctrine_naming_strategy:
    underscored_class_namespace_prefix:
        case: uppercase
        map:
            My\Class\Namespace\Entity: my_prefix
        blacklist:
            - My\Class\Namespace\Entity\ThisShouldBeSkipped
            - My\Class\Namespace\Entity\ThisShouldBeSkippedAsWell

Options for runopencode.doctrine.orm.naming_strategy.underscored_namer_collection

Configuration example

runopencode_doctrine_naming_strategy:         
    underscored_namer_collection:
        default: doctrine.orm.naming_strategy.underscore
        namers:
            - runopencode.doctrine.orm.naming_strategy.underscored_class_namespace_prefix
            - runopencode.doctrine.orm.naming_strategy.underscored_bundle_prefix            

Known issues

Development

Library is delivered with dockerized environment. You may run docker-compose up -d to fire up environment, and then you can run bin/attach to attach container to your CLI. From container, you may run scripts defined in composer.json file to do static analysis, check code style, as well as run tests.

In order to run full build, you need to have ant installed and you may run it from root directory of your project from host (outside of container).


All versions of doctrine-naming-strategy-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4
ext-xml Version *
symfony/framework-bundle Version ^4.0|^5.0
doctrine/doctrine-bundle Version ^2.0
symfony/dependency-injection Version ^4.0|^5.0
symfony/http-kernel Version ^4.0|^5.0
symfony/config Version ^4.0|^5.0
doctrine/orm Version ^2.5
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 runopencode/doctrine-naming-strategy-bundle contains the following files

Loading the files please wait ....