-
Notifications
You must be signed in to change notification settings - Fork 67
Issue #56: missing minimal configuration for Zend\Db
#57
Conversation
I added a few lines for people new to the framework to at least have a minimal db configuration to launch the ZF application without errors.
Reformatting the extra instruction
I'm wondering if we need to fix zend-db, actually. The culprit is that we auto-register the (The AdapterAbstractServiceFactory is smarter about this, and does some I'll see if I can track down what might be using the adapter, so we can fix the root cause. |
@DragonBe I can't reproduce the issue when following the instructions in the tutorial. I did the following: $ composer create-project zendframework/skeleton-application test-zend-db I answered all questions according to the tutorial at that point. When done, I did the following: $ cd test-zend-db
$ composer serve and then visited I double-checked my PHP configuration as well: display_errors is enabled, and error_reporting is set to E_ALL. Can you try again, perhaps in a vm or docker image, to see if the issue is present in a fresh install? Also, what version of the skeleton was retrieved when you ran it? |
Just as an experiment, I also threw in the |
Give me bit of time where I'll start a clean start of the project. I had it already a couple of times when migrating old ZF1 apps into a clean structured ZF3 app, but forgot to mention it. Now building our Continuous Delivery dashboard from scratch I decided to report it. I'll get back to this. |
I've recorded a quick screencast where I can reproduce the issue. Let me know if it clarifies things more for you. |
@DragonBe Figured it out: you didn't follow the tutorial directions, which is why I wasn't able to recreate it previously! The issue is the installation of the developer toolbar. The I'm at a quandary at how to address this. If you follow the tutorial exactly (and do not enable the toolbar), everything works as detailed. However, if you do add the toolbar and zend-db, but do not configure a database from the outset, you'll run into issues. I have two ideas for how to resolve this:
Thoughts on which approach you think makes most sense? |
Defines a default adapter using an in-memory SQLite database. This is done to prevent failurs when adding zend-db to an application that retrieves the adapter via the container: ```php $container->get(\Zend\Db\Adapter\AdapterInterface::class) ``` This was observed when adding ZendDeveloperTools to a ZF3 application while also installing zend-db, but without first configuring zend-db. Reported at: zendframework/tutorials#57
@DragonBe I've created a patch against zend-db that will address this; please review zendframework/zend-db#164. |
Sorry @weierophinney, I've been busy all day doing other stuff (and now in the car driving from traffic jam to the next one). If time permits I can review it tonight, but I think tomorrow is a safer bet. Is the installation of the development toolbar separate from the other installations? Guess I missed it and hit "y" on all questions. Sorry for creating confusion. Today I hit the same issue for another project, but also for this project the toolbar is enabled. Thanks for checking though, now I owe you dinner 😃
|
if it related with ZendDeveloperTools, should be fixed by zendframework/zend-developer-tools#218 |
I will close this PR, because:
|
I added a few lines for people new to the framework to at least have a minimal db configuration to launch the ZF application without errors.