The drop is always movingYou know that saying about standing on the shoulders of giants? Drupal is standing on a huge pile of midgetsAll content management systems suck, Drupal just happens to suck less.Popular open source software is more secure than unpopular open source software, because insecure software becomes unpopular fast. [That doesn't happen for proprietary software.]Drupal makes sandwiches happen.There is a module for that

Dumping my notes on fixing composer #913

Submitted by nk on Fri, 2013-09-20 02:46

ag target-dir
hey look, there's a method called getTargetDir.
In PHPstorm: look up symbol getTargetDir. There's two in classes, one just proxies, so put the breakpoint inside Package::getTargetDir
Run composer, look at the backtrace when reached breakpoint, we are called from LibraryInstaller::install and there's an LibraryInstaller::update as well. Let's drop a breakpoint to the beginning of that.
Let's run the composer update and step. LibraryInstaller::updateCode uses the install path of $initial. Bingo!
How to fix? I guess I should write some pretty iterator based code. Let's Google "php recursive copy iterator", let's copy-paste this Stackoverflow answer, adjust variable names. I wonder what umask Composer uses... ag mkdir so much junk, let's only look at non-test php files, ag -G 'php$' mkdir|grep -v Test, oh hey a Filesystem.php, that looks relevant... oh look, it has a method I needed, looks the same as that code I just copied in. Done!

Commenting on this Story is closed.