Github 上 composer/composer 的最新 issue 回應 https://github.com/composer/composer/issues Github 上 composer/composer 的最新 issue 回應 en-us Re: [RFC] Preloading support https://github.com/composer/composer/issues/7777#issuecomment-565680316 The problem is not preloading everything. The problem is to preload what is<br /> useful and what's not, something that is out of the scope of Composer; a<br /> good preloading list is made by Opcache stats and a memory limit, and has<br /> to be manually injected into php.ini.<br /> <br /> For that purpose alone I created a package that checks your most requested<br /> files and creates a list containing these first in descending order.<br /> <br /> Preloading all files is an irresponsibility when you consider that, after<br /> certain point, adding more files to the preload list will have marginal<br /> returns in performance.<br /> <br /> El vie., 13 de dic. de 2019 23:53, kapitanluffy <notifications@github.com><br /> escribió:<br /> <br /> > I think the problem here is we are trying to preload everything.<br /> ><br /> > What if package developers can declare classes/files that needs to be<br /> > cached in the composer.json.<br /> ><br /> > {<br /> > "preload": [<br /> > "/package/AbstractClassInterface.php",<br /> > "/package/AbstractClass.php",<br /> > "/package/helpers.php",<br /> > ]<br /> > }<br /> ><br /> > Package developers are responsible for these files. They should not have<br /> > dependencies (or at least include it in preloading). Composer will detect<br /> > these declared files and automatically create a preload script which we can<br /> > optionally use.<br /> ><br /> > —<br /> > You are receiving this because you were mentioned.<br /> > Reply to this email directly, view it on GitHub<br /> > <https://github.com/composer/composer/issues/7777?email_source=notifications&email_token=ABHHLF6ZSVZNW3DN6N4NYOLQYRDAXA5CNFSM4GCIOG4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG3YFOY#issuecomment-565674683>,<br /> > or unsubscribe<br /> > <https://github.com/notifications/unsubscribe-auth/ABHHLF2GLDG5CBQ7NGUQRK3QYRDAXANCNFSM4GCIOG4A><br /> > .<br /> ><br /> https://github.com/composer/composer/issues/7777#issuecomment-565680316 Sat, 14 Dec 2019 12:08:10 +0800 Re: [RFC] Preloading support https://github.com/composer/composer/issues/7777#issuecomment-565674683 I think the problem here is we are trying to preload everything. <br /> <br /> What if we give the responsibility to package developers instead? They can declare classes/files that needs to be cached in the composer.json.<br /> ```<br /> {<br /> "preload": [<br /> "/package/AbstractClassInterface.php",<br /> "/package/AbstractClass.php",<br /> "/package/helpers.php",<br /> ]<br /> }<br /> ```<br /> Package developers are responsible for these files. They should not have dependencies (or at least include it in preloading). Composer will detect these declared files and automatically create a preload script which we can optionally use. https://github.com/composer/composer/issues/7777#issuecomment-565674683 Sat, 14 Dec 2019 10:52:49 +0800 Re: Can't install anything, man-in-the-middle attack warning https://github.com/composer/composer/issues/2835#issuecomment-565636070 I had this problem recently when switching to a new laptop.<br /> <br /> Fixed it by deleting vendor, cache and re-installing (I think) https://github.com/composer/composer/issues/2835#issuecomment-565636070 Sat, 14 Dec 2019 06:40:19 +0800 Re: The composer installer is returning a console exit code 1 breaking the docker image building https://github.com/composer/composer/issues/8479#issuecomment-565623955 Thanks @Seldaek and @alcohol.<br /> <br /> For a whilwe, I replaced the lines:<br /> ```<br /> RUN curl -s https://getcomposer.org/installer | php<br /> RUN mv composer.phar /usr/local/bin/composer<br /> ```<br /> To:<br /> ```<br /> RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"<br /> RUN php composer-setup.php --install-dir=/usr/local/bin --version=1.9.1 --filename=composer && php -r "unlink('composer-setup.php');" || php -r "unlink('composer-setup.php');"<br /> ```<br /> And it works. But I think that the setup must returns a exit status 0 when success.<br /> <br /> As this image running on a CI test, I need to force a composer version and not to validate the setup installation signature to the test to works allways.<br /> <br /> Thank you for the recommendation of multi-stage but is not possible on my case. https://github.com/composer/composer/issues/8479#issuecomment-565623955 Sat, 14 Dec 2019 05:59:16 +0800 Re: `composer global exec` does not seem to run commands in the current directory https://github.com/composer/composer/issues/8481#issuecomment-565488484 Thanks, I'll look into it. 👍 https://github.com/composer/composer/issues/8481#issuecomment-565488484 Fri, 13 Dec 2019 23:41:18 +0800 Re: `composer global exec` does not seem to run commands in the current directory https://github.com/composer/composer/issues/8481#issuecomment-565486679 Perhaps there is a way to store on the Application that we had a previous workdir which has been changed, so exec command can read that if it's there.. kinda nasty hack but would work. Anyway if you feel like experimenting and sending a PR, I'd say why not if it's a reasonable solution. https://github.com/composer/composer/issues/8481#issuecomment-565486679 Fri, 13 Dec 2019 23:37:14 +0800 Re: `composer global exec` does not seem to run commands in the current directory https://github.com/composer/composer/issues/8481#issuecomment-565486394 I'd get bin-dir instead of home, that's more portable, but anyway yes.. I really can't tell what the possible use cases would be. I tend to agree with you it's most likely more useful to run things in the local dir. I am not sure how to implement this though, as the global command runs a chdir then calls the command you pass it, but it does this in a very oblivious way. https://github.com/composer/composer/issues/8481#issuecomment-565486394 Fri, 13 Dec 2019 23:36:23 +0800 Re: `composer global exec` does not seem to run commands in the current directory https://github.com/composer/composer/issues/8481#issuecomment-565484522 Is there any use case to running the binaries from `exec` in the global directory regardless of the user's current working directory? I understand that's the behavior of `composer global` for other commands but it seems strange for `exec`.<br /> <br /> Adding the global bin directory to the `PATH` is a fine solution if I'm only concerned with my environment, but I want to make sure some scripts I'm writing can run in anyone's environment once composer and the required packages are installed.<br /> <br /> Currently I can work around it like this, but it seems weird when there's a nice `exec` command I could be using.<br /> <br /> ```sh<br /> COMPOSER_GLOBAL_ROOT=$(composer global config -q home)<br /> PHPCBF="$COMPOSER_GLOBAL_ROOT/vendor/bin/phpcbf"<br /> PHPCS="$COMPOSER_GLOBAL_ROOT/vendor/bin/phpcs"<br /> ``` https://github.com/composer/composer/issues/8481#issuecomment-565484522 Fri, 13 Dec 2019 23:32:01 +0800 Re: `composer global exec` does not seem to run commands in the current directory https://github.com/composer/composer/issues/8481#issuecomment-565480659 This is a tricky one, because `composer global` indeed does change the working directory (as the first line of output indicates). So if you are trying to run exec in the global dir, you wouldn't want this "problem" fixed. But in your case it's indeed a problem. <br /> <br /> I'd say the better approach though for you, if you want to set up global utils, is to make sure you add the global bin-dir to your PATH, so you can directly execute `phpcs` anywhere. That's much more useful.. https://github.com/composer/composer/issues/8481#issuecomment-565480659 Fri, 13 Dec 2019 23:22:22 +0800 Re: `composer update` does not update local repository paths in composer.lock https://github.com/composer/composer/issues/8473#issuecomment-565479478 Might/should be fixed by existing changes in 2.0 branch, if not we'll have to address it then, but not worth fixing for v1 anymore. https://github.com/composer/composer/issues/8473#issuecomment-565479478 Fri, 13 Dec 2019 23:19:21 +0800 Re: Enhancement: Configure paths and autoload files via phpstan/config.neon https://github.com/composer/composer/pull/8476#issuecomment-565477362 Thank you, @adaamz and @Seldaek! https://github.com/composer/composer/pull/8476#issuecomment-565477362 Fri, 13 Dec 2019 23:13:58 +0800 Re: Doc - Sorted By alphabetical command name https://github.com/composer/composer/issues/8478#issuecomment-565476271 I think better than a simple alphabetical sort, for the commands, config and schema pages, would be to create sub-groups with meaningful names because one long flat list is anyway hard to digest, alphabetical helps if you know what you are looking for, but if you're just poking around groups + meaningful sorting would make more sense IMO. <br /> <br /> e.g. in config, all these are autoloader related, but would not sort together if sorted alphabetically, which would make it even more confusing I think:<br /> <br /> prepend-autoloader<br /> autoloader-suffix<br /> optimize-autoloader<br /> classmap-authoritative<br /> apcu-autoloader<br /> https://github.com/composer/composer/issues/8478#issuecomment-565476271 Fri, 13 Dec 2019 23:11:01 +0800 Re: OpenShift Assembly / Composer / file could not be downloaded SSL Connection reset by peer https://github.com/composer/composer/issues/8480#issuecomment-565441178 Hello,<br /> <br /> My problem was corrected in <br /> <br /> https://github.com/composer/getcomposer.org/commit/0659b45afd64e9fcda2fcc620762e23de326acbd<br /> <br /> Thank you ! https://github.com/composer/composer/issues/8480#issuecomment-565441178 Fri, 13 Dec 2019 21:28:54 +0800 Re: Rewrite NoProxyPattern to include IPv6 https://github.com/composer/composer/pull/8458#issuecomment-565402959 Thanks for doing the research and porting the curl stuff over. I think it's fine to target 1.10 and see how it goes. The BC breaks sound reasonable. https://github.com/composer/composer/pull/8458#issuecomment-565402959 Fri, 13 Dec 2019 19:11:45 +0800 Re: [WIP] Add funding field to composer.json and composer fund command https://github.com/composer/composer/pull/8453#issuecomment-565402405 I suggest waiting, especially given this is only about a 2 lines in the output, not about a list which could get very long. https://github.com/composer/composer/pull/8453#issuecomment-565402405 Fri, 13 Dec 2019 19:09:48 +0800 Re: PHP Warning: require(Composer/autoload.php): failed to open stream https://github.com/composer/composer/issues/5510#issuecomment-565327676 > All I had to do in a similar situation was to add `/usr/share/php` to my `/etc/php/7.2/cli/php.ini` `include_path`.<br /> > <br /> > I figured out the path by executing this command: `dpkg -L composer` - it became obvious that the needed files are in that `/usr/share/php` directory.<br /> <br /> This works perfectly https://github.com/composer/composer/issues/5510#issuecomment-565327676 Fri, 13 Dec 2019 15:05:31 +0800 Re: OpenShift Assembly / Composer / file could not be downloaded SSL Connection reset by peer https://github.com/composer/composer/issues/8480#issuecomment-565029072 Looks like your builder does not have a proper openssl/certificates setup. https://github.com/composer/composer/issues/8480#issuecomment-565029072 Thu, 12 Dec 2019 22:28:37 +0800 Re: The composer installer is returning a console exit code 1 breaking the docker image building https://github.com/composer/composer/issues/8479#issuecomment-565028264 I recommend using multi-stage builds as described on https://hub.docker.com/_/composer and simply running<br /> <br /> ```<br /> COPY --from=composer /bin/usr/composer /bin/usr/composer<br /> ``` https://github.com/composer/composer/issues/8479#issuecomment-565028264 Thu, 12 Dec 2019 22:26:32 +0800 Re: --no-dev should ignore require-dev (or add new option) https://github.com/composer/composer/issues/8474#issuecomment-565026945 Please search our issue list, this behaviour is not changing for reasons already mentioned. https://github.com/composer/composer/issues/8474#issuecomment-565026945 Thu, 12 Dec 2019 22:23:07 +0800 Re: OpenShift Assembly / Composer / file could not be downloaded SSL Connection reset by peer https://github.com/composer/composer/issues/8480#issuecomment-564973336 During assembly S2I under openshift. <br /> From a Docker image to an S2I image (source to image). https://github.com/composer/composer/issues/8480#issuecomment-564973336 Thu, 12 Dec 2019 19:44:30 +0800 Re: OpenShift Assembly / Composer / file could not be downloaded SSL Connection reset by peer https://github.com/composer/composer/issues/8480#issuecomment-564970709 Which image build are you talking about ? https://github.com/composer/composer/issues/8480#issuecomment-564970709 Thu, 12 Dec 2019 19:35:48 +0800 Re: New composer install behind proxy https://github.com/composer/composer/issues/4919#issuecomment-564643642 Workaround when behind corporate proxy: <br /> <br /> unset **no_proxy** and **NO_PROXY** environment variables before executing `installer` with `php`<br /> <br /> ```<br /> unset no_proxy NO_PROXY<br /> curl -s https://getcomposer.org/installer | php<br /> ```<br /> <br /> The following code in `installer` removes the proxy by mistake:<br /> <br /> ```<br /> // Remove proxy if URL matches no_proxy directive<br /> if (!empty($_SERVER['NO_PROXY']) || !empty($_SERVER['no_proxy']) && parse_url($url, PHP_URL_HOST)) {<br /> $pattern = new NoProxyPattern(!empty($_SERVER['no_proxy']) ? $_SERVER['no_proxy'] : $_SERVER['NO_PROXY']);<br /> if ($pattern->test($url)) {<br /> unset($proxy);<br /> }<br /> }<br /> <br /> ``` https://github.com/composer/composer/issues/4919#issuecomment-564643642 Thu, 12 Dec 2019 01:14:11 +0800 Re: URL to download the latest stable version https://github.com/composer/composer/issues/6409#issuecomment-564614530 https://getcomposer.org/composer-stable.phar is now available <br /> https://github.com/composer/composer/issues/6409#issuecomment-564614530 Thu, 12 Dec 2019 00:08:02 +0800 Re: Composer hangs in "Something's changed, looking at all rules again" state https://github.com/composer/composer/issues/7665#issuecomment-564588347 I finally fixed it by doing a lot "composer who" and trial and error until I ended up removing all packages using this dependency, finally being able to remove this line `"symfony/event-dispatcher": "3.4.0 as 2.8.47"` and adding the dependencies back.<br /> <br /> If there is no way to resolve this situation, then composer should break at least after X iterations and throw a meaningful exception. Like "Sorry, can't resolve the dependency graph properly" or something similar. https://github.com/composer/composer/issues/7665#issuecomment-564588347 Wed, 11 Dec 2019 23:09:23 +0800 Re: The composer installer is returning a console exit code 1 breaking the docker image building https://github.com/composer/composer/issues/8479#issuecomment-564574301 I can't repro this out of Docker, so it seems to be environment driven.. And you or someone else with more patience will have to dig in and figure it out.<br /> <br /> In the meantime a workaround you could try is to do this instead of the install + mv `RUN curl -s https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/composer`<br /> <br /> Maybe it fixes it, in case the weird `//composer.phar` is the issue. But as far as I can tell from the code if it prints successfully installed it should exit with 0. https://github.com/composer/composer/issues/8479#issuecomment-564574301 Wed, 11 Dec 2019 22:39:52 +0800 Re: "Failed to decode zlib stream" when install https://github.com/composer/composer/issues/4619#issuecomment-564504116 https://github.com/composer/composer/issues/4619#issuecomment-309631946<br /> <br /> thanks this works https://github.com/composer/composer/issues/4619#issuecomment-564504116 Wed, 11 Dec 2019 19:43:50 +0800 Re: Composer won't accept valid responses to user prompt https://github.com/composer/composer/issues/8365#issuecomment-564466105 Unfortunately we need a consistently reproducible scenario in order to actually debug any issues. Without this, there are simply too many factors to take into consideration that can effect the input/output processes and final outcome. https://github.com/composer/composer/issues/8365#issuecomment-564466105 Wed, 11 Dec 2019 17:56:31 +0800 Re: VersionGuesser not playing well with monorepositories https://github.com/composer/composer/issues/8477#issuecomment-564425022 maybe the `self.version` check should only be on the requirements and not on everything like the provides? https://github.com/composer/composer/issues/8477#issuecomment-564425022 Wed, 11 Dec 2019 16:03:16 +0800 Re: Composer won't accept valid responses to user prompt https://github.com/composer/composer/issues/8365#issuecomment-564283344 >We maintain the root image from which the binary is copied, yes.<br /> <br /> So that sounds like the issue being raised will be happening from the root image, since it's been reproducible between two different versions of Composer, and two different sources.<br /> <br /> >`Hooks\ComposerHooks::postPackageInstall` does not look something that belongs to Composer itself though.<br /> <br /> Thank you for pointing that out, but please note that's just a hook that's called _after_ the issue I'm raising. I'm not raising anything about the hook(s). This is shown within the output above to show the script has successfully carried on to the next process. https://github.com/composer/composer/issues/8365#issuecomment-564283344 Wed, 11 Dec 2019 06:13:22 +0800 Re: updated phpstan to 0.12 https://github.com/composer/composer/pull/8471#issuecomment-564269614 I added custom rule which checks for using $this inside closures, pls check it out. https://github.com/composer/composer/pull/8471#issuecomment-564269614 Wed, 11 Dec 2019 05:36:16 +0800