Download the PHP package jurosh/laravel-doctrine-forked without Composer

On this page you can find all versions of the php package jurosh/laravel-doctrine-forked. 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 laravel-doctrine-forked

Doctrine 2 for Laravel 5

A forked implementation of laravel-doctrine that melts with Laravel 5.

Documentation

As this is a forked version the documentation still applies to most of the package. Please read the original documentation and README before using this fork.

Forked Changes, Improvements, and Functionality

  1. What's New?
  2. Installation
  3. Using different metadata drivers
  4. Using multiple entity managers
  5. Using DoctrineExtensions
  6. New Doctrine Configuration Reference
  7. Issues and Contributing

What's New?

Fixes for Laravel 5 support

New Functionality

Installation

Begin by installing the package through Composer. Edit your project's composer.json to require mitchellvanw/laravel-doctrine.

Next use Composer to update your project from the the Terminal:

Caveats

At the moment Doctrine\ORM version 2.5 is still in beta. As a result the composer install may require you to change the minimum-stability in your composer.json to dev.

If you don't want to affect the stability of the rest of the packages, you can add the following property in your composer.json:

"prefer-stable": true

Once the package has been installed you'll need to add the service provider. Open your app/config/app.php configuration file, and add a new item to the providers array.

After This you'll need to add the facade. Open your app/config/app.php configuration file, and add a new item to the aliases array.

It's recommended to publish the package configuration.

Using different metadata drivers

Doctrine provides several drivers that can be used to map table information to entity classes. For more information see sections 19, 20, and 21 of the doctrine reference guide.

A default doctrine config will use the annotation driver. This is the way laravel-doctrine works out of the box. If this is all you need you can continue to use the documentation provided by laravel-doctrine's wiki.

To use a different driver edit the metadata property of the entity manager you want to use the driver with (in doctrine.config)

'entity_managers' => [
    'default' => [
        ...
        'metadata' => [
            'simple' => false,
            'driver' => 'yaml', //xml or yaml or annotation (ANNOTATION IS DEFAULT)
            'paths' => [
                base_path('app/Models/mappings') //all base paths to mapping directories go here
            ],
            'extension' => '.dcm.yml' //extension for mapping files if not using simple driver
        ],
    ],
  ]

Refer to the doctrine reference guide on how to set up each driver.

Using multiple entity managers

If you use the regular EntityManager facade you will receive the default EM defined in your doctrine config. To use multiple entity managers

Using the facade

use RegistryManager;
public function __construct()
{
    parent::__construct();
    $this->_em = RegistryManager::getManager('tracking'); //gets 'tracking' EM
    $this->_em = RegistryManager::getManager(); //gets 'default' EM

    $this->inventoryRepo = $this->_em->getRepository('app\Models\Inventory');
}

Using DI

public function __construct(ManagerRegistry $reg)
{
    parent::__construct();
    $this->_em = $reg->getManager('tracking'); //gets 'tracking' EM
    $this->_em = $reg->getManager(); //gets 'default' EM

    $this->inventoryRepo = $this->_em->getRepository('app\Models\Inventory');
}

Using DoctrineExtensions

DoctrineExtensions is a set of extensions to Doctrine 2 that add support for additional query functions available in MySQL and Oracle. To learn more about what additional functionality is added visit the package's github page.

To use DoctrineExtensions install the package with composer:

composer require beberlei/DoctrineExtensions

Configuring extensions is easy and follows the pattern used by DoctrineExtensions in its own config. In your doctrine config simply add a dql array to every entity manager you want extensions accessible from or add the array to the top-level of your configuration to have it applied to all entity managers.

'dql' => [
    'numeric_functions' => [
        'ROUND' => 'DoctrineExtensions\Query\Mysql\Round',
        'POWER' => 'DoctrineExtensions\Query\Mysql\Power'
        ...
    ],
    'string_functions' => [
        'REPLACE' => 'DoctrineExtensions\Query\Mysql\Replace'
        ...
    ],
    'datetime_functions' => [
        'DATE' => 'DoctrineExtensions\Query\Mysql\Date'
        ...
    ]
]

That's it! Use DoctrineExtensions as you normally would.

New Doctrine Configuration Reference

A complete sample of doctrine configuration taking advantage of all new functionality, with comments.

return [
    'default_connection' => 'default',
    'entity_managers' => [
        'default' => [ //MUST have an entity_managers entry for 'default'
            'connection' => 'rdsConnection',
            'cache_provider' => null,
            'repository' => 'Doctrine\ORM\EntityRepository',
            'logger' => null,
            'metadata' => [
                'simple' => false,
                'driver' => 'yaml', //xml or yaml or annotation (ANNOTATION IS DEFAULT)
                'paths' => [
                    base_path('app/Models/mappings') //all base paths to mapping directories go here
                ],
                'extension' => '.dcm.yml' //extension for mapping files if not using simple driver
            ],
            //Only usable if DoctrineExtensions is installed
            /*'dql' => [
                'numeric_functions' => [
                    'ROUND' => 'DoctrineExtensions\Query\Mysql\Round',
                    'POWER' => 'DoctrineExtensions\Query\Mysql\Power'
                    ...
                ],
                'string_functions' => [
                    'REPLACE' => 'DoctrineExtensions\Query\Mysql\Replace'
                    ...
                ],
                'datetime_functions' => [
                    'DATE' => 'DoctrineExtensions\Query\Mysql\Date'
                    ...
                ]
            ]*/
        ],
        'tracking' => [
            'connection' => 'trackingConnection',
            'cache_provider' => null,
            'repository' => 'Doctrine\ORM\EntityRepository',
            'simple_annotations' => false,
            'logger' => null,
            'metadata' => [
                'simple' => false,
                'driver' => 'annotation'
                //paths is not necessary for annotation
            ],
        ],
    ],
    'proxy' => [
        'auto_generate' => true, //create proxy files automatically (turn off for production)
        'directory' => base_path('storage/proxies'), //store them outside of default directory
        'namespace' => null
    ],
    //'cache_provider' => 'apc',
    //'logger' => new \Doctrine\DBAL\Logging\EchoSQLLogger()
    //'dql' => ...
];

Issues and Contributing

Issues?

If you have issues related to changes made in this forked version please open an issue on this repository.

If your issue is general or related to functionality that exists in the original repo please direct your questions there.

Contributing and Fork Status

This fork is not an official implementation of laravel-doctrine for Laravel 5 so I cannot gaurantee that it will continue to work or or be maintained in the future as Laravel changes, HOWEVER I use it on a daily basis with production code and so will keep it up to date as long as it is relevant for me.

I am happy to accept PRs and any other contributions from the community and will respond in a timely manner. I am open to accepting collaborators as well.

License

This package is licensed under the MIT license.


All versions of laravel-doctrine-forked with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
illuminate/support Version 4.*|5.*
doctrine/orm Version 2.5.*
doctrine/migrations Version 1.*
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 jurosh/laravel-doctrine-forked contains the following files

Loading the files please wait ....