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

Declaration of Drush\Sql\Sqlsqlsrv::creds() should be compatible with Drush\Sql\SqlBase::creds() #2967

Closed
kenorb opened this issue Sep 26, 2017 · 4 comments

Comments

@kenorb
Copy link
Contributor

kenorb commented Sep 26, 2017

$ drush sql-connect
Declaration of Drush\Sql\Sqlsqlsrv::creds() should be compatible with Drush\Sql\SqlBase::creds($hide_password = true)           [warning]
Sqlsqlsrv.php:5
$ php --version
PHP 7.2.0beta1 (cli) 
@greg-1-anderson
Copy link
Member

The most important question here is what version of Drush are you using, is it site-local or global Drush, are you running the launcher, etc.

Just tried HEAD of master with a site-local Drush, and it worked fine. From the symptoms, looks like you are mixing versions of Drush.

@kenorb
Copy link
Contributor Author

kenorb commented Sep 27, 2017

It's the PHP 7.x warning about function declaration being not compatible.

So basically:

public function creds()

in SqlSqlsrv.php

should be compatible with:

public function creds($hide_password = true)

defined in SqlBase.php.

See:

$ grep n\ creds\( *
SqlBase.php:    public function creds($hide_password = true)
SqlMysql.php:    public function creds($hide_password = true)
SqlOracle.php:    public function creds()
SqlPgsql.php:    public function creds($hide_password = true)
SqlSqlite.php:    public function creds($hide_password = true)
SqlSqlsrv.php:    public function creds()

Reproducible steps on empty folder (ideally use PHP 7.1, as 7.2 could have more errors, e.g. prefix with DRUSH_PHP=php71):

  1. Install clean Drupal: drush -y qd --no-server
  2. Go to Drupal root: cd quick-drupal-*/drupal
  3. Change db driver to sqlsrv, e.g. by: ex +'%s/sqlite/sqlsrv/g|wq!' sites/default/settings.php
  4. Run drush sql-connect.

You should see the warning in PHP 7.x. Same issue with oracle driver.


$ drush --version
 Drush Version   :  8.1-dev 

@greg-1-anderson
Copy link
Member

Oh, I see. I read the error message too quickly and missed that you were using one of the uncommon database types. Those were community-submitted, and are not heavily tested by Drush maintainers. PRs to fix this are welcome.

@weitzman
Copy link
Member

merged. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants