hechoendrupal / drupal-console

The Drupal CLI. A tool to generate boilerplate code, interact with and debug Drupal.
http://drupalconsole.com
GNU General Public License v2.0
939 stars 559 forks source link

self-update: Errors after updating #1049

Closed pjcdawkins closed 8 years ago

pjcdawkins commented 8 years ago

A colleague (@joshmiller83) mentioned a problem after self-update - errors relating to ConsoleTerminateEvent.

upload

I case it helps - I just fixed the same problem in the platform.sh CLI with a rather hacky solution: https://github.com/platformsh/platformsh-cli/blob/7a122d3f3226d5e6ed0a0b74803158c51b31ad5e/src/Command/Self/SelfUpdateCommand.php#L72-L77

Maybe you want to borrow that.

Or, an alternative solution might be trying to re-register the new Composer autoloader - maybe just require 'phar://console.phar/vendor/autoload.php'; would do it.

pjcdawkins commented 8 years ago

Another colleague (@damz) has pointed out that it's more likely to be a phar problem - PHP misreading files that have been swapped out under it - so it can be better solved by replacing the file atomically (temporary file, then rename(), instead of copy()).

jmolivas commented 8 years ago

@pjcdawkins: Thanks for reporting the issue and the tip, I will take a look at this.

jmolivas commented 8 years ago

@pjcdawkins: I did apply your hacky solution at the slef-update command.

itsdarrylnorris commented 8 years ago

This issue seem to be solve at #1118. So I'm closing it.