Deprecated: Using ${var} in strings is deprecated, use {$var} instead in

Created on 16 February 2023, almost 2 years ago
Updated 16 September 2024, 3 months ago

Problem/Motivation

Trying Drush updatedb I got a lot of Depreciated PHP Messages
With all Drush commands I got the same errormessages, ending in

In BootstrapHook.php line 36:
    Bootstrap failed. Run your command with -vvv for more information.


Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /Users/martijn/.composer/vendor/consolidation/config/src/Util/ArrayUtil.php on line 78

PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /Users/martijn/.composer/vendor/consolidation/config/src/Util/ArrayUtil.php on line 86

Steps to reproduce

Composer Install Drupal 10
Install Drush (Drush version : 11.5.0 )

Proposed resolution

Alter depreciated vars correct from ${var} to {$var}

Data model changes

Release notes snippet

πŸ’¬ Support request
Status

Closed: works as designed

Version

10.0 ✨

Component
BootstrapΒ  β†’

Last updated 6 days ago

No maintainer
Created by

πŸ‡³πŸ‡±Netherlands Summit

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Summit
  • Status changed to Postponed: needs info almost 2 years ago
  • Consolidation isn’t Drupal code. Drush is a separate project. If you give complete details and follow the prompt to re-run with -vvv perhaps we could help.

    It looks like you are running a global Drush which is not supported.

  • πŸ‡¬πŸ‡§United Kingdom longwave UK

    This was fixed in https://github.com/consolidation/config/pull/56 - you need to upgrade consolidation/config.

  • πŸ‡³πŸ‡±Netherlands Summit

    Hi, how do I upgrade consolidation/config? when I do

    # rm -rf vendor/ web/
    # composer update 
    

    Same errors

    Rerun with -vvv

    Exception trace:
      at htdocs/bizreview/vendor/drush/drush/src/Boot/BootstrapHook.php:36
     Drush\Boot\BootstrapHook->initialize() at htdocs/bizreview/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:44
     Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->doInitializeHook() at htdocs/bizreview/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:36
     Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->callInitializeHook() at htdocs/bizreview/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:29
     Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->initialize() at htdocs/bizreview/vendor/consolidation/annotated-command/src/CommandProcessor.php:145
     Consolidation\AnnotatedCommand\CommandProcessor->initializeHook() at htdocs/bizreview/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:375
     Consolidation\AnnotatedCommand\AnnotatedCommand->initialize() at htdocs/bizreview/vendor/symfony/console/Command/Command.php:278
     Symfony\Component\Console\Command\Command->run() at htdocs/bizreview/vendor/symfony/console/Application.php:1040
     Symfony\Component\Console\Application->doRunCommand() at htdocs/bizreview/vendor/symfony/console/Application.php:314
     Symfony\Component\Console\Application->doRun() at htdocs/bizreview/vendor/symfony/console/Application.php:168
     Symfony\Component\Console\Application->run() at htdocs/bizreview/vendor/drush/drush/src/Runtime/Runtime.php:124
     Drush\Runtime\Runtime->doRun() at htdocs/bizreview/vendor/drush/drush/src/Runtime/Runtime.php:51
     Drush\Runtime\Runtime->run() at htdocs/bizreview/vendor/drush/drush/drush.php:77
     require() at htdocs/bizreview/vendor/drush/drush/drush:4
    

    Thanks in advance!
    Greetings, Martijn

  • πŸ‡¬πŸ‡§United Kingdom longwave UK

    Without seeing your full composer.json file it's impossible to tell - if you are willing to upload that as an attachment we might be able to help further.

  • πŸ‡³πŸ‡±Netherlands Summit

    Hi,
    Changes referred to in https://app.codecov.io/gh/consolidation/config/pull/56 are allready in place in my /vendor/consolidation/config, don't know why it still gives those var errors.

    Attached my composer.json file (saved as odt:). Thanks in advance!
    greetings, Martijn

  • πŸ‡³πŸ‡±Netherlands Summit

    Better to put composer.json in txt. Here attached. Greetings, Martijn

  • πŸ‡³πŸ‡±Netherlands Summit

    Hi,
    I found I had two drushes installed! One on users/[my username].composer and one in MAMP/htdocs/[my drupal project].
    I deleted the one under [my username] and the errors where gone! composer update in [my drupal project], didn't off course renewed the 'old' one under users/[my username].

    Greetings, Martijn

  • πŸ‡³πŸ‡±Netherlands Summit

    And the root cause of drush updatedb not working was because of problems with MAMP and localhost.
    As explained here https://stackoverflow.com/questions/20723803/pdoexception-sqlstatehy000-...

    I needed to alter localhost in settings.php to 127.0.0.1.
    Then I could use drush updatedb correctly.

    The issue that arose here is that "localhost" uses a UNIX socket and can not find the database in the standard directory. However "127.0.0.1" uses TCP (Transmission Control Protocol), which essentially means it runs through the "local internet" on your computer being much more reliable than the UNIX socket in this case
    
  • Status changed to Closed: works as designed almost 2 years ago
  • πŸ‡¬πŸ‡§United Kingdom longwave UK

    Thank you for getting back to us and explaining the solution, this might help if other people run into the same issue.

    As this is not anything we can fix in Drupal core, closing as "works as designed".

  • πŸ‡¬πŸ‡§United Kingdom Drupal Centric

    It looks like you installed/updated drush for the project and not globally. Running ./vendor/bin/drush updatedb would use the version you installed for the project, inside the vendor folder. This caught me out in the past.

  • πŸ‡ͺπŸ‡ΉEthiopia tsega

    Similar to #9, my issue was related to having a compatible Drush version to my Drupal.

    See the Drush install page for details - https://www.drush.org/13.x/install/#drupal-compatibility

Production build 0.71.5 2024