694 Commits (9fde6ec88bc91cfbf91b5ecb66cffe16a56425c1)

Author SHA1 Message Date
Nils Adermann 06f460c557 Remove trailing spaces from output 4 years ago
Nils Adermann 1f467046d7 Implement getProviders on reposet for all repo types and add replacers
This way errors during require dev extraction make more sense
4 years ago
Jordi Boggiano 589aa351a8
Change Uninstalling to Removing in lock operations 4 years ago
Jordi Boggiano a7a975ec1c
Alias dev-master/trunk/default to 9999999-dev instead of normalizing the version to that, fixes #8323 4 years ago
Jordi Boggiano 9cab8c10cc
Merge branch 'master' into 2.0 4 years ago
arai 1f08138379 Delete variable 4 years ago
Jordi Boggiano 835a91532d
Add PRE_POOL_CREATE event, fixes #8348 4 years ago
Jordi Boggiano 9609729de7
Change update to upgrade for package update operations which are upgrades, refs #8594 4 years ago
Jordi Boggiano be8dd528b8
Merge remote-tracking branch 'origin/master' into 2.0 4 years ago
Ion Bazan a180f48921 Distinguish between updates and downgrades in dry-run 4 years ago
Nils Adermann fdfdee03c1 Remove unused argument to pool->match 4 years ago
Nils Adermann 4f44b7b221 Remove unused policy function findUpdatePackages 4 years ago
Jordi Boggiano 189d5adab0
Fix reporting of replace conflicts to not mention provides 4 years ago
Jordi Boggiano ec90c17e3b
Fix conflict order to be more accurate 4 years ago
Jordi Boggiano c41df325d8
Remove RepositorySet from Solver and remove getPool from RepositorySet 4 years ago
Jordi Boggiano 1d4cdb60d0
Improve error reporting for conflicts/replaces of various kinds, fixes #7254 4 years ago
Jordi Boggiano 6c9d9e775c
Clean up and deduplicate the output of RULE_LEARNED 4 years ago
Jordi Boggiano 29efc473a1
Suggest which providers could be required to fulfill a virtual package requirement, fixes #2811 4 years ago
Jordi Boggiano 3fc7e10c5c
Improve error reporting of solver issues, refs #7779
Fixes #8525
Fixes #6513
4 years ago
Jordi Boggiano 8a41f1a5ca
Allow providers which are selected to be installed in place of existing packages which do not satisfy requirements, fixes #6753 4 years ago
Nils Adermann 8b877eb068 Remove superfluous check in Problem 5 years ago
Nils Adermann 0b4e8952f6 PHP5 disallows require as a function name, use requireName analog to fixPackage 5 years ago
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.
5 years ago
Jordi Boggiano 1d31190472
Keep track of unacceptable fixed packages for later to use in error reporting and make sure the pool state is consistent 5 years ago
Jordi Boggiano c6a3f48eaf
Remove some more remove request handling 5 years ago
Jordi Boggiano 7cc8a4aed8
Avoid checking stability on platform packages too 5 years ago
Jordi Boggiano 6dc576738a
Avoid partial updates from applying changes to packages which are not locked with an acceptable stability 5 years ago
Jordi Boggiano e162cc6f0a
Remove "remove" from request 5 years ago
Jordi Boggiano 304753ff69
Remove callback and pass stabilities all the way instead
This allows optimizing the loading of ~dev files, and cleans up a few things
5 years ago
Jordi Boggiano 8bb472a608
No need to alias platform packages before the repository set as the pool builder already does it 5 years ago
Jordi Boggiano 572ef1add1
Add comment for lockable 5 years ago
Jordi Boggiano cc91e9164a
Stop unrolling the root aliases 5 years ago
Jordi Boggiano 73bc137c3c
Avoid nameConstraints from being collected for fixed packages 5 years ago
Jordi Boggiano e50f78043a
Try to load packages from lock file only and avoid loading other versions for pinned packages 5 years ago
Jordi Boggiano e6749d8717
Add comment, fix 5.3 build 5 years ago
Jordi Boggiano dd556f989b
Use LockArrayRepository instead of RepositoryInterface to clearly indicate which type of repo it is in some places 5 years ago
Jordi Boggiano f68731e663
Remove package/repo priority concept as it is enforced by the pool builder now 5 years ago
Jordi Boggiano 47a94b3a88
Ensure packages that exist in a higher prio repo never get loaded in lower prio repos, fixes #5076 5 years ago
Yanick Witschi d1dc367d86 Removed the filters from the pool 5 years ago
Jordi Boggiano d12c20db4b
Remove async repo interface, closes #7902 5 years ago
Nils Adermann a732ea5dd8 Display source/dist refs if updates do not change the version
We now output an update when only a source or dist ref changes even if
it's a stable version so in these cases the output needs to contain the
ref to make it clear to users what changed
5 years ago
Jordi Boggiano 438c45e991
Change UpdateOperation::show to match what the installers output, fixes the dry-run output to be more like real output 5 years ago
Nils Adermann 4e7702598e Always treat changes in dist and source references as updates 5 years ago
Nils Adermann 28afc4de32 MultiConflictRules cannot be disabled, so no need to check 5 years ago
Nils Adermann 79066931e6 Update exception message for disabling multi conflict rules 5 years ago
Nils Adermann dc0f2e7e46 Ensure multi conflict rules are only used for 3+ literals
Implements the equals method correctly on multi conflict rules. If there
are fewer literals a regular Rule2Literals is enough to represent the
basic conflict rule.
5 years ago
Nils Adermann ed300b9f22 New Multi Conflict Rule for transitive conflicts, to reduce memory 5 years ago
Nils Adermann 6f9b1e76e3 Remove disableRules code from Solver, leftover from original C code
This goes back to an input option to install recommended packages, which
would in turn allow removal of these packages if that was needed to
resolve the rest. This was supported in very early versions of Composer
with suggested packages. We later realized this was not useful in the
context of a project based dependency manager with a lock file, so it
was removed but the solver was never cleaned up.
5 years ago
Nils Adermann aa6bc75af2 Add a test case for transactions to verify correct sorting 5 years ago
Nils Adermann 3cbe91983c Display Locking instead of Installing for lock file install operations 5 years ago
Nils Adermann 25de5218c3 Reunify lock and local repo transaction code and apply the same sorting 5 years ago
Nils Adermann 97ec2d7b61 Merge remote-tracking branch 'github-composer/2.0' into solve-without-installed
* github-composer/2.0: (63 commits)
  Fix PSR warnings for optimized autoloader, refs #8397, refs #8403
  Prepare 1.9.1 changelog
  Output a hint that maybe you are not in the right directory, fixes #8404
  Fix PSR warnings for optimized autoloader, refs #8397, refs #8403
  Fix tests for PSR-fix in optimized autoloader, refs #8397
  Fix tests for PSR-fix in optimized autoloader, refs #8397
  Change PSR-fix for optimized autoloader to only warn for now, refs #8397
  Fix output of dump-autoload command to avoid interfering with warnings, refs #8397
  Remove credentials from git remotes in cache and vendor dirs
  Avoid overwriting credentials with existing ones from git repos, refs #8293
  Fix github auth to try https with pwd also, fixes #8356
  Fix gitlab support for basic-auth fallback from ssh URLs
  Avoid clearing the error output during removeDirectory execution, losing git error output, fixes #8351
  Move test file parsing into try/catch block to avoid phpunit swallowing errors
  make optimized autoloader respect PSR standards
  Validate composer show with --tree and --path options set (#8390)
  Don't show root warning for docker containers
  Added phpdoc for ComposerAutoloaderInit$SHA1::getLoader() (#8393)
  Validate schema name, type and version
  Fix require command to allow working on network mounts, fixes #8231
  ...
5 years ago
Nils Adermann 0099f56361 Define property which is later accessed in lock transaction 5 years ago
Nils Adermann 28596d9c12 Define property which is later accessed in local repo transaction 5 years ago
Nils Adermann e308f043b9 Fully switch to spl_object_hash in lock transaction
The pool builder tries to be minimal so it's fine for present/locked
packages not be assigned a solver/pool id. Adding a test to verify
correct creation of uninstall jobs
5 years ago
Nils Adermann c50d236378 Correctly load branch aliases from lock file
Root aliases are also stored in the lock file, so on install do not read
them from composer.json.
5 years ago
Nils Adermann cc274ebdf4 Do not reset references on update mirrors if VCS type has changed 5 years ago
Nils Adermann 6925005ac9 Implement update mirrors/nothing/lock as its own installer mode
These special commands no longer (ab)use the partial update mechanism
but rather create a special install request for all current lock file
contents and later override any modified code references to the
originals. This leads to up to date remote metadata but no other
changes.
5 years ago
Jordi Boggiano bc2a1d762a
Merge branch 'master' into 2.0 5 years ago
Nils Adermann 0ff07015a1 Only load package info from lock file for fixed packages
As a result some lock file packages are no longer in the pool, so the
former installed map, now present map cannot use package ids anymore

Need to revisit some more code later to simplify this, todo notes left
5 years ago
Nils Adermann 4481cc4a88 Allow an install request for a package name which is already fixed
Ensures packages get loaded from locked repo correctly. We may not want
to support this particular use-case at all, but for now it fixes the
existing test, so we may want to revisit this later.
5 years ago
Jordi Boggiano 46657a8a7f
5.3 support :/ 5 years ago
Jordi Boggiano 8d92048c8c
Update safeguard code, fixes #8383 5 years ago
Nils Adermann 995b4f923e Fix more tests which were lacking lock files for partial updates, display fix jobs in problems 5 years ago
Nils Adermann 3989a1b8ee Restore dev package extraction
New approach is to use only the solved set of packages as input and then
to resolve with only the non-dev requirements and to mark everything as
dev that is not part of the result set, rather than transitioning a
temporary local repo state by uninstalling dev packages.
5 years ago
Nils Adermann 4db325b7b4 Use the old root stack based approach to sorting operations in the transaction 5 years ago
Nils Adermann b700aa3d62 Sort local repo transaction as topological as possible 5 years ago
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
  ...
5 years ago
Nils Adermann 06d11f2f38 Fix calculation of lock transaction updates and start updating output in tests 5 years ago
Nils Adermann f1e4ccbe1d Fix handling of reference updates and root references 5 years ago
Jordi Boggiano 6c4357a7ed
Merge branch 'master' into 2.0 5 years ago
Baptiste Lafontaine a4611d511f Ignore platform reqs now handle conflict rules 5 years ago
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
  ...
5 years ago
Nils Adermann d2fa1e1319 Merge branch 'master' into 2.0
* master: (48 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
  ...
5 years ago
Jordi Boggiano 79a300eaac
Merge branch '1.8' 5 years ago
Jordi Boggiano 088fb56c3d
Fix display of HHVM warning appearing when HHVM is not in use, fixes #8138 5 years ago
Marc Würth d2ab4f66fd
Extract job packageName & constraint to variables 5 years ago
Jordi Boggiano 0317199507
Merge branch 'master' into 2.0 5 years ago
Marc Würth fb8b06edef Remove unused local variable 5 years ago
Matthew Brown 65903aacfd Fix type issues (#7996)
* Fix type issues found by Psalm
5 years ago
CZechBoY a062cd1a31
added phpstan on level 0 5 years ago
Nils Adermann c875f538ea Make root alias behaviour consistent, add root ref handling, lock to newest metadata
root aliases during install should come from the lock file only, for
better reproducibility we don't reuse the value from update for the
following install
5 years ago
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
5 years ago
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
5 years ago
Nils Adermann 29ff6a40ae Follow up to #7946 test: add solver flag to assert path execution 5 years ago
Jordi Boggiano f2cc666c2c
Merge pull request #7913 from fredemmott/hhvm-version
Support identifying the HHVM version when not running with HHVM
5 years ago
Fred Emmott 41c7f4d2bf
Same but for Problem.php 5 years ago
Fred Emmott 17788c76f6
Better error message for present but incompatible versions
hhvm-nightly (and next week's release) now report 4.x, so all the 3.x
constraints are now giving misleading error messages with this patch.

Before:

```
    - facebook/fbexpect v2.3.0 requires hhvm ^3.28 -> you are running this with PHP and not HHVM.
```

After:

```
    - facebook/fbexpect v2.3.0 requires hhvm ^3.28 -> your HHVM version (4.0.0-dev) does not satisfy that requirement.
```
5 years ago
Nils Adermann 728e57b9e0 Merge branch 'master' into 2.0
* master:
  Fix solver problem exceptions with unexpected contradictory "Conclusions"
  Also load config into IO if not freshly created
  Only load configuration into IO if IO is available
  Fix defaultRepos fallback does not use auth config
  Add warning/info msg when tweaking disable-tls setting to avoid confusion, fixes #7935
5 years ago
Nils Adermann 6b2edeae56 Fix solver problem exceptions with unexpected contradictory "Conclusions"
This 5 character fix comes with a solver test as well as a functional
installer test essentially verifying the same thing. The solver test is
more useful when working on the solver. But the functional test is less
likely to be accidentally modified incorrectly during refactoring, as
every single package, version and link in the rather complex test
scenario is essential, and a modified version of the test may very well
still result in a successful installation but no longer verify the bug
described below.

Background:

In commit 451bab1c2c from May 19, 2012 I
refactored literals from complex objects into pure integers to reduce
memory consumption. The absolute value of an integer literal is the id
of the package it refers to in the package pool. The sign indicates
whether the package should be installed (positive) or removed (negative),

So a major part of the refactoring was swapping this call:

$literal->getPackageId()

For this:

abs($literal)

Unintentionally in line 554/523 I incorrectly applied this change to the
line:

$this->literalFromId(-$literal->getPackageId());

It was converted to:

-abs($literal);

The function literalFromId used to create a new literal object. By using
the abs() function this change essentially forces the resulting literal
to be negative, while the minus sign previously inverted the literal, so
positive into negative and vice versa.

This particular line is in a function meant to analyze a conflicting
decision during dependency resolution and to draw a conclusion from it,
then revert the state of the solver to an earlier position, and attempt
to solve the rest of the rules again with this new "learned" conclusion.

Because of this bug these conclusions could only ever occur in the
negative, e.g. "don't install package X". This is by far the most likely
scenario when the solver reaches this particular line, but there are
exceptions.

If you experienced a solver problem description that contained a
statement like "Conclusion: don't install vendor/package 1.2.3" which
directly contradicted other statements listed as part of the problem,
this could likely have been the cause.
5 years ago
Jordi Boggiano e753bf08b1 Minor tweaks 6 years ago
Nils Adermann 6c32393fd7
Merge pull request #7644 from naderman/pool-builder-prune-impossible-versions
PoolBuilder:  prune impossible versions before pool creation
6 years ago
Jordi Boggiano 2e0f31106a Merge remote-tracking branch 'origin/master' into 2.0 6 years ago
Gabriel Caruso 2a13bb2649 Fixes from PHPStan (#7687)
* fix docblocks

* remove redundant conditional

* fix wrong variable name

* fix wrong namespaces

* add missing private members

* remove unused/redundant arguments

* move testcase class

* exclude TestCase.php

* Tweak RuleWatchGraph type hints

* Tweak doc comment
6 years ago
Nils Adermann 537f4fbc3b Prune unreachable required versions correctly for aliased packages
In trials this seems pointless, so maybe better to skip aliases and
reduce memory and cpu wasted on looking these things up
6 years ago
Nils Adermann 83efeaec5c Attempt to prune versions which are impossible to install during pool building 6 years ago
Nils Adermann 53c5e3c076
Merge pull request #7633 from naderman/remove-pool-whitelist
Remove pool whitelist
6 years ago
Nils Adermann 7c2d3518e5 Remove whitelisting of required package names, done by pool builder now 6 years ago
Nils Adermann 902cb290e7 Only load package versions which fit the root composer.json constraints 6 years ago
Nils Adermann 81bb8f81ad Set all package ids only once the pool is created
They all get set in one place only and at a specific time when nothing
else will possibly change them anymore
6 years ago
Nils Adermann 5c491ecc9b
Merge pull request #7625 from naderman/repository-set
Separate RepositorySet from Package Pool, load only metadata of packages directly required
6 years ago
Nils Adermann 261efe1e8e Implement loadPackages on Composer repositories with providers 6 years ago
Nils Adermann c0f19f6c57 Move construction of pool from repo set into a pool builder
Pool construction depends on the install request now, so only required
packages get loaded, add some structure for future asynchronously
loading composer repositories
6 years ago
Nils Adermann b6e2d60c9e Create the pool in the installer before giving it to the solver 6 years ago
Nils Adermann 1228bcdffc Internalize pool creation in repository set, store root aliases in set
The pool is still exposed too early in a few places which will require
further refactoring
6 years ago
Nils Adermann 6ef65e5319 Add a new RepositorySet class and restrict pool usage to the solver
Breaking change for the plugin interface so bumping the version of
composer-plugin-api to 2.0.0

First step for a refactoring of the package metadata loading mechanism
6 years ago
Gabriel Caruso 71c8735e11 Use combined assignment operators 6 years ago
Christophe Coevoet e5b948c683 Refactor the handling of conflict rules in the solver
Conflict rules are not added in the solver based on the packages loaded in the
solver by require rules, instead of loading remote metadata for them. This has
2 benefits:

- it reduces the number of conflict rules in the solver in case of conflict
  rules targetting packages which are not required
- it fixes the behavior of replaces, which is meant to conflict with all
  versions of the replaced package, without introducing a performance
  regression (this behavior was changed when optimizing composer in the past).
6 years ago
Jordi Boggiano ff59bbdab0 CS fixer 6 years ago
Jordi Boggiano 0d92c8df63
Merge pull request #7480 from staabm/patch-3
Simplify Rule->getJob()
6 years ago
Markus Staab 05499099a0
Simplify Rule->getJob() 6 years ago
Markus Staab f7a1c34c92
Removed unused variables 6 years ago
Markus Staab 50565cb0c8 Use variable to call count() less often 6 years ago
Rob 68d468d683
Merge pull request #7450 from staabm/simpler-hash
Use a simpler hashing for the Rule2Literal case
6 years ago
Rob 1e9136f086
Merge pull request #7456 from staabm/simpler-equals
Specialize Rule2Literal->equals(Rule2Literal) for speedup
6 years ago
Rob 7079cdb70d
Merge pull request #7458 from staabm/patch-3
Define variable only when actually used
6 years ago
Rob b350c09c7e
Merge pull request #7457 from staabm/patch-2
Remove unnecessary abs() calls
6 years ago
Markus Staab 86d5de2965
Define variable only when actually used 6 years ago
Markus Staab 42516901f1
Removed another unnecessary abs() call 6 years ago
Markus Staab 0e16dbabde
Removed another unnecessary abs() call 6 years ago
Markus Staab e3a23f4ae6
Remove unnecessary abs() calls
Literal cannot be negative at this point
6 years ago
Markus Staab 7a4937bbcc Specialize Rule2Literal->equals(Rule2Literal) for speedup 6 years ago
Markus Staab 07383552b3
Temporary save the package-name into a variable
this reduces number of unnecessary function calls in the hot path of "composer update"
6 years ago
Markus Staab 0aa7ec2d2c Use a simpler hashing for the Rule2Literal case
this speeds up "composer update" by ~18%
6 years ago
Gabriel Caruso 7d9f8e2247
Improvements
Small improvements, such as remove unused imports, unecessaries casts, parentheses, etc.
6 years ago
Yanick Witschi d82bdc04ac Improved debugging output 6 years ago
Yanick Witschi 5435877bd9 Improve SAT resolving developer debug information 6 years ago
Jordi Boggiano dae3c5bc2d Merge branch '1.6' 7 years ago
Jordi Boggiano 766ed9555e Only show override description if there is one, refs #7011 7 years ago
Vic Metcalfe fa5a94143a Show reason for php version package mismatch due to config.platform 7 years ago
Jordi Boggiano ad8b44a4c8 Merge branch '1.6' 7 years ago
Jordi Boggiano 471b012e3a Fix problem report when requiring "ext-zend opcache", refs #2509 7 years ago
Gabriel Caruso 3d262bd637 Fixes from PHPStan level 0
More fixes from PHPStan level 0
7 years ago
Gabriel Caruso 32a409a3ee Clean elses 7 years ago
Jordi Boggiano 0b3bc4ccb9 Merge branch '1.5' 7 years ago
Nils Adermann f40f95b269 Add a note that a user could have forgotten to add a custom repo if package not found 7 years ago
Jordi Boggiano c0eb32669a Remove comment 7 years ago
Vladimir Reznichenko c8615358cb SCA with PHP Inspections (EA Extended) 7 years ago
Denis Brumann 2df1a69287 Improve IDE autocompletion
According to type 2nd constructor-argument `$reasonData` can either be a Link or a PackageInterface. IDEs like PhpStorm won't be able to provide autocompletion since both classes are from a different namespace.

In order to provide better autocompletion for `$reasonData` and by extension `$this->reasonData` the use statements should be included or the type hint should use the fully qualified class name.

For the same reason I added the docblock on the protected method `formatePackagesUnique()`.
7 years ago
Jordi Boggiano 122e422682 CS fixes 7 years ago
rubenrua 8fccbaa4a4 Improve memory usage resolving dependencies II
Optimize `rulesByHash` in `Composer\DependencyResolver\RuleSet` to only
use an array with the second element, event with very low probability.
7 years ago
rubenrua 4e1887a721 Improve memory usage resolving dependencies
It is known that composer update takes a lot of memory: #5915, #5902,

I am playing with a profiler (@blackfireio) to make a demo in my local
PHP meetup (@phpvigo) and I found out a way to use less memory. These
are my first tests:

* Private project using PHP 5.6:
  * Memory: from 1.31GB to 1.07GB
  * Wall Time: from 2min 8s to 1min 33s

* symfony-demo using PHP 7.1 in my old mac book:
  * Memory: from 667MB to 523MB
  * Wall Time: from  5min 29s to 5min 28s

Not use an array inside conflict rules is this improvement main idea:

```php
<?php
//Memory 38MB
gc_collect_cycles();
gc_disable();

class Rule
{
    public $literals;

    public function __construct(array $literals)
    {
        $this->literals = $literals;
    }
}

$rules = array();

$i = 0;
while ($i<80000){ //
    $i++;

    $array = array(-$i, $i);
    $rule = new Rule($array);
    $rules[] = $rule;
}
```

```php
<?php
//Memory 11.1MB
gc_collect_cycles();
gc_disable();

class Rule2Literals
{
    public $literal1;
    public $literal2;

    public function __construct($literal1, $literal2)
    {
        $this->literal1 = $literal1;
        $this->literal2 = $literal2;
    }
}

$rules = array();

$i = 0;
while ($i<80000){ //
    $i++;

    $rule = new ConflictRule(-$i, $i);
    $rules[] = $rule;
}
```

More info https://github.com/composer/composer/pull/6168
7 years ago
johnstevenson 379fb70ad9 Use random name for tmp ini and delete after use
Thanks to Patrick Rose for reporting this issue.
8 years ago
Nicolas Grekas daf84bea33 Enhance solver perf by removing count() 8 years ago
Yanick Witschi 7b5fe5c7d4 CS 8 years ago
Yanick Witschi a9e88a27b3 CS 8 years ago
Yanick Witschi 4a769a785c Reduce calls on Rule::getHash() 8 years ago
ReenExe 53fc30fe56 clear code 8 years ago
Lucas CHERIFI 7e34d9ab97 Typo fix ;-) 8 years ago
Jordi Boggiano feda2a283f Improve error reporting some more, fixes #4310 8 years ago
Jordi Boggiano 3b0a1c6f70 Run cs fixer and update config to latest master 8 years ago
Niels Keurentjes 818c3e707a Ton of phpDoc fixes. 8 years ago
Jordi Boggiano c74e6df65d Fix strings being passed to an int arg, fixes 7.1 build 8 years ago
Jordi Boggiano 623c0dcda7 Improve solver error reporting, fixes #5086, fixes #2575, fixes #2661 8 years ago
Niels Keurentjes 8e78ce9a43 Add extra logging before and after SAT solving 8 years ago
Nils Adermann 4af74b54e0 Ignore self references when anlaysing independent root requirements
When creating a transaction we try to identify all requirements that are
not themselves required by any other package. If a package references
itself this should not mark it as being required by another package.
8 years ago
Niels Keurentjes b059cbe37c Removed unused variables and includes, fixed functions being called with more arguments than declared. 8 years ago
Jordi Boggiano c9436438ff Add memoization to parseConstraints, saves some (6-7% here) RAM and marginal CPU time 8 years ago
Niels Keurentjes ebfceefca6 Removed long deprecated functions that were no longer referenced anywhere. 8 years ago
Rob Bast baabc612f6 adjust message, skip test
currently we have no way to put dynamic values or wildcards in EXPECT-OUTPUT
9 years ago
Rob Bast 94daeca57b add test and adjust rule error message 9 years ago
Jefferson Carpenter 8d57c3e743 Update SolverProblemsException.php 9 years ago
Jordi Boggiano 1818b95149 CS fixes 9 years ago
Jordi Boggiano e0ff9598c3 Tweak wording a bit, refs #3177 9 years ago
Radek Benkel 09417cae50 Composer gives .ini hints about missing extensions 9 years ago
Wouter J d0e4c5f71e Use "value" instead of "setting" 9 years ago
Wouter J b156ad0345 Improve error message 9 years ago
Jordi Boggiano f5e0fc14b3 Clarify some error messages, fixes #3770 9 years ago
Jordi Boggiano 125dc62fab Make trigger error visible 9 years ago
Rob Bast 1c7016de45 remove dead code/class 9 years ago
Rob Bast 1bf03e9621 fixed various docblocks and class properties in solver 9 years ago
Rob Bast b523fc0b7b ran fixers 9 years ago
Jordi Boggiano ce08582671 Fix CS 9 years ago
Rob Bast a1427d7fd6 replace all occurences in code and comments 9 years ago
Rob Bast 51ef7b5eef instead of generic be more verbose about possible causes 9 years ago
Rob Bast 77f1d5945f make sure php version errors are less misleading
* determine conflicting version in problem using pool package
* hide version in rule to keep it generic rather than possibly misleading

fixes #4319
9 years ago
Nils Adermann cf1af58514 Use bitwise operators directly in rules instead of get/set Bitfield 9 years ago
Nils Adermann 956035e641 Remove the unnecessary return statements from setters 9 years ago
Nils Adermann f535542fca Use constants with names for bitfield offsets 9 years ago
Nils Adermann 329ab5cf41 Rename blob rule property to bitfield 9 years ago
Nils Adermann 961ea868ac Use an integer bitfield for rule properties instead of a string binary blob 9 years ago
Nils Adermann 6e81f63635 Reduce memory footprint of rules by storing data in blob
Not declaring the job property saves significant amounts of memory as
most rules leave it as null
9 years ago
Nils Adermann c7e1f49e78 Rule hashes are only used in the rule set, so no need to store them 9 years ago
Nils Adermann 15d572da4c Use 4 byte integer from raw md5 instead of 5 hex representation chars
The hash is necessary as comparisons are significantly too slow
otherwise. The old hash function used substr on the hexadecimal
representation of the md5 hash, rather than the raw binary output. This
wastes a significant amount of memory, as each byte can only be used to
store up to 4 bit of information. The new hash has 32bit instead of
20bit and uses only a 4 byte integer instead of a 5 byte string.
9 years ago
Nils Adermann 5b1b96b61e Output the number of rules used in the solver for profiling purposes 9 years ago
Nils Adermann 07e1d227c9 Output the size of the pool after dependency resolution for users 9 years ago
Kunal Mehta f634c6946d Update callers of VersionParser::formatVersion()
Tests were moved to BasePackageTest.
9 years ago
Jordi Boggiano 79f9158fb2 Merge pull request #4192 from localheinz/fix/import
Fix: Add missing imports
9 years ago
Jordi Boggiano 6a64041055 CS fixes 9 years ago
Andreas Möller 12ffe2b4d4 Fix: Add missing imports 9 years ago
Andreas Möller e184118d76 Fix: Docblock 9 years ago
Nils Adermann 75c501251d Revert "Merge remote-tracking branch 'naderman/load-no-providers'"
This reverts commit 3e85f82373, reversing
changes made to b025d0982b.
9 years ago
Jordi Boggiano 3e85f82373 Merge remote-tracking branch 'naderman/load-no-providers' 9 years ago
Nils Adermann cfd0e44312 Move private function further down in pool 9 years ago
Nils Adermann ec5416f03c loadDev parameter is nonsense, properly load packages in create command 9 years ago
Nils Adermann da02c53540 Update the composer repository whatprovides test to a loadrecursively test 9 years ago
Nils Adermann b99c03ea04 Entirely remove whatProvides from Composer repository 9 years ago
Nils Adermann 090711b21c Completely move loading of packages from composer repo to pool 9 years ago
Possum 2e99b9fdf5 Use https where possible 9 years ago
Nils Adermann 4d0db5add6 POC Implementation of loading only explicitly named package data 9 years ago
Nils Adermann b4ed331168 The Solver Request no longer depends on the Pool 9 years ago
Jordi Boggiano d6620195e5 Prioritize repository over package versions in the default policy, fixes #3509 9 years ago
Markus Staab c9bdf3a07a added the actual phpversion into the error message when phpversion doesn satisfy the requirement 9 years ago
Jordi Boggiano 05e08889ed Add BC method for old usage, refs #3857 9 years ago
Jordi Boggiano 6b3178b169 Merge remote-tracking branch 'isoroku/fix-misspellings'
Conflicts:
	doc/articles/handling-private-packages-with-satis.md
9 years ago
Hannes Van De Vreken d017fa4a1d Unused variable 9 years ago
isoroku e0657b60a2 Fix misspellings 9 years ago
Jordi Boggiano 3ba581f0df Improve error messages for required hhvm/php versions, fixes #3767 9 years ago
Vladimir Kartaviy 813fd0b703 Added missing $learnedWhy property 10 years ago
Nicolas Grekas 4a0feb0189 add --prefer-lowest-stable to update command 10 years ago
Steve Preston dfe18d2e7f Fixed dependency problem caused by pull request #3482 10 years ago
Nils Adermann 4a945da55b Avoid generating duplicate conflict rules
For each version of each package we create a conflict rule with each
other version. These are then added to the rule set and skipped if
duplicate so instead we can just generate them only once to begin with
and avoid unnecessary memory allocation and duplication lookups.
10 years ago
Nils Adermann 6f41e99fe2 Add back ruleById function for BC 10 years ago
Nils Adermann 2c43a3bcd0 Improve docblocks of public properties 10 years ago
Nils Adermann 107a736440 Recreate getLiterals method for BC 10 years ago
Nils Adermann 26598c4a9a Remove unnecessary pool reference from rules 10 years ago
Nils Adermann d77400ade2 Make ruleById lookup table in rule set public
Saves about 500k function calls on a packagist update
10 years ago
Nils Adermann 5c0efdcaa2 Move public properties to top and document them 10 years ago
Nils Adermann c6af09b1da Make project id public
Reduction of rougly 1.3 million function calls on packagist update
10 years ago
Nils Adermann ef41f136f8 Literals on rule are now public
This causes a reduction of ~500k function calls for packagist composer
update (~14 million total).
10 years ago
Nils Adermann 5333017aea Remove unused selectNewestPackages method in DefaultPolicy
Unused as of 1b6f57e651
10 years ago
Nils Adermann dccb728e10 Remove further unnecessary checks for packages being arrays 10 years ago
Nils Adermann 89bd9be295 This entirely removes StreamableRepositories and minimal package arrays 10 years ago
Sam Mousa 670ca2f889 Fixed issue #3441 10 years ago
Nils Adermann 83159dc153 Use elseif instead of else { if { 10 years ago
Nils Adermann 0daaa1a902 Reduce whatProvides overhead 10 years ago
Nils Adermann ee56db8767 Remove the handling of updates in the generator
Updates are implicitly handled by whatProvides for install requests
10 years ago
Jordi Boggiano 94926218e8 CS fixes 10 years ago
Jordi Boggiano ec0463a400 Add tests for platform packages required by root and avoid creating rules altogether instead of disabling them, refs #3320 10 years ago
alu b7fa302b90 add ignore-platform-package-requirements for update/install commands. 10 years ago
Ryan Weaver 947db97e33 [#2492] Removing an unused variable and use statement, fixing phpdoc 10 years ago
Thai Phan e6fdefb869 Update RuleWatchNode.php 10 years ago
Jordi Boggiano ac497feaba CS fixes 10 years ago
Jordi Boggiano e23665be59 Fix replacers being picked if whatProvide was called before building the package whitelist, fixes #2991, fixes #2962 10 years ago
Nils Adermann 78f2ad95a9 Correctly add decision reason to transaction 10 years ago
Christian Flothmann 0e9325da79 for AliasPackages check that the aliased package is white listed so that version constraints of AliasPackages are taken into account when computing package provisions 10 years ago
Nils Adermann aa74818fe0 Handle array candidates in whatProvides 11 years ago
Nils Adermann eb5c785dcd Remove superfluous string casts 11 years ago
Nils Adermann 5b80144ad0 Resolve job packages after whitelist generation 11 years ago
Nils Adermann bc7008270f Properly limit to name matches only if necessary 11 years ago
Nils Adermann 3148ffd355 Whitelist packages with names matching those specified before generating rules
Addresses #2690 doesn't do any performance optimisations yet which we
could do now
11 years ago
Jordi Boggiano 51e6c3a466 Optimize solving by removing packages that are excluded by the root package requires 11 years ago
Jordi Boggiano 0a3df27403 Remove dead code, fixes #2363 11 years ago
Jordi Boggiano 11a0d16ccc CS fixes 11 years ago
Jordi Boggiano cc37e4b0b8 Show defaulted version if phpversion() returns nothing, fixes #2313 11 years ago
Nils Adermann 8369624c49 Correctly set watch2 on rule watch nodes for learned rules fixes #2181 11 years ago
Jordi Boggiano 051d219438 Fix whatProvides returning too many results when no constraint is given 11 years ago
Jordi Boggiano 8d0b7f278e CS fixes 11 years ago
Jordi Boggiano 6f6228fb1d Remove unneeded use 11 years ago
Pavel Savinov b72c4cfe97 PHPDoc fix 11 years ago