_drush_sql_get_spec_from_settings tries to require $file unnecessarily. The fact is that the function doesn't even use this parameter, so it should be eliminated, but in the meantime, I've just removed the one line that throws an error when trying to use sql_load

CommentFileSizeAuthor
nofile-sql.drush_.inc_.patch489 bytesbdwelle

Comments

moshe weitzman’s picture

Status: Needs review » Needs work

Insufficient explanation of the change. A require can do many things and you need to explain why none of them are needed. It seems like you don't fully understand what this function is doing (understandable - minimal code comments)

bdwelle’s picture

My point is that _drush_sql_get_spec_from_settings() includes the line

require $file; 

but the function is called without the $file parameter, and therefore the require throws an error.

jonhattan’s picture

Title: _drush_sql_get_spec_from_settings tries to require $file unnecessarily » function _drush_sql_get_spec_from_settings() is not used anymore?
Status: Needs work » Needs review

If there's not some hidden magic around, it seems function `_drush_sql_get_spec_from_settings()` is not used anymore.

$ rgrep drush_sql_get_spec_from_settings *
commands/sql/sql.drush.inc:function _drush_sql_get_spec_from_settings($file, $prefix) {
greg.1.anderson’s picture

Status: Needs review » Fixed

You are correct; removed, tested and committed.

scor’s picture

Status: Fixed » Active

I just upgraded to the latest rc4 which broke a Drush command I wrote a week ago that uses _drush_sql_get_spec_from_settings(). ok, it's a helper function so I shouldn't have used it, but it's quite handy. Where do I go form here? Do I implement my own _drush_sql_get_spec_from_settings() fork, or would you welcome a public function doing the same thing? Or is there a better way of doing this with Drush's current API?

jonhattan’s picture

Status: Active » Fixed

I think you can use _drush_sql_get_db_spec() from commands/sql/sql.drush.inc

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.