34 Commits (3989a1b8ee387b4bc38df74933f90c5e211d8cb7)

Author SHA1 Message Date
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
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 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
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 7c2d3518e5 Remove whitelisting of required package names, done by pool builder now 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
Markus Staab f7a1c34c92
Removed unused variables 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
Gabriel Caruso 7d9f8e2247
Improvements
Small improvements, such as remove unused imports, unecessaries casts, parentheses, etc.
6 years ago
Jordi Boggiano c0eb32669a Remove comment 7 years ago
Vladimir Reznichenko c8615358cb SCA with PHP Inspections (EA Extended) 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
Yanick Witschi 4a769a785c Reduce calls on Rule::getHash() 8 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 26598c4a9a Remove unnecessary pool reference from rules 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 ee56db8767 Remove the handling of updates in the generator
Updates are implicitly handled by whatProvides for install requests
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
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 5b80144ad0 Resolve job packages after whitelist generation 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
Pascal Borreli 83fd3967f0 Fixed PHPDoc 12 years ago
Nils Adermann cc7632489d Make problem report messages more readable
Added pretty strings to constraints
12 years ago
Nils Adermann dc2a9bfe62 Ignore null rules in rule generator
Fixes #806
12 years ago
Nils Adermann 1211d8f7d4 Correctly generate conflict and alias rules for installed packages 12 years ago
Jordi Boggiano 1bd4ccbd54 php-cs-fixer magic 12 years ago
Nils Adermann 21c7e219e2 Change "else if" to "elseif" 12 years ago
Nils Adermann 99200af51b Correctly indent break statements 12 years ago
Nils Adermann 451bab1c2c Get rid of Literal object / literal id mix, use literals only to save memory 12 years ago
Nils Adermann 46e4ae0e6a Move rule generation from solver into separate rule set generator 12 years ago