1
0
Fork 0
Commit Graph

392 Commits (978037fbfad71ff9da87f3baaa86e350a62af175)

Author SHA1 Message Date
Jordi Boggiano f509c41280
Upgrade PHPStan to 1.0 (#10253)
Co-authored-by: Martin Herndl <martin@herndl.org>
2021-11-14 20:42:24 +01:00
Jordi Boggiano bd4d624cc7
Read first from $_SERVER and $_ENV before using getenv (#10218) 2021-11-09 16:31:27 +01:00
Jordi Boggiano 28c34128ee
Fix php proxies to resolve __FILE__ and __DIR__ using realpath on PHP <8, fixes #10261 2021-11-08 15:03:05 +01:00
Jordi Boggiano 90087b4fb3
Fix handling of php bin proxies combined with declare() on php <8, fixes #10246 (#10249) 2021-11-02 11:36:31 +01:00
Jordi Boggiano 3f243d37c3
Add temporary metadata for download size tracking 2021-10-29 22:19:38 +02:00
Jordi Boggiano c65d09dff7
Fix @inheritDoc annotations 2021-10-27 16:18:53 +02:00
Jordi Boggiano df6c2ce1db
Simplify php bin proxies further 2021-10-27 11:24:50 +02:00
Jordi Boggiano e1dbd65aff
Fix bin proxies to use output buffering instead of the eval hack, as the __FILE__ and __DIR__ replacement is not safe when done in strings/nowdocs/.. 2021-10-27 11:16:34 +02:00
Paolo Rossi a921d9b233
Reaching phpstan level 6 in EventDispatcher Exception and Installer folders (#10192) 2021-10-25 10:44:29 +02:00
Jordi Boggiano d1c8a4d1b4
Lots of typing improvements 2021-10-12 22:47:23 +02:00
Jordi Boggiano 4bcd860b65
Add more type annotations 2021-09-05 17:34:12 +02:00
Jordi Boggiano 01d734125c
Add more type info 2021-08-30 17:45:35 +02:00
Andreas Schempp 0bed60e631 Correctly resolve promises when package type changes 2021-08-25 22:35:34 +02:00
Jordi Boggiano d3c176ec69
PHPStan Level 5 (#10070)
* Bump PHPStan to level 5

* Update seld/phar-utils to latest

* Add phpstan-setup / phpstan scripts
2021-08-21 17:41:52 +02:00
Jordi Boggiano bf3713072c
Fix source binaries not being made executable when symlinks cannot be used, fixes #9961 2021-06-09 16:25:16 +02:00
Sebastian Blank a9031e40eb
Add "symlink" option for "bin-compat" config (#9959) 2021-06-09 11:33:44 +02:00
Jordi Boggiano 4c9e75c6e5
Fix CS 2021-06-03 10:38:38 +02:00
Jordi Boggiano 6f255d1230
Merge branch '2.0' 2021-05-21 17:03:16 +02:00
Jordi Boggiano 8874ca0e5a
Fix regression introduced in dd54f295fe 2021-05-21 16:58:34 +02:00
Jordi Boggiano 991985792d
Merge branch '2.0' 2021-05-20 14:16:52 +02:00
Jordi Boggiano 8427b6c8ed
Also make sure filesystem is up to date before generating binary links, refs #9627 2021-05-20 13:27:20 +02:00
Jordi Boggiano 5bf614a762
Merge branch '2.0' 2021-05-17 22:35:56 +02:00
Jordi Boggiano dd54f295fe
Fix progress output, and remove progress bar on CI env, fixes #9621, closes #9880 2021-05-17 22:34:32 +02:00
Jordi Boggiano 3380178798
Introduce a cross-platform safe version of is_readable to support UNC / wsl$ paths on Windows (#9861) 2021-05-04 13:25:52 +02:00
Markus Staab bfea0f7d1e
BinaryInstaller: install full binaries on WSL when bin-compat=auto (#9855) 2021-05-02 16:50:42 +02:00
Jordi Boggiano bf73a20bc0
Merge branch '2.0' 2021-03-16 20:31:44 +01:00
Jordi Boggiano 3b89a9c3b4
Also attempt working around Vagrant filesystem issues when installing plugins initially, refs #9627 2021-03-16 20:31:18 +01:00
Brandon Kelly 7652408829
Only call sapi_windows_set_ctrl_handler() for CLI requests (#9771) 2021-03-12 00:18:41 +01:00
Jordi Boggiano b40b93bc7d
Merge branch '2.0' 2021-03-10 10:46:34 +01:00
Jordi Boggiano 414586ba05
Attempt working around Vagrant filesystem issues, added COMPOSER_RUNTIME_ENV env var (set to vagrant), fixes #9627 2021-03-10 10:45:40 +01:00
Jordi Boggiano 4940009f83
Bump phpstan to level 3 (#9734)
Clean up PackageInterface/CompletePackageInterface, add missing methods, type things in solver as BasePackage, added CompleteAliasPackage, ..
2021-03-09 15:49:40 +01:00
Jordi Boggiano 8392508e23
Merge branch '2.0' 2021-03-09 15:29:19 +01:00
Jordi Boggiano 4bedd8379a
Fix php-proxying of binaries to avoid proxying phar files, fixes #9742 2021-03-09 14:12:32 +01:00
Jordi Boggiano 40800df6bd
Fix CS 2021-02-25 13:46:52 +01:00
Jordi Boggiano b3b0cf629e
Generate binary proxy in PHP if the target binary is detected as a PHP script, so custom PHP processes can be used to call them via the bin proxy path, fixes #9325 2021-02-23 11:07:25 +01:00
Jordi Boggiano f7e8f7625f
Remove plugin installer hackery 2021-02-17 23:21:18 +01:00
Jordi Boggiano cf324ee664
Make sure the plugins can use InstalledVersions to introspect themselves when being activated right after initial install 2021-02-12 11:18:04 +01:00
Jordi Boggiano 78d7792eb8
Fix handling of promises for uninstall step when updating to a different install source 2021-02-10 10:48:07 +01:00
Jordi Boggiano b7d770659b
CS fixes 2020-11-22 14:52:39 +01:00
Andrés De la Cruz 480a6439fd
Fix phpstan phpdocs issues (#9478) 2020-11-20 09:28:09 +01:00
Jordi Boggiano 4ac6f57d18
Add debug output when SIGINT is received 2020-11-16 22:42:21 +01:00
Jordi Boggiano b0d308319e
Extract POST_PACKAGE_* events to be executed all at once and not in parallel with async code to avoid edge cases, fixes #9463 2020-11-12 15:14:02 +01:00
Jordi Boggiano c04c42b7b4
Merge branch '1.10' 2020-11-05 16:37:59 +01:00
Jordi Boggiano 444b91a3ce
Add docs, refs #9422 2020-11-05 16:37:51 +01:00
Jordi Boggiano 881ec8c751
Use httpdownloader/curl to process install notifications 2020-10-27 13:50:03 +01:00
Jordi Boggiano 2d4e1e0dce
Make sure Transaction sorts operations correctly to begin with 2020-10-25 14:06:45 +01:00
Jordi Boggiano dc88236c07
Make sure operations are executed in batches, including downloads, when a plugin is present which modifies downloads, fixes #9333 2020-10-25 13:49:31 +01:00
Simon Berger a6475a7118 Removed unused variables, properties and parameters of private functions 2020-09-20 02:16:28 +02:00
Simon Berger 002fd39bc6 Removed passing of parameters with default value 2020-09-20 02:16:28 +02:00
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
2020-09-07 21:08:34 +02:00
Jordi Boggiano f18d91bd58
Fix pre/post-package-install/update/uninstall events receiving a partial list of operations, fixes #9079 2020-08-27 11:25:43 +02:00
Jordi Boggiano 83c64a9d19
Reuse operation formatting logic in downloaders 2020-06-17 12:33:02 +02:00
Jordi Boggiano aea074308c
Update batching to install plugin deps before the plugin (alone an own batch) 2020-06-16 14:07:30 +02:00
Jordi Boggiano 085fe4e7e5
Add --no-progress support and a few more fixes 2020-06-16 14:00:24 +02:00
Jordi Boggiano 87a0fc5506
Execute operations in batches to make sure plugins install in the expected order 2020-06-16 14:00:22 +02:00
Jordi Boggiano 9f380d606c
Add basic progress bar capability while waiting for jobs to complete 2020-06-16 14:00:22 +02:00
Jordi Boggiano 8f6e82f562
Add support for aborting running promises cleanly 2020-06-16 14:00:20 +02:00
Jordi Boggiano a4a617abb4
Reduce amount of Filesystem/ProcessExecutor instantiations, add lots of docblocks 2020-06-04 16:08:23 +02:00
Jordi Boggiano 5761228068
Make installer classes forward promises from downloaders to InstallationManager 2020-06-04 10:34:16 +02:00
Jordi Boggiano 816d8e9d1b
Fix phpstan error 2020-06-03 15:41:47 +02:00
Jordi Boggiano 396ad87fd0
Add handling of ctrl-C on windows for php 7.4+ 2020-06-03 15:18:27 +02:00
Jordi Boggiano a07f9ffba9
Catch SIGINT/Ctrl+C during installs and run cleanups on all packages before exiting 2020-05-22 13:24:30 +02:00
Jordi Boggiano cdc6a87e8d
Fix docblock 2020-04-23 11:01:44 +02:00
Jordi Boggiano 9b8694bc0b
Show suggestions from root package in suggest, and lists them in count only on first install of a project, fixes #8805 2020-04-23 10:53:24 +02:00
Jordi Boggiano fa14cd1353
Show number of additional suggestions when not using --all, fixes #8788 2020-04-23 10:23:56 +02:00
Jordi Boggiano 0d1922dc27
Add a Composer\Versions class which is available in all projects at runtime to query installed packages/versions 2020-04-22 12:10:09 +02:00
Jordi Boggiano 44a4429978
Remove PEAR installer/downloader/repos/..., fixes #8778 2020-04-15 00:24:13 +02:00
Ayesh Karunaratne fdb35a6a06
Fix \Composer\Installer\PackageEvent::__construct() and \Composer\Repository\ComposerRepository::isVersionAcceptable() required arguments used after optional, which is deprecated in PHP 8.0
1. `Deprecated: Required parameter $name follows optional parameter $constraint in src\Composer\Repository\ComposerRepository.php on line 745`

2. `Deprecated: Required parameter $operation follows optional parameter $operations in src\Composer\Installer\PackageEvent.php on line 73`

Optional parameters with a type declared, and a default value of `null` is excepted from this deprecation. See https://php.watch/versions/8.0/deprecate-required-param-after-optional. This is the case in `ComposerRepository::isVersionAcceptable`, which still has two optional parameters as first two parameters, but this will not raise a deprecation notice.
2020-04-13 07:12:35 +07:00
Jordi Boggiano e34a2a9f45
Remove unused used vars 2020-04-09 11:23:25 +02:00
Jordi Boggiano 8b0da77a1d
Make sure cleanup is called for every package in case any operation fails to execute 2020-04-09 10:48:48 +02:00
Jordi Boggiano a8eec36931
Merge branch '1.10' 2020-04-07 16:00:11 +02:00
Jordi Boggiano 96c1ba279a
Add infos about plugin install failure 2020-04-07 15:55:59 +02:00
Jordi Boggiano 80505e745e
Fix phpstan issues 2020-04-07 14:40:51 +02:00
Jordi Boggiano 3a9b786400
Bring suggest output in line with the rest of update/install output 2020-03-13 11:18:41 +01:00
Jordi Boggiano 44d1e15294
Simplify suggester output when updating, refactor suggest command to reuse SuggestedPackagesReporter and make smarter defaults, fixes #6267 2020-02-13 16:13:29 +01:00
Jordi Boggiano d52ce3c37f
Replace pre/post-dependencies-solving by a pre-operations-exec event happening only on install from lock 2020-02-12 14:35:31 +01:00
Jordi Boggiano 71855e6430
Restore PRE/POST_DEPENDENCY_SOLVING events 2020-02-12 10:41:03 +01:00
Jordi Boggiano 7e142b5d6b
Use Upgrading for package installs too 2020-02-11 17:51:02 +01:00
Nils Adermann 5bdc0fc9c5 Request jobs replaced by root require / fixed package
The only type of request job remaining was "install" which is really a
root requirement. The only other kind of input for the solver is now a
set of fixed packages.

Rules have been updated to account for only two kinds of former job
reason: FIXED or ROOT_REQUIRE. The job property has always been
redundant and has been removed, since reasonData suffices.

Problem reasons are always rules, so the unnecessary wrapping in an
array has been removed.

We now only ever generate a single rule per root require or fixed
package, so there is no need for the solver to special handle disabling
"jobs" anymore, the rule can just be disabled as usual.

For consistency special handling of rules for jobs in problems has been
integrated into the rule class like all other rule reasons. As part of
this change the error message for root requirements has been improved a
bit to make it clearer where the package installation request came from.

The word job has also been removed from operations, which are called
operations, not jobs.
2020-01-19 23:21:07 +01:00
Adam Žurek 406a28708f updated phpstan to 0.12 2019-12-16 21:58:05 +01:00
Jordi Boggiano f2058680a7
Remove unused use statements 2019-11-24 08:46:23 +01:00
Jordi Boggiano 5c62c7d566
Simplify promise handling 2019-11-23 12:37:17 +01:00
Jordi Boggiano f288acb1ca
Execute alias operations still 2019-11-23 11:29:50 +01:00
Jordi Boggiano 5725a2db57
Allow all prepare/cleanup/install/update/uninstall operations to return promises to be executed in parallel as well 2019-11-23 11:25:28 +01:00
Jordi Boggiano 006985a0ea
Execute all operations at once which lets us download all packages in parallel then install only once all downloads succeeded, fixes #2847
This also changes the PRE/POST_PACKAGE_INSTALL/UPDATE/UNINSTALL events to have less information available on them, repositorySet, request and policy are gone
2019-11-14 15:21:28 +01:00
Nils Adermann f5e18250e6 Merge remote-tracking branch 'github-composer/2.0' into solve-without-installed
* github-composer/2.0: (48 commits)
  Fix missing use/undefined var
  Split up steps on VCS downloaders to allow doing network operations before touching the filesystem on GitDownloader, fixes #7903
  Fix use statement
  Deduplicate findHeaderValue code
  Add install-path to the installed.json for every package, fixes #2174, closes #2424
  Remove unnecessary config from phpstan
  Make sure the directory exists and will not block installation later when downloading
  Avoid wiping the whole target package if download of the new one fails, refs #7929
  Only empty dir before actually installing packages, fixes #7929
  Improve output when installing packages
  Show best possible version in diagnose command
  Remove extra arg
  Allow path repos to point to their own source dir as install target, resulting in noop, fixes #8254
  Fix use of decodeJson
  Fix update mirrors to also update transport-options, fixes #7672
  Fix updating or URLs to include dist type and shasum, fixes #8216
  Fix origin computation
  Improve handling of non-standard ports for GitLab and GitHub installs, fixes #8173
  Load packages from the lock file for check-platform-reqs if no dependencies have been installed yet, fixes #8058
  Fix error_handler return type declaration
  ...
2019-09-07 02:55:21 +02:00
Jordi Boggiano 53d2ab2253
Split up steps on VCS downloaders to allow doing network operations before touching the filesystem on GitDownloader, fixes #7903 2019-08-29 11:37:23 +02:00
Jordi Boggiano 300a888470
Merge pull request #7995 from Seldaek/plugin-deactivation
Plugin deactivation/uninstall support
2019-08-01 18:11:49 +02:00
Nils Adermann 9053d74282 Merge branch '2.0' into solve-without-installed
* 2.0: (101 commits)
  SVN: hide passwords for debug output
  Free $solver asap
  fixes #8179
  [minor] Fixed a typo in the CHANGELOG.md.
  Update deps
  Update changelog
  Revert "Allow overriding self-update target file with envvar COMPOSER_SELF_UPDATE_TARGET" Revert "Add docs for COMPOSER_SELF_UPDATE_TARGET, refs #8151"
  Add docs for COMPOSER_SELF_UPDATE_TARGET, refs #8151
  Fix display of HHVM warning appearing when HHVM is not in use, fixes #8138
  Read classmap-authoritative and apcu-autoloader from project config when installing via create-project, fixes #8155
  Use possessive quantifiers
  Update xdebug-handler to 1.3.3
  fixes #8159
  Allow overriding self-update target file with envvar COMPOSER_SELF_UPDATE_TARGET
  flag should come before script name
  use full command name, not abbreviated/alias
  modify text
  Document the alternatives to disable the default script timeout
  Anchor pattern
  Fix URL resolution for Composer repositories
  ...
2019-06-27 14:35:36 +02:00
Matthew Brown 65903aacfd Fix type issues (#7996)
* Fix type issues found by Psalm
2019-02-19 15:35:48 +01:00
Jordi Boggiano 3fc9ede24b
Add plugin callbacks for deactivation and uninstall, fixes #3000 2019-02-18 18:14:46 +01:00
Nils Adermann 10ada7bf82 Refactor Installer class into separate install and update processes
- Introduce separate Lock and LocalRepo transactions, one for changes
  to the lock file, one for changes to locally installed packages based
  on lock file
- Remove various hacks to keep dev dependencies updated and
  incorporated the functionality into the transaction classes
- Remove installed repo, there are now local repo, locked repo and
  platform repo
- Remove access to local repo from solver, only supply locked packages
- Update can now be run to modify the lock file but not install packages
  to local repo
2019-02-11 01:00:02 +01:00
Nils Adermann 287419f6a0 Merge branch 'master' into 2.0
* master:
  Follow up to #7946 test: add solver flag to assert path execution
  Fix tests
  Make sure config command output is also output on --quiet so that warnings can be hidden, fixes #7963
  Recognize composer-plugin-api as a platform package, fixes #7951
  Quote wildcards to avoid issues in some shells, fixes #7960
  Avoid dumping null values for dist reference/shasum and source reference, fixes #7955
  Soften hard exit after revert of composer file
  Make unixy proxy code POSIX compatible
  Update aliases.md
  Same but for Problem.php
  Better error message for present but incompatible versions
  Fix inconsistent casing
  Don't do (new Foo())->bar() - not 5.3-compatible
  Support identifying the HHVM version when not running with HHVM
2019-02-10 20:28:24 +01:00
johnstevenson f4b9bbbf42 Make unixy proxy code POSIX compatible 2019-02-08 17:33:13 +00:00
Jordi Boggiano 4517c00d40 Merge branch 'master' into 2.0 2019-01-29 14:01:28 +01:00
Jordi Boggiano 79af9d45af Merge branch '1.8' 2019-01-29 13:49:25 +01:00
Jordi Boggiano 98a15bc93c Add output for metapackage installs/updates/.. fixes #7586 2019-01-29 11:38:18 +01:00
Jordi Boggiano 0b928b2a42 Merge branch 'master' into 2.0 2019-01-28 14:33:10 +01:00
Jordi Boggiano 3dfcae99a9 Add parallel download capability to FileDownloader and derivatives 2019-01-18 08:39:03 +01:00
Pete Cooper ea48bad401
Fix spelling mistake on Cygwin 2019-01-03 17:05:46 +00:00