Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doctrine orm module error when installing on ZF3 #491

Closed
gulijiyag opened this issue Jul 20, 2016 · 51 comments

Comments

@gulijiyag
Copy link

commented Jul 20, 2016

It seems that Zend Skeleton (I tried to install using this tutorial) updated and now it comes with zend-mvc version 3.0.1, but when I try to install DoctrineORMModule, I get this error:

Using version ^1.0 for doctrine/doctrine-orm-module
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for doctrine/doctrine-orm-module ^1.0 -> satisfiable by doctrine/doctrine-orm-module[1.0.0].
- doctrine/doctrine-orm-module 1.0.0 requires zendframework/zend-mvc ^2.5.2 -> satisfiable by zendframework/zend-mvc[2.5.2, 2.5.3, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.7.0, 2.7.1, 2.7.10, 2.7.2, 2.7.3, 2.7.4, 2.7.5, 2.7.6, 2.7.7, 2.7.8, 2.7.9] but these conflict with your requirements or minimum-stability.

Installation failed, reverting ./composer.json to its original content.

@narekps

This comment has been minimized.

Copy link

commented Jul 20, 2016

#479

@webimpress

This comment has been minimized.

Copy link
Contributor

commented Jul 20, 2016

DoctrineORMModule is not yet fully compatible with ZF3 (zend-mvc v3), only with zend-servicemanager v3. Please have a look on #479.

To me release 1.0.0 has wrong and confusing description:

It is compatible with ZF2 and ZF3

It is not compatible with ZF3 !

@gulijiyag

This comment has been minimized.

Copy link
Author

commented Jul 20, 2016

@webimpress Sorry for my ignorance, how to install that? It's a pull request, not merged yet, right? Thank you in advance.

@webimpress

This comment has been minimized.

Copy link
Contributor

commented Jul 20, 2016

@gulijiyag yes, it's not merged yet.

If you want to test this PR with your new application you can add to your composer.json:

    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/webimpress/DoctrineModule.git"
        },
        {
            "type": "vcs",
            "url": "https://github.com/webimpress/DoctrineORMModule.git"
        }
    ],

and in require section of composer.json:

        "doctrine/doctrine-module": "dev-feature/zf3-support",
        "doctrine/doctrine-orm-module": "dev-feature/zf3-support"

Please notice this is dev version, it could be completely changed. It's required also doctrine/DoctrineModule#564.

It's highly not recommended to use it with production applications.

@gianarb @Ocramius what is the release plan of DoctrineModule and DoctrineORMModule for ZF3?

@gulijiyag

This comment has been minimized.

Copy link
Author

commented Jul 20, 2016

Yes, I think I will rollback to ZF2 in my project and create a new project just to test ZF3 with your pull request.
That has been a lot of work. Really good job. Keep it up.

@olegkrivtsov

This comment has been minimized.

Copy link

commented Jul 22, 2016

When will you support ZF3?

@gulijiyag

This comment has been minimized.

Copy link
Author

commented Jul 22, 2016

I think that @gianarb @Ocramius can answer that.

@heiglandreas

This comment has been minimized.

Copy link

commented Jul 22, 2016

@thoys

This comment has been minimized.

Copy link

commented Aug 1, 2016

Seems to be supported now :) #493

@webimpress

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2016

It is, but not released yet. Please be careful with using dev-master !

@thoys

This comment has been minimized.

Copy link

commented Aug 1, 2016

living on the edge! 😄

@gianarb

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2016

Yes I decided to merge this PR in order to grab feedback and work to make a stable release soon.. Right now dev-master is unstable and unreleased :)

@olegkrivtsov

This comment has been minimized.

Copy link

commented Aug 10, 2016

When do you plan to release the new version of doctrine/doctrine-orm-module package?

@viyirenov

This comment has been minimized.

Copy link

commented Aug 10, 2016

1 similar comment
@ArekMiszcz

This comment has been minimized.

Copy link

commented Aug 10, 2016

@alissondeveloper

This comment has been minimized.

Copy link

commented Aug 11, 2016

When the doctrine is compatible with the ZF3??

it's hard to work with Zend Db!!!

@kokspflanze

This comment has been minimized.

Copy link
Contributor

commented Aug 11, 2016

@alissondeveloper you can add in your composer.json this, until its not released

"doctrine/doctrine-orm-module": "dev-master as 1.0.9",
"doctrine/doctrine-module": "dev-master",
@alissondeveloper

This comment has been minimized.

Copy link

commented Aug 11, 2016

@kokspflanze Thank you friend, I use the dev for now ...

@francisrod01

This comment has been minimized.

Copy link

commented Aug 16, 2016

Until this moment:

~$ composer require doctrine/doctrine-orm-module
Using version ^1.0 for doctrine/doctrine-orm-module
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for doctrine/doctrine-orm-module ^1.0 -> satisfiable by doctrine/doctrine-orm-module[1.0.0].
    - doctrine/doctrine-orm-module 1.0.0 requires zendframework/zend-mvc ^2.5.2 -> satisfiable by zendframework/zend-mvc[2.5.2, 2.5.3, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.7.0, 2.7.1, 2.7.10, 2.7.2, 2.7.3, 2.7.4, 2.7.5, 2.7.6, 2.7.7, 2.7.8, 2.7.9] but these conflict with your requirements or minimum-stability.

But I'm using dev-master for a while but the error log is:

 PHP Fatal error:  Uncaught Zend\\ModuleManager\\Listener\\Exception\\RuntimeException:

 Could not find a valid ServiceManager for FormElementManager in /home/vagrant/projects/web/zf3/zendapp-master/vendor/zendframework/zend-modulemanager/src/Listener/ServiceListener.php:202\nStack trace:\n#0 /home/vagrant/projects/web/zf3/zendapp-master/vendor/zendframework/zend-eventmanager/src/EventManager.php(271): 

Zend\\ModuleManager\\Listener\\ServiceListener->onLoadModulesPost(Object(Zend\\ModuleManager\\ModuleEvent))\n#1 /home/vagrant/projects/web/zf3/zendapp-master/vendor/zendframework/zend-eventmanager/src/EventManager.php(143): 

Zend\\EventManager\\EventManager->triggerListeners(Object(Zend\\ModuleManager\\ModuleEvent))\n#2 /home/vagrant/projects/web/zf3/zendapp-master/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(129):

 Zend\\EventManager\\EventManager->triggerEvent(Object(Zend\\ModuleManager\\ModuleEvent))\n#3 /home/vagrant/projects/web/zf3/zendapp-master/vendor/zendframework/zend-mvc/src/Application.php(264):

 Zend\\ModuleManager\\ModuleManag in /home/vagrant/projects/web/zf3/zendapp-master/vendor/zendframework/zend-modulemanager/src/Listener/ServiceListener.php on line 202, referer: http://projects.dev/zf3/zendapp-master/
@webimpress

This comment has been minimized.

Copy link
Contributor

commented Aug 16, 2016

@devtosystems Do you have enabled Zend\Form module?

@francisrod01

This comment has been minimized.

Copy link

commented Aug 16, 2016

Yes and setted in config/modules.config.php file

@webimpress

This comment has been minimized.

Copy link
Contributor

commented Aug 17, 2016

@devtosystems I've just tried to build ZF3 application with Doctine:
https://github.com/webimpress/zf3-doctrine
All seems to be fine. Let me know if you still have some issues - definitely then I need more information about your modules/configuration etc, base configuration works.

@sathyashrayan

This comment has been minimized.

Copy link

commented Aug 23, 2016

I get this error when I try command line "./doctrine-module -help"

PHP Fatal error: Uncaught Zend\ModuleManager\Exception\MissingDependencyModuleException: Module "DoctrineORMModule" depends on module "DoctrineModule", which was not initialized before it in /var/www/html//vendor/zendframework/zend-modulemanager/src/Listener/ModuleDependencyCheckerListener.php:40
Stack trace:
#0 /var/www/html/
/vendor/zendframework/zend-eventmanager/src/EventManager.php(271): Zend\ModuleManager\Listener\ModuleDependencyCheckerListener->invoke(Object(Zend\ModuleManager\ModuleEvent))
#1 /var/www/html/
/vendor/zendframework/zend-eventmanager/src/EventManager.php(143): Zend\EventManager\EventManager->triggerListeners(Object(Zend\ModuleManager\ModuleEvent))
#2 /var/www/html//vendor/zendframework/zend-modulemanager/src/ModuleManager.php(181): Zend\EventManager\EventManager->triggerEvent(Object(Zend\ModuleManager\ModuleEvent))
#3 /var/www/html/
/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(97): Zend\ModuleManager\ModuleManager->loadModule(Object(DoctrineORMModule\Mo in /var/www/html/__/vendor/zendframework/zend-modulemanager/src/Listener/ModuleDependencyCheckerListener.php on line 40

Fatal error: Uncaught Zend\ModuleManager\Exception\MissingDependencyModuleException: Module "DoctrineORMModule" depends on module "DoctrineModule", which was not initialized before it in /var/www/html//vendor/zendframework/zend-modulemanager/src/Listener/ModuleDependencyCheckerListener.php:40
Stack trace:
#0 /var/www/html/
/vendor/zendframework/zend-eventmanager/src/EventManager.php(271): Zend\ModuleManager\Listener\ModuleDependencyCheckerListener->invoke(Object(Zend\ModuleManager\ModuleEvent))
#1 /var/www/html/
/vendor/zendframework/zend-eventmanager/src/EventManager.php(143): Zend\EventManager\EventManager->triggerListeners(Object(Zend\ModuleManager\ModuleEvent))
#2 /var/www/html//vendor/zendframework/zend-modulemanager/src/ModuleManager.php(181): Zend\EventManager\EventManager->triggerEvent(Object(Zend\ModuleManager\ModuleEvent))
#3 /var/www/html/
/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(97): Zend\ModuleManager\ModuleManager->loadModule(Object(DoctrineORMModule\Mo in /var/www/html/__/vendor/zendframework/zend-modulemanager/src/Listener/ModuleDependencyCheckerListener.php on line 40

@kokspflanze

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2016

@sathyashrayan

did you add DoctrineModule in your application.config.php ?

like at https://github.com/doctrine/DoctrineORMModule#installation written

@sathyashrayan

This comment has been minimized.

Copy link

commented Aug 23, 2016

Hi kokspflanze,
Thanks for your reply..

Yes I did give when its asked during installation. The problem was that the entries in application's module.config.php is stored in reverse order during installation (zf3). So I need to manually change it in the config array.

But now I am facing a new issue in command line

./vendor/bin/doctrine-module -help

is throwing this error

PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1045] Access denied for user 'username'@'localhost' (using password: YES) in /var/www/html//vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43
Stack trace:
#0 /var/www/html/
/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(43): PDO->construct('mysql:host=loca...', 'username', 'password', Array)
#1 /var/www/html/
/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(41): Doctrine\DBAL\Driver\PDOConnection->construct('mysql:host=loca...', 'username', 'password', Array)
#2 /var/www/html/
/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(360): Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'username', 'password', Array)
#3 /var/www/html//vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): Doctrine\DBAL\Connection->connect()
#4 /var/www/html/
/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#5 /var/www/ht in /var/www/html/__/vendor/zendframework/zend-servicemanager/src/ServiceManager.php on line 754

Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1045] Access denied for user 'username'@'localhost' (using password: YES) in /var/www/html//vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43
Stack trace:
#0 /var/www/html/
/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(43): PDO->construct('mysql:host=loca...', 'username', 'password', Array)
#1 /var/www/html/
/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(41): Doctrine\DBAL\Driver\PDOConnection->construct('mysql:host=loca...', 'username', 'password', Array)
#2 /var/www/html/
/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(360): Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'username', 'password', Array)
#3 /var/www/html//vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): Doctrine\DBAL\Connection->connect()
#4 /var/www/html/
/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#5 /var/www/ht in /var/www/html/__/vendor/zendframework/zend-servicemanager/src/ServiceManager.php on line 754

My module config is

1)[site path]/config/autoload/global.php

'doctrine' => [
'connection' => [
// default connection name
'orm_default' => [
'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
'params' => [
'host' => 'localhost',
'port' => '3306',
'user' => 'root',
'password' => '',
'dbname' => 'db',
]
]
]
],

2)module/module_name/config/module.config.php

   'doctrine' => [

    'driver' => [
        'Doctrine_driver' => [
            'class' => AnnotationDriver::class,
            'cache' => 'array',
            'paths' => [
                __DIR__ . '/../../module/Test/src/Entity',
            ],
        ],
        'orm_default' => [
            'drivers' => [
                'Test\\Entity' => 'Doctrine_driver',
            ],
        ],
    ],
],

I am not sure if the issue is from my config or from module..

@gianarb

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2016

Please check in your application.config.php if you add both modules..
DoctrineModule and DoctrineORMModule

Thanks a lot!

@sathyashrayan

This comment has been minimized.

Copy link

commented Aug 23, 2016

@gianarb Yes. I did add the entry of both in [site path]/config/module.config.php as I use zf3 and the application config is in module.config.php

@kokspflanze

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2016

@sathyashrayan looks like your config is wrong, db username/password

Uncaught PDOException: SQLSTATE[HY000] [1045] Access denied for user 'username'@'localhost' (using password: YES)

@sathyashrayan

This comment has been minimized.

Copy link

commented Aug 23, 2016

@kokspflanze thanks for your reply. But the same configuration parameter works for database access with 'db'.

@gianarb

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2016

@sathyashrayan are you trying to connect to mysql from the same local machine/server/vm?
Because it seems really a problem of connection. If your code is running inside a VM you need to check your from inside your VM.

Thanks

@sathyashrayan

This comment has been minimized.

Copy link

commented Aug 23, 2016

@gianarb Thanks for your reply..

I wanted to double check. So I installed a fresh zf3. My system is a personal laptop

My system configuration

Ubundu 16.4.1 LTS
php 7
Apache/2.4.18 (Ubuntu)
Mysql 5
host: localhost

First I gave this command as per in-depth guide

composer create-project -s dev zendframework/skeleton-application .

It asked me several questions according to the in-depth guide. I gave all yes and developer tools configuration in application's another configuration file.

The I changed the composer.json as per above instruction and "composer update".

It asked some questions and The installation went well. When I gave the command in CLI ./vendor/bin/doctrine-module -help
I got a dependency issue. So I need to interchange the order of module array in module.config.php application. The DoctrineModule should come first but the automatic configuration process is storing the DoctrineModule after DoctrineORMModule.

Now I change the [site path]/config/autoload/global.php with the correct database configuration. I still get the error as wrong credentials. I have not created any vhost yet. How come the correct credentials does not work in doctroin? I have used the same config for database access with table gateway and it works.

May be I am missing something basic?

@webimpress

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2016

@sathyashrayan I've notice the wrong order on module list before. I will test it today, and will try to find solution for it.
This is only one issue? Is it working fine when you change the order?

@sathyashrayan

This comment has been minimized.

Copy link

commented Aug 23, 2016

@webimpress Thanks for the concern. If you could test the command line migration tool then that will be fine too. Please take my system env into consideration.

@webimpress

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2016

@sathyashrayan I think I know why you got the same wrong credentials error - doctrine-module script always uses cached configuration, I think it could be done better in this script (edited: I've prepared fix in doctrine/DoctrineModule#572).

If you remove cached configuration in data/cache and try again all should be fine.

You can have a look on my base skeleton ZF3 + Doctrine. All is good there. Command line tools works :)

My installation process was:

composer create-project -s dev zendframework/skeleton-application zf3-doctrine
cd zf3-doctrine
composer update # please read note below
composer require doctrine/doctrine-orm-module:dev-master
# swap `DoctrineModule` and `DoctrineORMModule` in `modules.config.php`
# add doctrine configuration

Edited: composer update above is required because dev-master of doctrine-rom-module and doctrine-module have to high dependency requirements. Fixed in #500 and doctrine/DoctrineModule#571.

Let me know if it works now for you.

@webimpress

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2016

There could be one more issue with ZF3 - please check if you have installed zendframework/zend-mvc-console and enabled module Zend\Mvc\Console. It's required to use command line tools on ZF3, and it is in suggest section in composer.json of DoctrineModule

@sathyashrayan

This comment has been minimized.

Copy link

commented Aug 24, 2016

@webimpress

Thanks a lot for the guide. Yes, when I delete the data/cache files the command line is perfectly working with

./vendor/bin/doctrine-module -help

But I have not tested all the process such as migration and record fetch with orm

I will explain my process so that it's useful for others

My system configuration

Ubundu 16.4.1 LTS
php 7
Apache/2.4.18 (Ubuntu)
Mysql 5
host: localhost

1)Install zf3 skeleton with https://docs.zendframework.com/tutorials/getting-started/skeleton-application/. Its better say yes to all the module including developer tools and Zend\Mvc\Console.

2)Delete all the files in [site path]/data/cache/* Since we will be installing the zend/cache also the configuration will be stored in the cache files. Without this the command line tool such as ./vendor/bin/doctrine-module -help does not works.

3)Add the following in the [site path]/composer.json.

"repositories": [
{
"type": "vcs",
"url": "https://github.com/webimpress/DoctrineModule.git"
},
{
"type": "vcs",
"url": "https://github.com/webimpress/DoctrineORMModule.git"
}
],

and in require section of composer.json:

"doctrine/doctrine-module": "dev-feature/zf3-support",
"doctrine/doctrine-orm-module": "dev-feature/zf3-support"

We could also add through command line

composer require doctrine/doctrine-orm-module:dev-master

but there is a error called "Missing view helper "zendDeveloperToolsTime" This is because of lowercase issue of "Z" as explained in this bugs

#496
ff88569

4)Now give the command as “composer update”. It will ask some questions about installing zend/paginator, DoctrineModule and DoctrineORMModule. Say yes for all and keep the configuration in [site path]/config/modules.config.php by entering 1 in the option.

5)After this you need to swap the order of DoctrineModule and DoctrineORMModule in [site path]/config/modules.config.php or else it will throws error for dependency.

5)Now add the database configuration in [site path]/config/autoload/*.php (either in global.php or local.php. For deciding please cross check the advanced configuration session of docs https://docs.zendframework.com/tutorials/advanced-config/ The config is

'doctrine' => [
'connection' => [
'orm_default' => [
'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
'params' => [
'host' => 'your host (localhost)',
'port' => 'your port',
'user' => 'your user name',
'password' => 'your password',
'dbname' => 'your database',
]
]
]
],

I use mysql so the driver class points to PDO. For your database engine it might change accordingly

6)Now create a directory named Entity in your module such as [site path]/module/your module name/src/Entity

7)Add the following module level config in [site path]/module/your module name/config/module.config.php

use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
use Doctrine\DBAL\Driver\PDOSqlite\Driver;

[other config array such as route,views, service ect]

'doctrine' => [
'driver' => [
NAMESPACE . '_driver' => [
'class' => AnnotationDriver::class,
'cache' => 'array',
'paths' => [
DIR . '/../src/Entity'
],
],
'orm_default' => [
'drivers' => [
NAMESPACE => NAMESPACE . '_driver'
]
]
]
]

Hope this will help anyone who wants to install and test DoctrinORM with zf3.

@MatthiasKuehneEllerhold

This comment has been minimized.

Copy link
Contributor

commented Aug 24, 2016

Instead of using the (deprecated) zend-console you could just use the doctrine-module binary in your vendor/bin directory.

@webimpress

This comment has been minimized.

Copy link
Contributor

commented Aug 24, 2016

@sathyashrayan Please use dev-master from doctrine (for DoctrineModule and DoctrineORMModule modules) instead of zf3-support from my repositories. It's a bit different right now. Of course please remember it is not stable version yet so it's not recommended to use it on production environment!

@viyirenov

This comment has been minimized.

Copy link

commented Aug 24, 2016

@webimpress - Can you tell me the process to install ZF3 apigility skeleton + doctrine?

@webimpress

This comment has been minimized.

Copy link
Contributor

commented Aug 24, 2016

@viyirenov Please have a look on my example repository ZF3 + Apigility + Doctrine:
https://github.com/webimpress/zf3-apigility-doctrine

The installation process is as following:

1. Install Apigility (v1.4) - you can clone repository zf-apigility-skeleton, use apigility installer or use composer create-project.

2. Add doctrine configuration:
a) modify composer.json - add new section:

    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/webimpress/zf-apigility-doctrine"
        },
        {
            "type": "vcs",
            "url": "https://github.com/webimpress/zf-doctrine-hydration-module"
        }
    ],

(these packages are not yet merged, still in development, please don't use it on live environment!).

and in requiredrequired section add:

        "zfcampus/zf-apigility-doctrine": "dev-feature/zf3compat",
        "doctrine/doctrine-module": "dev-master as 1.1",
        "doctrine/doctrine-orm-module": "dev-master",
        "phpro/zf-doctrine-hydration-module": "dev-feature/zf3compat"

b) Run composer update.
Installer will ask you where to add new modules. Please choose modules.config.php for all modules except ZF\Apigility\Doctrine\Admin - this module should be added into development.config.php.dist (and development.config.php if you already have enabled development mode).

c) Ensure you have correct order of modules in modules.config.php and development.config.php.dist (development.config.php), you should have:

In modules.config.php:

return [
    'DoctrineModule',
    'DoctrineORMModule',
    'Phpro\\DoctrineHydrationModule',
    'ZF\\Apigility\\Doctrine\\Server',
    'Zend\\Cache',
    'Zend\\Form',
    'Zend\\Db',
    'Zend\\Filter',
    'Zend\\Hydrator',
    'Zend\\InputFilter',
    'Zend\\Paginator',
    'Zend\\Router',
    'Zend\\Validator',
    'ZF\\Apigility',
    'ZF\\Apigility\\Documentation',
    'ZF\\ApiProblem',
    'ZF\\Configuration',
    'ZF\\OAuth2',
    'ZF\\MvcAuth',
    'ZF\\Hal',
    'ZF\\ContentNegotiation',
    'ZF\\ContentValidation',
    'ZF\\Rest',
    'ZF\\Rpc',
    'ZF\\Versioning',
    'Application',
];

and in development.config.php.dist (development.config.php):

return [
    'modules' => [
        'ZendDeveloperTools',
        'ZF\Apigility\Admin',
        'ZF\Apigility\Doctrine\Admin',
    ],
    // ...
];

d) Add your doctrine configuration.
Please remember to keep passwords and all sensitive data in local configuration files.

3. Enable development mode.
If it was enabled before please disable it and enable again.

Attention!

All doctrine modules are not yet released. Please use it on your own responsibility. It is highly unrecommended to use it on production environment.

Reporting all detected issue will be appreciated.

So far I've noticed following problems:

  • using command line tool doctrine-module create cached configuration files and use it in all calls (resolved in doctrine/DoctrineModule#572, not merged yet);
  • modules order (in modules.config.php) installed with zend-component-installer;
  • generating entities in PSR-4 module (entities are created in wrong directory).
@DennisDobslaf

This comment has been minimized.

Copy link

commented Aug 30, 2016

I'm not sure if this should be another issue, because of the little off-topic discusion above.
But I give it a try:

I'm using the module slm/queue-doctrine wich tries to load ^1.0 of doctrine-orm-module. composer update runs into a not-satisfiable problem in this combination. Don't know how to fix this. I don't want to fork everything.

@webimpress

This comment has been minimized.

Copy link
Contributor

commented Aug 30, 2016

@DennisDobslaf DoctrineORMModule is not yet released with ZF3 support. It is merged to master branch, but it is not tagged. You can use dev-master as 1.1 but please remember it is not recommended to use on production environment.

@olegkrivtsov

This comment has been minimized.

Copy link

commented Aug 31, 2016

How do I run Doctrine migrations console commands in ZF3? Previously, in ZF2, I could do the following:

php index.php migrations:migrate

How is this accomplished now (in ZF3)?

@Estigy

This comment has been minimized.

Copy link

commented Nov 17, 2016

Do you have any news for us on this?
ZF3 has been around now for quite a couple of months.

@MatthiasKuehneEllerhold

This comment has been minimized.

Copy link
Contributor

commented Nov 17, 2016

@olegkrivtsov use vendor/bin/doctrine-module migrations:migrate instead (its usable for all doctrine CLI commands)

@MatthiasKuehneEllerhold

This comment has been minimized.

Copy link
Contributor

commented Nov 17, 2016

@Estigy This composer.json works for me:

{
    ... 
    "require": {
        "doctrine/doctrine-orm-module": "^1.1",
        "zendframework/zend-mvc": "^3.0.2"
    }
    ...
}
@bluebaroncanada

This comment has been minimized.

Copy link

commented Feb 18, 2017

This error leads here from Google even though this isn't for this error.

PHP Fatal error: Uncaught Zend\ModuleManager\Exception\MissingDependencyModuleException: Module "DoctrineORMModule" depends on module "DoctrineModule", which was not initialized before it in /var/www/vendor/zendframework/zend-modulemanager/src/Listener/ModuleDependencyCheckerListener.php:40
Stack trace:
#0 /var/www/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\ModuleManager\Listener\ModuleDependencyCheckerListener->__invoke(Object(Zend\ModuleManager\ModuleEvent))
#1 /var/www/vendor/zendframework/zend-eventmanager/src/EventManager.php(171): Zend\EventManager\EventManager->triggerListeners(Object(Zend\ModuleManager\ModuleEvent))
#2 /var/www/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(181): Zend\EventManager\EventManager->triggerEvent(Object(Zend\ModuleManager\ModuleEvent))
#3 /var/www/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(97): Zend\ModuleManager\ModuleManager->loadModule(Object(DoctrineORMModule\Module))
#4 /var/www/vendor/zendframework/zend-eventmanager/src/Eve in /var/www/vendor/zendframework/zend-modulemanager/src/Listener/ModuleDependencyCheckerListener.php on line 40

Fatal error: Uncaught Zend\ModuleManager\Exception\MissingDependencyModuleException: Module "DoctrineORMModule" depends on module "DoctrineModule", which was not initialized before it in /var/www/vendor/zendframework/zend-modulemanager/src/Listener/ModuleDependencyCheckerListener.php:40
Stack trace:
#0 /var/www/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\ModuleManager\Listener\ModuleDependencyCheckerListener->__invoke(Object(Zend\ModuleManager\ModuleEvent))
#1 /var/www/vendor/zendframework/zend-eventmanager/src/EventManager.php(171): Zend\EventManager\EventManager->triggerListeners(Object(Zend\ModuleManager\ModuleEvent))
#2 /var/www/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(181): Zend\EventManager\EventManager->triggerEvent(Object(Zend\ModuleManager\ModuleEvent))
#3 /var/www/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(97): Zend\ModuleManager\ModuleManager->loadModule(Object(DoctrineORMModule\Module))
#4 /var/www/vendor/zendframework/zend-eventmanager/src/Eve in /var/www/vendor/zendframework/zend-modulemanager/src/Listener/ModuleDependencyCheckerListener.php on line 40

The solution is to flip:

'DoctrineORMModule',
'DoctrineModule',

to

'DoctrineModule',
'DoctrineORMModule',

This is currently an issue ... right now. Fresh install with the skeleton.

@webimpress

This comment has been minimized.

Copy link
Contributor

commented Feb 18, 2017

@bluebaroncanada The problem is resolved with zend-component-installer 0.4. The current version is 0.6 and with this version all should be fine. If you are using version from current ZendSkeletonApplication there is still version 0.3, but you can safely update it to the latest one, and then issue described above should be resolved.

@Ocramius

This comment has been minimized.

Copy link
Member

commented Feb 18, 2017

@webimpress

This comment has been minimized.

Copy link
Contributor

commented Feb 18, 2017

@Ocramius if you are using zend-component-installer <0.4 it is the issue, because DoctrineModule and DoctrineORMModule are installed in wrong order. As I mentioned, with zend-component-installer all is fine, and requiring doctrine modules will install them in correct order in the module list in the configuration.

@bluebaroncanada

This comment has been minimized.

Copy link

commented Feb 18, 2017

@webimpress Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.