Skip to content

Commit

Permalink
Address breaking change introduced in symfony/finder breaking file/…
Browse files Browse the repository at this point in the history
…directory deletion.
  • Loading branch information
codebymikey committed Nov 19, 2022
1 parent 5e671f0 commit 36ee7c5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .lando.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: drupal-libaries-installer
name: drupal-libraries-installer

services:
app: &appserver
Expand Down Expand Up @@ -26,12 +26,12 @@ tooling:
xdebug-on:
description: Enable xdebug.
cmd:
- app: &xdebug_on docker-php-ext-enable xdebug 2>/dev/null && pkill -o -USR2 php-fpm && echo "Enabled xdebug"
- app: &xdebug_on docker-php-ext-enable xdebug 2>/dev/null && /etc/init.d/apache2 reload && echo "Enabled xdebug"
- app2: *xdebug_on
user: root
xdebug-off:
description: Disable xdebug.
cmd:
- app: &xdebug_off rm -rf /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && pkill -o -USR2 php-fpm && echo "Disabled xdebug"
- app: &xdebug_off rm -rf /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && /etc/init.d/apache2 reload && echo "Disabled xdebug"
- app2: *xdebug_off
user: root
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
1.x.x / xxxx-xx-xx
========================
* Address breaking change introduced in `symfony/finder` `^5.4.0 || ^6.0.0` where the `ignoreUnreadableDirs` option no
longer allows you to delete files/directories within the same loop.

See [`commit`](https://github.com/symfony/finder/commit/982b4a1044ec54a2ad55c8001bf66dbdb3e3c4c1).

1.5.0 / 2022-03-01
========================
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"php": ">=7.2.0"
},
"require-dev": {
"composer/composer": "^2.0",
"composer/composer": "^2.4.4",
"mikey179/vfsstream": "^1.6",
"phpunit/phpunit": "^8.5",
"ext-json": "*"
Expand Down
6 changes: 5 additions & 1 deletion example/project/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@
"preferred-install": "source",
"classmap-authoritative": true,
"prepend-autoloader": false,
"optimize-autoloader": true
"optimize-autoloader": true,
"allow-plugins": {
"composer/installers": true,
"zodiacmedia/drupal-libraries-installer": true
}
},
"extra": {
"symlink-root-project": false,
Expand Down
3 changes: 2 additions & 1 deletion src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ function ($file) use ($patterns) {
}
);

foreach ($finder as $file) {
$files = iterator_to_array($finder->getIterator());
foreach ($files as $file) {
$file_pathname = $this->fileSystem->normalizePath($file->getPathname());
$this->io->writeError(" - Removing <info>$file_pathname</info>");
$this->fileSystem->remove($file_pathname);
Expand Down

0 comments on commit 36ee7c5

Please sign in to comment.