-
Notifications
You must be signed in to change notification settings - Fork 315
Closed
googleapis/google-api-php-client
#2663Description
Environment details
- OS: Mac OS, Linux (alpine, ubuntu and centos)
- PHP version: 7.2 - 8.3
- Package name and version: "google/apiclient": "2.18.2", "google/apiclient-services": "0.396.0"
Steps to reproduce
- Create composer.json like this
{
"require": {
"google/apiclient": "2.18.2",
"google/apiclient-services": "0.396.0"
},
"extra": {
"google/apiclient-services": [
"Gmail"
],
},
"config": {
"process-timeout": 600
},
"scripts": {
"pre-autoload-dump": "Google\\Task\\Composer::cleanup"
}
}- Run composer install 2 times or more
- See that every run the Google\Task\Composer::cleanup removed a few of services instead all ignored.
# First run
$ composer update php
....
> Google\Task\Composer::cleanup
Removing 304 google services
# Second run
$ composer update php
....
> Google\Task\Composer::cleanup
Removing 292 google services
# Third run
$ composer update php
....
> Google\Task\Composer::cleanup
Removing 273 google services
How to fix the problem
We have the code
foreach ($filesToRemove as $fileToRemove) {
$filesystem->remove($fileToRemove);
$filesystem->remove($fileToRemove . '.php');
}I don't know why (any experts here?), but calling remove reduces number of iterations for $filesToRemove
I tried to prepare a list of files to remove and iterate an array. It solved the problem.
I will create pull request shortly.
Thanks!
Metadata
Metadata
Assignees
Labels
No labels