I regularly run composer update in my project and then check what dependencies were updated. But today I noticed a strange output:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 2 updates, 0 removals
- Updating phpdocumentor/type-resolver (0.4.0 => 0.3.0): Downloading (100%)
- Updating phpdocumentor/reflection-docblock (3.2.0 => 3.2.1): Downloading (100%)
Writing lock file
You can see that the phpdocumentor/type-resolver package was downgraded from 0.4.0 to 0.3.0, though the command was update.
Is it normal or a bug or whatever?
It seems I've found the answer. It is in this commit: Downgrade phpdocumentor/type-resolver to 0.3
In order to restore a bc break made in 3.2.0 I downgraded the
type-resolver. This makes the version less compatible with php 7.1
But will help our users to upgrade.
Indeed phpdocumentor/type-resolver is a dependency of phpdocumentor/reflection-docblock and its maintainer deliberately downgraded the type-resolver. So everything's normal. And it's not a composer bug. It was just the first time I saw such a behavior, that's why I found it strange.
Related
I'm trying to install the package maddhatter/laravel-fullcalendar (Laravel helper for FullCalendar.io) with composer.
So here is the command I run:
'''
php ../../composer.phar require maddhatter/laravel-fullcalendar
'''
And here is the result:
Using version ^1.3 for maddhatter/laravel-fullcalendar
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Installing maddhatter/laravel-fullcalendar (v1.3.0): Downloading (100%)
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
php artisan clear-compiled
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined method Illuminate\Foundation\Application::getCachedCompilePath()
Script php artisan clear-compiled handling the post-update-cmd event returned with error code 255
But now I wonder if the package is installed or not, because it now appears in my list of installed packages.
If anyone has the answer, thanks in advance.
Try to delete file compiled.php in your vendor directory manually, and then it started to work again.
I face this case when I want to download any package in laravel
However, the package is downloaded
but I don't Know if it will cause a problem in the future.
C:\xampp\htdocs\final2>composer require "laravelcollective/html":"^5.4.0"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
The 'http://repo.packagist.org/p/fideloper/proxy%24de6ed8cb77cc53bdea76e3b52aa1
7a7e3cb93f816873ede7f13eba172a9059d.json' URL could not be accessed: HTTP/1.1 4
0 Bad URI
http://repo.packagist.org could not be fully loaded, package information was lo
ded from the local cache and may be out of date
Package operations: 1 install, 0 updates, 0 removals
- Installing laravelcollective/html (v5.5.4): Downloading (100%)
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. N
replacement was suggested.
Writing lock file
Generating optimized autoload files
I'm updating some packages with composer. I'm using Laravel5.6 in my project.
The one that I'm trying is PHPStan to version 0.10.7. My current version is 0.9.2.
The problem
When I try to update, it shows a success message, but when checking the outdate packages output, it is still OUTDATED.
What I've tried
Using composer why-not phpstan/phpstan 0.10.7 gave me the following output:
laravel/laravel my-branch-test requires (for development) phpstan/phpstan (^0.9.2)
phpstan/phpstan 0.10.7 requires nikic/php-parser (^4.0.2)
laravel/laravel my-branch-test does not require nikic/php-parser (but v3.1.5 is installed)
phpstan/phpstan 0.10.7 requires phpstan/phpdoc-parser (^0.3)
laravel/laravel my-branch-test does not require phpstan/phpdoc-parser (but 0.2 is installed)
Then I tried to update nikic/php-parser and phpdoc-parser and re-run composer update phpstan/phpstan but it gave me the same result of before. (not updating)
UPDATE: running composer update phpstan/phpstan --with-dependencies gave me the following output:(but still didn't updated phpstan)
composer update phpstan/phpstan --with-dependencies
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 11 updates, 0 removals
- Updating ocramius/package-versions (1.2.0 => 1.3.0): Loading from cache
- Updating symfony/finder (v4.1.4 => v4.2.1): Loading from cache
- Updating symfony/polyfill-mbstring (v1.9.0 => v1.10.0): Loading from cache
- Updating jean85/pretty-package-versions (1.1 => 1.2): Loading from cache
- Updating nette/utils (v2.4.9 => v2.5.3): Loading from cache
- Updating nette/php-generator (v3.0.2 => v3.0.5): Loading from cache
- Updating nette/neon (v2.4.2 => v2.4.3): Loading from cache
- Updating nette/di (v2.4.10 => v2.4.14): Loading from cache
- Updating nette/bootstrap (v2.4.5 => v2.4.6): Loading from cache
- Updating nette/finder (v2.4.1 => v2.4.2): Loading from cache
- Updating nette/robot-loader (v3.0.3 => v3.1.0): Loading from cache
Package sebastian/git is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> #php artisan package:discover
Discovered Package: barryvdh/laravel-debugbar
Discovered Package: caffeinated/modules
Discovered Package: fideloper/proxy
Discovered Package: jenssegers/agent
Discovered Package: laravel/tinker
Discovered Package: rap2hpoutre/laravel-log-viewer
Discovered Package: rcrowe/twigbridge
Package manifest generated successfully.
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Code
In my composer.json file, the package is listed as:
"require-dev": {
"phpstan/phpstan": "^0.9.2",
Any ideas?
The problem here was that others packages that I was using were using the nikic/php-parser package too, but considering only non-breaking changes (nikic/php-parser":"^3.0"), "blocking" the upgrade to > 4.0.
Because of composer can't install two versions of the same package, my solution was not updating phpstan for now.
I will wait for the libs that require nikic/php-parser to update their requirements to 4.0 and up or will change these packages in the future.
When I install a Symfony 4 skeleton project and add the JmsSerializerBundle, I get an error.
To reproduce:
composer create-project symfony/website-skeleton myproject
cd myproject
composer require jms/serializer-bundle
The installation ends with an error:
Using version ^3.0 for jms/serializer-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.1.*"
Package operations: 16 installs, 0 updates, 0 removals
- Installing hoa/exception (1.17.01.16): Loading from cache
- Installing hoa/event (1.17.01.13): Loading from cache
- Installing hoa/consistency (1.17.05.02): Loading from cache
- Installing hoa/visitor (2.17.01.16): Loading from cache
- Installing hoa/ustring (4.17.01.16): Loading from cache
- Installing hoa/protocol (1.17.01.14): Loading from cache
- Installing hoa/zformat (1.17.01.10): Loading from cache
- Installing hoa/iterator (2.17.01.10): Loading from cache
- Installing hoa/compiler (3.17.08.08): Loading from cache
- Installing hoa/regex (1.17.01.13): Loading from cache
- Installing hoa/math (1.17.05.16): Loading from cache
- Installing hoa/stream (1.17.02.21): Loading from cache
- Installing hoa/file (1.17.07.11): Loading from cache
- Installing jms/metadata (2.0.0): Loading from cache
- Installing jms/serializer (2.0.0): Loading from cache
- Installing jms/serializer-bundle (3.0.0): Loading from cache
Writing lock file
Generating autoload files
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Symfony operations: 1 recipe (f702450e5b1b913f83ea887faacbdb83)
- WARNING jms/serializer-bundle (>=2.0): From github.com/symfony/recipes-contrib:master
The recipe for this package comes from the "contrib" repository, which is open to community contributions.
Review the recipe at https://github.com/symfony/recipes-contrib/tree/master/jms/serializer-bundle/2.0
Do you want to execute this recipe?
[y] Yes
[n] No
[a] Yes for all packages, only for the current installation session
[p] Yes permanently, never ask again for this project
(defaults to n): y
- Configuring jms/serializer-bundle (>=2.0): From github.com/symfony/recipes-contrib:master
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 1
!!
!! In ArrayNode.php line 304:
!!
!! Unrecognized option "xml" under "jms_serializer.visitors"
Running composer etc on Windows 10 Powershell. I'm guessing the skeleton is too bare and it needs a dependency, but shouldn't that be solved automatically?
What could be the cause? How can I fix it? Thanks in advance for your help.
The current recipe is not compatible with JMSSerializerBundle 3 (there is a pending pull request, see https://github.com/symfony/recipes-contrib/pull/559). So for now, you need to adapt the configuration manually.
I am using Symfony 3.0.9 with FosUserBundle to build my app. I recently did a composer update and now I cannot create users via UserManager or command line. The error is Integrity constraint violation: 1048 Column 'salt' cannot be null. This error occurs even when I explicitly call parent::__construct() in my constructor method as show below:
/**
* constructor.
*/
public function __construct()
{
parent::__construct();
}
And also fails if I called the setSalt method like $user->setSalt('87234hjjdwshjdsjkds')
All efforts to resolve this have failed so I started to pay close attention to my composer update command and this was some of the output:
Updating dependencies (including require-dev)
Removing twig/twig (v1.24.1)
Installing twig/twig (v1.28.2)
Loading from cache
Removing symfony/polyfill-util (v1.2.0)
Installing symfony/polyfill-util (v1.3.0)
Loading from cache
...
Removing symfony/polyfill-intl-icu (v1.2.0)
Installing symfony/polyfill-intl-icu (v1.3.0)
Loading from cache
Removing psr/log (1.0.0)
Installing psr/log (1.0.2)
Loading from cache
Removing doctrine/cache (v1.6.0)
Installing doctrine/cache (v1.6.1)
Loading from cache
...
Removing doctrine/orm (v2.5.4)
Installing doctrine/orm (v2.5.5)
Loading from cache
Removing sensiolabs/security-checker (v3.0.2)
Installing sensiolabs/security-checker (v4.0.0)
Loading from cache
Removing nikic/php-parser (v2.1.0)
Installing nikic/php-parser (v2.1.1)
Loading from cache
...
Removing doctrine/doctrine-migrations-bundle (1.1.1)
Installing doctrine/doctrine-migrations-bundle (v1.2.0)
Loading from cache
...
Removing phpspec/phpspec (2.5.1)
Installing phpspec/phpspec (2.5.5)
Loading from cache
Removing doctrine/data-fixtures (v1.2.1)
Installing doctrine/data-fixtures (v1.2.2)
Loading from cache
Updating friendsofsymfony/user-bundle dev-master (147ca68 => 7261f7a)
Checking out 7261f7aa143b4bfdb0b7ddc5df208067fa7be698
As you can see FOSUSERBUNDLE was updated.
Reverting the composer update, deleting my vendor directory and running composer install fixes it. This summed it down to the update. That was the problem.
If anyone knows how I can update and still have a working application I would be grateful for your comments and feedback.
1) If you want to use FOSUserBundle in version 2 there is no final/stable version - so you always have to expect breaking changes in a dev/master branch.
2) Since a couple of days there is a 2.0.0 Beta version at least which I heavily recommend to use in your case: Check it here.
3) There were a couple of changes regarding the User Database Schema, e.g a couple of unused fields were removed. And there is a change regarding the salt field - so in your case - as far as I can see probably the missing thing is to update your database schame (if you're working with Doctrine call bin/console doctrine:schema:update --force).
For details see e.g. the release notes for 2.0.0 beta:
[BC break] The salt field of the User class is now nullable.
If you want update everything but user-bundle
With composer you may pass package name(s) as parameter to composer update command, like this:
composer update vendor1/package1 vendor2/package2
So you can create long string of all packages except user-bundle.
List of all oudated packages you can get from
composer show -o --name-only
command output.
The option -o here is for only outdated packages which are available for update.
Option --name-only obviously shows only package name without version and description.
So, on unix-like OS you can run something like
composer show -o --name-only | grep -v 'friendsofsymfony/user-bundle' | xargs composer update
More about Composer CLI