Skip to content

Fixed notice when baking db config: Undefined variable 'driver'. #255

Closed
wants to merge 1 commit into from

3 participants

@majna
majna commented Oct 18, 2011

It happens when you already have database.php and try to add another config.

@lorenzo
CakePHP member
lorenzo commented Oct 18, 2011

Thanks, will take a closer look at this in a moment before merging.

@majna
majna commented Oct 18, 2011

I've noticed that 'driver' is still used all over DbConfigTask and test, even deprecated:
http://book.cakephp.org/2.0/en/appendices/2-0-migration-guide.html?highlight=migration#connectionmanager

Also there's 'driver' in database.php doc block and even not used in config bellow:

 * driver => The name of a supported driver; valid options are as follows:
 *      Database/Mysql      - MySQL 4 & 5,
 *      Database/Sqlite     - SQLite (PHP5 only),
 *      Database/Postgres   - PostgreSQL 7 and higher,
 *      Database/Sqlserver  - Microsoft SQL Server 2005 and higher
 *
 * You can add custom database drivers (or override existing drivers) by adding the
 * appropriate file to app/Model/Datasource/Database.  Drivers should be named 'MyDriver.php',

And bake asks for driver:

Driver: (Mysql/Postgres/Sqlite/Sqlserver)
[Mysql] >

Can this be just renamed and refactored so 'driver' term is removed for consistency?

@markstory
CakePHP member

It might make sense to rename it to 'datasource'.

@markstory
CakePHP member

@majna Is there a way you could rebase the commit on 2.0? The commit won't cleanly apply anymore.

@majna
majna commented Nov 4, 2011

Ok, I'll rebase this one.

@majna
majna commented Nov 4, 2011

lorenzo committed change 4 days ago in d49096a
I cannot rebase easily now with clear history and just one commit.

Bug is still there, so I'll close this pull and send clean one again.

@majna majna closed this Nov 4, 2011
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.