Skip to content

[phingcall] Unable to find adapter for datasource #725

Open
ron666 opened this Issue Jul 18, 2013 · 16 comments
@ron666
ron666 commented Jul 18, 2013

When running propel-gen diff, you'll find that the program is complaining about missing adapter to initiate DB connection.

This happens because during that operation, self::configuration is NULL, but I don't know where is the place where is being set during the migration operation.

@ron666
ron666 commented Jul 18, 2013

http://stackoverflow.com/questions/17179364/propel-postgresql-migration-unable-to-find-adapter. He put a fix but it is not the right way to do it, so if you can give us some guidance about where should be the place to look for it would be very helpful

@eelkevdbos

I'm experiencing the same problem. Running with pgsql 9.1 configuration and latest 1.7.*@dev. release of propel. The configuration self::$configuration file at this point returns NULL. I'm about to apply the dirty solution given in the stackoverflow post above, but I'm really eager to find a more satisfying solution. I'm really curious on how it can find the correct database name, but fails to detect the driver from the buildtime-/runtime-configuration file (both identical).

@eelkevdbos

I found out the following: The adapter is supplied in the $conparams argument (method initConnection). Adding the following line to Propel.php solved all my problems. This still might not be the prettiest solution there is, but it most certaily works for me.

Around line 650 in Propel.php:
Change $adapter = self::getDB($name); into $adapter = isset($conparams['adapter']) ? DBAdapter::factory($conparams['adapter']) : self::getDB($name);

@MaksSlesarenko

Is anyone going to fix this issue?

@staabm
Propel member
staabm commented Feb 7, 2014

fix seems to be jh-ism-online-webmaster@846640a, PR with unit test welcome

@django23

+1

@pedrocasado

+1

@marcj marcj added the Bug label Apr 23, 2014
@sabberworm

+1

@tgressly

+1

@malukenho

+1

@kaasdude
kaasdude commented Nov 3, 2014

+1

@tchalvak

+1

@Yoann-TYT

+1

@tdondich

Will this ever be merged into a 1.x release? This really breaks my composer friendly installs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.