laminas / laminas-dependency-plugin Goto Github PK
View Code? Open in Web Editor NEWReplace zendframework and zfcampus packages with their Laminas Project equivalents.
License: BSD 3-Clause "New" or "Revised" License
Replace zendframework and zfcampus packages with their Laminas Project equivalents.
License: BSD 3-Clause "New" or "Revised" License
In order to take advantage of composer 2.0 the version in composer.json needs to be bumped up.
Q | A |
---|---|
QA | yes |
As decided during the Technical-Steering-Committee Meeting on August 3rd, 2020, Laminas wants to implement vimeo/psalm in all packages.
Implementing psalm is quite easy.
psalm.xml
in the project root$ composer require --dev vimeo/psalm
$ vendor/bin/psalm --set-baseline=psalm-baseline.xml
static-analysis
with the command psalm --shepherd --stats
script:
in .travis.yml
: - if [[ $TEST_COVERAGE == 'true' ]]; then composer static-analysis ; fi
phpstan.neon.dist
, .travis.yml
entry, composer.json
require-dev
and scripts
)Q | A |
---|---|
Version(s) | 1.0.3 |
zendframework/zend-expressive-zendviewrenderer
is changed to a wrong name mezzio/mezzio-zendviewrenderer
. The changed name should be mezzio/mezzio-laminasviewrenderer
zendframework/zend-expressive-zendviewrenderer
is changed to a wrong name mezzio/mezzio-zendviewrenderer
.
I assume it will result in a wrong package name for any zendframework/zend-expressive-zend* packages. (like zend-expressive-zendrouter)
Update a package which uses zendframework/zend-expressive-zendviewrenderer
Should install mezzio/mezzio-laminasviewrenderer.
I'm using archived repo: zendframework/zend-debug.
The migration to Laminas was successful.
The first use of "composer update" worked fine.
When using "composer update" for the second time, the following message was displayed:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package laminas/laminas-debug could not be found in any version, there may be a typo in the package name.
I think the DependencyRewriterPlugin::transformPackageName() function is missing the zendframework/zend-debug repository exclusion - similar to zendframework/zend-version (line 266).
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These problems occurred while renovating this repository. View logs.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
composer.json
php ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0
composer/composer >=1.9.0 <2.3.0
laminas/laminas-coding-standard ~2.5.0
mikey179/vfsstream ^1.6.11
phpunit/phpunit ^9.5.5
psalm/plugin-phpunit ^0.18.0
vimeo/psalm ^4.5
.github/workflows/continuous-integration.yml
.github/workflows/docs-build.yml
.github/workflows/release-on-milestone-closed.yml
Q | A |
---|---|
Version(s) | 2.1.0 |
In case, platform requirements are being ignored, the composer v2 plugin does not properly pass those arguments to the lock-Update command.
When executing composer update --prefer-lowest --prefer-stable --ignore-platform-req=php
on PHP 8.0, it is most likely the case, that a version of a package is being installed which is not compatible with PHP 8.0.
As of the base functionality of the composer v2 plugin, we have to update the composer.lock
after the command mentioned above has finished.
The composer update --lock
command needs those Arguments which are used to ignore platform requirements aswell.
https://travis-ci.com/github/laminas/laminas-servicemanager/jobs/456178037#L639
Downgrade works and installs laminas/laminas-code
v3.3.1 even tho it does not support PHP 8.0.
Q | A |
---|---|
Self | 2.1.2 |
OS | Ubuntu 20.04 |
PHP | 7.4.3 (fpm/cli) |
Composer | 1.10.20 |
Installation of this plugin or any other package that relies on this fails with a No such file or directory
error.
See Above.
laminas / laminas-dependency-plugin
Other Steps:
6. Add a requirement of another project that requires this - example: magento
7. Run composer install
8. Install fails on error mentioned above
Steps done to troubleshoot:
Installation of package.
Q | A |
---|---|
Version(s) | 1.0.1 |
Have a project with the dependency plugin installed, and when I try to run composer require laminas/laminas-db --dev
I get an ErrorException:
[ErrorException]
array_shift() expects parameter 1 to be array, boolean given
Current behavior is above.
Described above.
Composer should install the laminas/laminas-db
package.
Looking at the source, there appears to be a case where an assignment operator is used where a comparison operator should be used instead: https://github.com/laminas/laminas-dependency-plugin/blob/master/src/DependencyRewriterPlugin.php#L230
If I manually edit that file and change that assignment to a ==
comparison operator, the composer require
command is successful.
Q | A |
---|---|
New Feature | yes |
RFC | no |
BC Break | no (hopefully?) |
Currently this package can only be installed with Composer versions <2.6.0 which bumped the Composer plugin API version to 2.6.0.
Versions prior to 2.3.0 of this package allowed ^2.0 of the composer-plugin-api, but only newer versions added support for PHP 8.2 and 8.3.
Hence, right now you cannot use this package with Composer >= 2.6.0 and PHP >= 8.2.
Q | A |
---|---|
New Feature | yes |
BC Break | maybe ? |
Composer v2 is behind the corner and we should be ready on the day 0, so we need updte this library ASAP.
This PR might be helpful:
Ocramius/PackageVersions#133
Q | A |
---|---|
New Feature | yes |
To be prepared for the december release of PHP 8.0, this repository has some additional TODOs to be tested against the new major version.
In order to make this repository compatible, one has to follow these steps:
composer.json
to provide support for PHP 8.0 by adding the constraint ~8.0.0
composer.json
to drop support for PHP less than 7.3composer.json
to implement phpunit 9.3 which supports PHP 7.3+.travis.yml
to ignore platform requirements when installing composer dependencies (simply add --ignore-platform-reqs
to COMPOSER_ARGS
env variable).travis.yml
to add PHP 8.0 to the matrix (NOTE: Do not allow failures as PHP 8.0 has a feature freeze since 2020-08-04!)Q | A |
---|---|
Version(s) | 2.0.0beta1 |
When using 2.0.0beta1
and issuing a composer update
with version 1 of composer, it throws an AssertionError
:
PHP Fatal error: Uncaught AssertionError: assert($rewriter instanceof DependencySolvingCapableInterface) in /mnt/e/PhpStormProjects/laminas/test-mvc-co2/vendor/laminas/laminas-dependency-plugin/src/DependencyRewriterPluginDelegator.php:69
It only occurs if the corresponding assert.
settings in php.ini
are active.
The execution itself works because DependencyRewriterV1
does implement the method onPreDependenciesSolving
which DependencySolvingCapableInterface
requires.
It seems, that adding implements DependencySolvingCapableInterface
to DependencyRewriterV1
solves the error.
Q | A |
---|---|
Version(s) | 1.0.0 |
Gonna update this as the outdated part below this report was due to a misconfiguration of satis.
However, I've pointed out, that private packagists packages.json
provides the information for lazy providers
. Those lazy providers are not properly resolved by @composer.
Ive created a pull request in composer/composer#8516 which solves the issue in resolving package names for private packagist.
With {"packagist.org": false}
in the repositories
property of composer.json
, the DependencyRewriterPlugin
does not properly overwrite the package
property in the install
operation if an external repository provides a packages.json
with a providers-lazy-url
property.
Only with private packagist on-premise installation. Therefore not possible to reproduce without that.
NOTE If you remove {"packagist.org": false}
, the migration works as expected.
laminas/laminas-escaper
is being installed instead of zendframework/zend-escaper
.
Hey guys, as already talked about this on slack, I was finally able to reproduce the whole thing with satis.
I found out, that, if packagist.org
is explicitly excluded in composer.json
, something is wrong with the dependency resolver of composer (or at least it behaves different).
Actually, I did not found the issue in composer as I am not able to debug this without more insights which probably takes too long to achieve. Probably you guys already got some debugging stuff prepared somewhere or we can delegate this directly to @composer.
I prepared 2 repositories on github.
https://github.com/boesing/laminas-migration-base - mimics a project which has to get migrated (I already "executed" the migration script)
https://github.com/boesing/laminas-migration-testing - an "external" library which requires old zendframework
packages
You can find a README.md with a step-by-step guide to reproduce the different behavior.
Q | A |
---|---|
Version(s) | 2.0.0beta1 |
composer check throws LogicException
composer check -vvv
Reading ./composer.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/var/www/html): git branch -a --no-color --no-abbrev -v
Executing command (/var/www/html): git rev-list master..feature-FB-213/composer-2.0
Failed to initialize global composer: Composer could not find the config file: /root/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Reading /var/www/html/vendor/composer/installed.json
Loading plugin PackageVersions\Installer
Loading plugin Laminas\ComponentInstaller\ComponentInstaller
Loading plugin Laminas\DependencyPlugin\DependencyRewriterPluginDelegator
Activating Laminas\DependencyPlugin\DependencyRewriterV2
Running 2.0.2 (2020-10-25 23:03:59) with PHP 7.4.11 on Linux / 5.4.0-47-generic
> pre-command-run: Laminas\DependencyPlugin\DependencyRewriterPluginDelegator->onPreCommandRun
In Laminas\DependencyPlugin\DependencyRewriterV2::onPreCommandRun
[LogicException]
A package can only be added to one repository
Exception trace:
() at phar:///usr/local/bin/composer/src/Composer/Package/BasePackage.php:136
Composer\Package\BasePackage->setRepository() at phar:///usr/local/bin/composer/src/Composer/Repository/ArrayRepository.php:194
Composer\Repository\ArrayRepository->addPackage() at phar:///usr/local/bin/composer/src/Composer/Repository/ArrayRepository.php:41
Composer\Repository\ArrayRepository->__construct() at phar:///usr/local/bin/composer/src/Composer/Repository/RootPackageRepository.php:28
Composer\Repository\RootPackageRepository->__construct() at phar:///usr/local/bin/composer/src/Composer/Command/CheckPlatformReqsCommand.php:65
Composer\Command\CheckPlatformReqsCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:245
Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:835
Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:185
Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:309
Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:121
Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:63
require() at /usr/local/bin/composer:24
check-platform-reqs [--no-dev]
or
composer why laminas/laminas-dependency-plugin -vvv
Reading ./composer.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/var/www/html): git branch -a --no-color --no-abbrev -v
Executing command (/var/www/html): git rev-list master..feature-FB-213/composer-2.0
Failed to initialize global composer: Composer could not find the config file: /root/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Reading /var/www/html/vendor/composer/installed.json
Loading plugin PackageVersions\Installer
Loading plugin Laminas\ComponentInstaller\ComponentInstaller
Loading plugin Laminas\DependencyPlugin\DependencyRewriterPluginDelegator
Activating Laminas\DependencyPlugin\DependencyRewriterV2
Running 2.0.2 (2020-10-25 23:03:59) with PHP 7.4.11 on Linux / 5.4.0-47-generic
> pre-command-run: Laminas\DependencyPlugin\DependencyRewriterPluginDelegator->onPreCommandRun
In Laminas\DependencyPlugin\DependencyRewriterV2::onPreCommandRun
[LogicException]
A package can only be added to one repository
Exception trace:
() at phar:///usr/local/bin/composer/src/Composer/Package/BasePackage.php:136
Composer\Package\BasePackage->setRepository() at phar:///usr/local/bin/composer/src/Composer/Repository/ArrayRepository.php:194
Composer\Repository\ArrayRepository->addPackage() at phar:///usr/local/bin/composer/src/Composer/Repository/ArrayRepository.php:41
Composer\Repository\ArrayRepository->__construct() at phar:///usr/local/bin/composer/src/Composer/Repository/RootPackageRepository.php:28
Composer\Repository\RootPackageRepository->__construct() at phar:///usr/local/bin/composer/src/Composer/Command/BaseDependencyCommand.php:77
Composer\Command\BaseDependencyCommand->doExecute() at phar:///usr/local/bin/composer/src/Composer/Command/DependsCommand.php:55
Composer\Command\DependsCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:245
Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:835
Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:185
Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:309
Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:121
Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:63
require() at /usr/local/bin/composer:24
depends [-r|--recursive] [-t|--tree] [--] <package> [<constraint>]
I am not sure it is a composer
bug or laminas-dependency-plugin
De require voor de composer-plugin-api in v2.3.0 is more strict then it was in v2.2.0:
v2.2.0:
"composer-plugin-api": "^1.1 || ^2.0",
v2.3.0:
"composer-plugin-api": ">=1.1.0 <2.3.0",
This gives issues because v2.3.0 can't be installed. Could this be reverted, or, if there is a reason for this lock-in, could it be explained?
Q | A |
---|---|
laminas/laminas-dependency-plugin | 2.6.0 |
with composer install on php8.3 with composer 2.6.6, your package Laminas-dependency-plugin is locked :
Problem 1
- Root composer.json requires laminas/laminas-dependency-plugin ^2.6.0 -> satisfiable by laminas/laminas-dependency-plugin[2.6.0].
- laminas/laminas-dependency-plugin 2.6.0 requires composer-plugin-api >=1.1.0 <2.3.0 -> found composer-plugin-api[2.6.0] but it does not match the constraint.
this is the require library in my composer.json:
"require": {
"php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
"laminas/laminas-component-installer": "^3.4.0",
"laminas/laminas-mvc": "^3.7.0",
"laminas/laminas-development-mode": "^3.12.0",
"laminas/laminas-cache-storage-adapter-apcu": "^2.5",
"laminas/laminas-cache-storage-adapter-redis": "^2.7.0",
"laminas/laminas-cache-storage-adapter-memory": "^2.3.0",
"laminas/laminas-cache-storage-adapter-session": "^2.5.0",
"laminas/laminas-json-server": "^3.9.0",
"laminas/laminas-cli": "^1.10.0",
"laminas/laminas-mvc-i18n": "^1.2.0",
"laminas/laminas-mvc-plugins": "^1.2.0",
"laminas/laminas-psr7bridge": "^1.11.0",
"laminas/laminas-di": "^3.13.0",
"laminas/laminas-permissions-acl": "^2.16.0",
"laminas/laminas-dependency-plugin": "^2.6.0",
"laminas/laminas-cache-storage-deprecated-factory": "^1.2.0",
"laminas/laminas-servicemanager": "^3.22"
},
we want install laminas/laminas-dependancy-plugin at the last version with the last version of php and composer.
Tks for this resolving
Q | A |
---|---|
Version(s) | 2.1.0 |
I am actually working on laminas/laminas-servicemanager
and get code issues which were fixed with laminas-code 3.3.1.
The composer.json
I am working with contains:
{
"conflict": {
"laminas/laminas-code": "<3.4.0"
}
}
laminas/laminas-servicemanager#64
This should block the installation of the currently installed laminas/laminas-code
3.3.0.
laminas/laminas-code
v3.3.0 is installed even tho it is conflicting with the composer.json
of the project.
zendframework/zend-code
is required by a 3rd-party dependency and rewritten by this plugin.
composer update --prefer-lowest
More details following.
Minimum version of laminas/laminas-code
would be v3.4.0 as below is conflicting.
I am using Composer Version 2.6.5 and encounter this issue when attempting to install latest version (2.6.0):
laminas/laminas-dependency-plugin 2.5.0 requires composer-plugin-api >=1.1.0 <2.3.0 -> found composer-plugin-api[2.6.0] but it does not match the constraint.
Q | A |
---|---|
Version(s) | ^2.5.0 |
composer require laminas/laminas-dependency-plugin:^2.5
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.