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.

discailmre: Me no good type Egnlish fsat. yuo muts not cmplian ' bout the garmar. Site powered by Drupal 6