150 Commits (6a466a120a404d1c5d492e5ca715841c491517fc)

Author SHA1 Message Date
Jordi Boggiano 6a466a120a
Enable strict types on all files 2 years ago
Jordi Boggiano 3cdca37e85
Fix strict type issues 2 years ago
Jordi Boggiano 0db443ba5f
Add visibility to all consts, fixes #10550 2 years ago
Jordi Boggiano 6da38f83a0
Add parameter types to all the things 2 years ago
Alexander Schranz 1321bfca36
Add return types to closures (#9) 2 years ago
Jordi Boggiano eda9014bef
Add return types to all code which is not being extended by open source packages 2 years ago
Jordi Boggiano abdc6893a6
Add void types where no return statement is present 2 years ago
Jordi Boggiano 32852304d0
Make use of some new PHP features 2 years ago
Jordi Boggiano 5c98a2cf8e
Add phpstan-symfony to get type info about console InputInterface, fix many errors (#10476)
Extract common init/require commands functionality into PackageDiscoveryTrait
Extract some helper methods into BaseCommand for better types
2 years ago
Jordi Boggiano bab974575c
Merge branch '2.2' into main 2 years ago
John Stevenson 0228e5b47d
Clean up properly if self-update fails (#10475) 2 years ago
Jordi Boggiano 0b3adc84da
Fix a few phpstan errors and add a php8+ baseline for the rest 2 years ago
Jordi Boggiano 24ce1eddbd
Add composer/pcre dependency and use it everywhere instead of preg_* 2 years ago
Jordi Boggiano 3bb78fd1ee
Make new phar filename random to avoid possible concurrency issues, refs #10252 3 years ago
Jordi Boggiano 6a7264fc2d
Trigger autoloading of a few classes before executing self-update command, fixes #10252 3 years ago
Jordi Boggiano 44b69ba77f
Upgrade php-cs-fixer to 3.x and fix CS 3 years ago
Samuel Felipe 3ccb54832b
PHPStan level 6 in src/Composer/Command (#10214) 3 years ago
Jordi Boggiano 9599eb613b
Type annotations 3 years ago
Jordi Boggiano 3380178798
Introduce a cross-platform safe version of is_readable to support UNC / wsl$ paths on Windows (#9861) 3 years ago
John Stevenson 07f59a9162
Preserve file permissions on Windows self-update (#9733)
Windows file operations result in different file permissions depending
if the file is copied or moved. A copy operation applies permissions
from the destination folder (or file if it already exists and does not
use inheritance), while a move operation generally preserves the source
file permissions.

Windows PHP `rename` uses MoveFileEx so if the user is running as an
admin and the destination is in a common (non-user) location, then the
permission for other users will be replaced by the admin user. Likewise
for the UAC elevation feature, which uses the cmd.exe `move` command.

This fix uses copy and delete operations on Windows, so that other users
can continue to run composer.phar
3 years ago
Jordi Boggiano bad4e4edbc
Fix some more wording 3 years ago
Ali Shaikh 6f5c4fcf3e Improving Composer self-update (version upto date) info message 3 years ago
Jordi Boggiano b7d770659b
CS fixes 4 years ago
Andrés De la Cruz 480a6439fd
Fix phpstan phpdocs issues (#9478) 4 years ago
Jordi Boggiano 9e279740cd
Go go phpstan 🤞 4 years ago
Jordi Boggiano 742c2a9e93
Avoid swallowing exceptions 4 years ago
Jordi Boggiano 35b403b266
Make sure a version not found issue is reported as such for clarity, fixes #9500 4 years ago
Jordi Boggiano 0d236858ec
Merge branch '1.10' 4 years ago
Jordi Boggiano 25496c199d
Update link to composer 2 release notes 4 years ago
Jordi Boggiano 49a28f606c
Merge branch '1.10' 4 years ago
terry.kern 0466add822 Also use channel string for update message
https://github.com/composer/composer/pull/9305#issuecomment-714381153
4 years ago
TerryKern e68b52697b Improve readability of version info message
Instead of:

> You are already using composer version 1.10.15 (1 channel).

it shows:

> You are already using composer version 1.10.15 (1.x channel).
4 years ago
Simon Berger 80d71ccb3f Merged isset, unset and str_replace calls 4 years ago
Simon Berger 80a75e9959 Minor code improvements 4 years ago
Simon Berger bae227ec2d Changed all substr calls used to compare fragments of text to strpos
Some additional code cleanups in those classes

Reverted change causing issues
4 years ago
Jordi Boggiano e5ba99cf67
Merge branch '1.10' 4 years ago
johnstevenson 3be62a9fda Fix openssl_free_key deprecation notice in PHP 8 4 years ago
Jordi Boggiano 2d3905157d
Merge branch '1.10' 4 years ago
Jordi Boggiano 387e828993
Promote next major version when running stable self-update, and prevent self-update from automatically upgrading to the next major release 4 years ago
Jordi Boggiano c3028c02d9
Merge branch '1.10' 4 years ago
johnstevenson 8ddbae358d Remove cygwin php handling in UAC elevation
When called from a native shell and using cygwin PHP, cygpath translates
`/tmp` to `User\AppData\Local\Temp`, rather than `/cygdrive/.../tmp`.
This change does not affect using windows PHP from a Cygwin shell.
4 years ago
Jordi Boggiano 8b934a415f
Merge branch '1.10' 4 years ago
johnstevenson 57f91d01c7
Fix doc comment 4 years ago
johnstevenson 272654d6e2
Fixed spelling mistake 4 years ago
johnstevenson cae913c434
Add Windows UAC elevation to self-update command
If self-update fails on Windows due to file permission issues, a .vbs
script is used to elevate a call to the cmd.exe `move` command.
Unfortunately it is not possible to know if the user cancelled the UAC
prompt using this method - it is possible using a Powershell script, but
flashing hidden windows make this a less desirable option.

The only downside is that a UAC invoked process is asynchronous, so a
300 millisecond timeout is used to allow cmd.exe to do its stuff.
Therefore if the OS is busy the script may finish first and incorrectly
report that the file has not been written.
4 years ago
Jordi Boggiano 86cfbdc541
Merge branch '1.10' 4 years ago
Jordi Boggiano b3dbd95332
Fix PHP <5.6 syntax, fixes #8759, closes #8760 4 years ago
Jordi Boggiano 096b507050
Merge branch '1.10' 4 years ago
Jordi Boggiano f70b3b0152
Avoid warning about --2 usage when no channel is requested 4 years ago
Jordi Boggiano 8e664a37f5
Merge branch '1.10' 4 years ago