10818 Commits (b232ee666313dc4462d1fad4779edda23de7b94e)
 

Author SHA1 Message Date
Jordi Boggiano b232ee6663
Fix test 3 years ago
Jordi Boggiano 8ce0ea300e
Fix pear repo preventing self-update from functioning, fixes #10049 3 years ago
Jordi Boggiano a72784c4da
Merge pull request #10057 from nicholsonjf/docs-double-pipe-note
Note in docs about how single pipes are treated
3 years ago
Jordi Boggiano 5c201687e5
Fix 7zip issues on windows when mixing forward and backslashes, fixes #10058 3 years ago
Jordi Boggiano b7bb7718fb
Merge pull request #10060 from goodjack/update-plugin-api-version-2.1.0
Update the Composer plugin API version to 2.1.0
3 years ago
Jordi Boggiano 91a1a471db
Fix path repo bug causing symlinks to be left behind when uninstalling, fixes #10023 3 years ago
Jordi Boggiano d465df434c
Make sure diagnose command can run without proc_open, refs #9253 3 years ago
Jordi Boggiano 60fe67086e
Make sure proc_open is not required for basic installs, refs #9253 3 years ago
Jordi Boggiano d6f4111f35
Fix php 5.3 support 3 years ago
Jordi Boggiano 46f2d9de48
Fix php 5.3 support 3 years ago
Jordi Boggiano ddd7920d2a
Fix corrupt archives in cache from getting the installs stuck forever, and make sure it fails only once, fixes #10028 3 years ago
Jordi Boggiano e49f24e355
Switch phar signatures to sha512 3 years ago
小克 d9a94b376a
Update the Composer plugin API version to 2.1.0 3 years ago
James Nicholson 2d79f3381b Single pipe note 3 years ago
Jordi Boggiano 4da1a2d43a
Merge pull request #10050 from jrfnl/feature/10037-classmapgenerator-bug-fixes
ClassMapGenerator: fix two bugs (long heredocs + markers in text)
3 years ago
jrfnl 42c6a0d7c5 ClassMapGenerator: fix the regex
By using a look ahead assertion to match "new line - maybe whitespace - marker", the negative performance impact of the `.*` is significantly mitigated and backtracing will be severely limited.

This fixes the bug as reported in 10037.

The bug was discovered due to a PHP 8.1 "passing null to non-nullable" deprecation notice being thrown, but is not a PHP 8.1 bug.

In actual fact, this issue affected all PHP versions and could lead to incomplete classmaps when the code base contained files with huge heredocs/nowdocs.

The regex change (not completely) incidentally also fixes an issue with markers in a heredoc/nowdoc not being correctly handled. This bug could lead to "classes" being added to the class map which aren't actually classes.

Fixes 10037
3 years ago
jrfnl e729c418dd ClassMapGenerator: add test for "marker in text" bug
In PHP < 7.3, the heredoc/nowdoc marker was allowed to occur in the text, as long as it did not occur at the very start of the line.

This was also not handled correctly.

Ref: https://www.php.net/manual/en/migration73.incompatible.php#migration73.incompatible.core.heredoc-nowdoc
3 years ago
jrfnl 9588654ae3 ClassMapGenerator: add tests for "long heredoc" bug
... to proof the existence of the bug and demonstrate the effect.

Note: in the test the backtrack limit is being lowered (and restored back to the default afterwards) to prevent the tests needing ridiculously huge test fixture files.
3 years ago
Stephan c65bd832d6
Url: fix sanitize for new github tokens (#10048) 3 years ago
Juliette c7d11f361c
PHP 8.1: fix more return type deprecation warnings (#10039)
Follow up on 10008 and the various commits made for that.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
3 years ago
Juliette f5a0dfeb50
PHP 8.1: fix deprecation warnings about incorrect default values (#10036)
* PHP 8.1/Tests: fix some deprecation warnings

The default value for the `preg_split()` `$limit` parameter is `-1`, not `null`.

Fixes numerous `preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated` notices when running the test suite.

Ref: https://www.php.net/manual/en/function.preg-split.php

* PHP 8.1/NoProxyPattern: fix deprecation warning

The default value for the `preg_split()` `$limit` parameter is `-1`, not `null`.

Fixes some `preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated` notices when running the test suite.

```
Deprecation triggered by Composer\Test\Util\Http\ProxyManagerTest::testGetProxyForRequest:
preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated

Stack trace:
0 [internal function]: Symfony\Bridge\PhpUnit\DeprecationErrorHandler->handleError(8192, '...', '...', 42)
1 src/Composer/Util/NoProxyPattern.php(42): preg_split('...', '...', NULL, 1)
2 src/Composer/Util/Http/ProxyManager.php(148): Composer\Util\NoProxyPattern->__construct('...')
3 src/Composer/Util/Http/ProxyManager.php(50): Composer\Util\Http\ProxyManager->initProxyData()
4 src/Composer/Util/Http/ProxyManager.php(59): Composer\Util\Http\ProxyManager->__construct()
5 tests/Composer/Test/Util/Http/ProxyManagerTest.php(75): Composer\Util\Http\ProxyManager::getInstance()
...
```

Ref: https://www.php.net/manual/en/function.preg-split.php

* PHP 8.1: fix deprecation warnings / http_build_query()

This fixes all relevant calls to the PHP native `http_build_query()` function.
The second parameter of which is the _optional_ `$numeric_prefix` parameter which expects a `string`.

A parameter being optional, however, does not automatically make it nullable.

As of PHP 8.1, passing `null` to a non-nullable PHP native function will generate a deprecation notice.
In this case, these function calls yielded a `http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated` notice.

Changing the `null` to an empty string fixes this without BC-break.

Fixes a few deprecation warnings found when running the tests.

Refs:
* https://www.php.net/manual/en/function.http-build-query.php
* https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg

* PHP 8.1: fix deprecation notices / PharData::__construct()

This fixes all relevant calls to the PHP native `PharData::__construct()` method.

The second parameter of this method is the _optional_ `$flags` parameter which expects an `int` of flags to be passed to the `Phar` parent class `RecursiveDirectoryIterator`.
Fixed by passing the default value for the `$flags` parameter as per the `RecursiveDirectoryIterator::__construct()` method.

The third parameter of the method is the _optional_ `$alias` parameter which expects an `string`.
Fixed by passing an empty string.

Fixes various notices along the lines of:
```
Deprecation triggered by Composer\Test\Package\Archiver\ArchiveManagerTest::testArchiveTar:
PharData::__construct(): Passing null to parameter #2 ($flags) of type int is deprecated

Stack trace:
0 [internal function]: Symfony\Bridge\PhpUnit\DeprecationErrorHandler->handleError(8192, '...', '...', 55)
1 src/Composer/Package/Archiver/PharArchiver.php(55): PharData->__construct('...', NULL, NULL, 2)
2 src/Composer/Package/Archiver/ArchiveManager.php(193): Composer\Package\Archiver\PharArchiver->archive('...', '...', '...', Array, false)
3 tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php(65): Composer\Package\Archiver\ArchiveManager->archive(Object(Composer\Package\CompletePackage), '...', '...')
...
```

Refs:
* https://www.php.net/manual/en/phardata.construct.php
* https://www.php.net/manual/en/recursivedirectoryiterator.construct.php

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
3 years ago
John Stevenson 93f2e5f8fc
Update to xdebug-handler 2.0.2 (#10047) 3 years ago
Jordi Boggiano df99150db6
Pin versions to avoid new dependencies breaking tests 3 years ago
Jordi Boggiano 2665f1b282
Fix private property access, fixes #10022 3 years ago
Jordi Boggiano 2fb53232d1
Fix usage on symfony 2.x, fixes #10022 3 years ago
Jordi Boggiano bbe3769bcd
Update changelog 3 years ago
Jordi Boggiano deb4c48bbc
Avoid using an invalid path for InstalledFilesystemRepo in create-project and use an array repo instead, fixes #10020, fixes #10021 3 years ago
Jordi Boggiano 1f4401005c
Allow default_socket_timeout to extend the curl timeout if it is longer than 300s, fixes #10018 3 years ago
GeoSot e07d2a7bef
Respect parent setting, handling exceptions (#10017) 3 years ago
Jordi Boggiano a5ee2269ef
Update changelog 3 years ago
Jordi Boggiano 2f83338d2f
Fix hopefully last php 8.1 deprecation warnings 3 years ago
Jordi Boggiano 24f5e54fbe
Fix only/exclude to avoid matching names as sub-strings of full package names, fixes #10001 3 years ago
Jordi Boggiano 29a52ff463
Register ErrorHandler early to catch deprecation notices while the Application is being initialized 3 years ago
Jordi Boggiano 5413faec49
Merge pull request #10016 from tdutrion/patch-1
Highlight the proprietary license trick
3 years ago
Jordi Boggiano 2be03f0d60
More fixes for php8.1 deprecations 3 years ago
Thomas Dutrion 82a7c527f9
Highlight the proprietary license trick
From the Symfony Dev #french slack channel (symfony-devs.slack.com), people look confused regarding the value to use as license for proprietary projects, even though it's written in the documentation.

Because proprietary software is still a massive part of composer's usage, I think it can be interesting to have it as a note, more readable to people.

Extract from the conversation:
> J’étais sur la bonne page, il me manquait deux lignes de scroll pour voir ça -.- On a tous nos petits moments de faiblesse

Which roughly translates to:
> I was looking at the right page, just about two lines above... We all have our weak moments
3 years ago
Jordi Boggiano a7efb27338
More php8.1 deprecation fixes, refs #10008 3 years ago
Jordi Boggiano 47cf602f9e
Fix more PHP 8.1 deprecations, refs #10008 3 years ago
Jordi Boggiano 10ae1d7b08
Fix some PHP 8.1 deprecation warnings, fixes #10008 3 years ago
Jordi Boggiano f5a03b950d
Improve error reporting in require command, fixes invalid case of consistency issue, fixes #10006 3 years ago
Ondrej Mirtes 79093d664b Update PHPStan and remove ignore 3 years ago
Jordi Boggiano 052a455672
Merge pull request #10002 from ondrejmirtes/patch-2
Simplify code
3 years ago
Ondřej Mirtes 58ced29a2a
Simplify code 3 years ago
Jordi Boggiano be58b36a35
Also look up 7zz on linux/macOS, fixes #9951 3 years ago
Jordi Boggiano b602b19f6d
Fix archive command now that zips are extracted async, refs composer/satis#655 3 years ago
Jordi Boggiano db1d9e75be
Fix support for 7z command fallback on linux/macOS, fixes #9994 3 years ago
Jordi Boggiano bacbd15b6b
Fix open_basedir support regession in bfea0f7d1 3 years ago
Jordi Boggiano 5152eeebdc
Merge pull request #9995 from Seldaek/fix_wsl
Fix UNC/WSL-path issues when running in Windows
3 years ago
Jordi Boggiano 005c55185a
Fix support for writing into UNC paths, and comparing UNC paths correctly in InstalledVersions, fixes #9993 3 years ago
Jordi Boggiano cc81f5bac3
Fix support for UNC paths in normalizePath, refs #9993 3 years ago