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.
Related
Hi i'm new to laravel socialite,when i run the command php artisan config:cache to update the .env file i get this error: Call to undefined method Laravel\Socialite\Facades\Socialite::isDeferred();
composer require laravel/socialite
Using version ^5.1 for laravel/socialite
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 6 installs, 0 updates, 0 removals
Installing ralouphie/getallheaders (3.0.3): Loading from cache
Installing guzzlehttp/psr7 (1.7.0): Loading from cache
Installing guzzlehttp/promises (1.4.0): Loading from cache
Installing guzzlehttp/guzzle (7.2.0): Loading from cache
Installing league/oauth1-client (v1.8.2): Loading from cache
Installing laravel/socialite (v5.1.0): Loading from cache
'C:\xampp\htdocs\matatu6.0\vendor/laravel/socialite/59c666443f49cf231e2c48e7a17aefd5' is not a zip archive.
Unzip with ZipArchive class failed, falling back to unzip command
Failed to download laravel/socialite from dist: Failed to execute (9) unzip -qq -o "C:\xampp\htdocs\matatu6.0\vendor/laravel/socialite/59c666443f49cf231e2c48e7a17aefd5" -d "C:\x
ampp\htdocs\matatu6.0/vendor/composer/5556bc2b"
[C:\xampp\htdocs\matatu6.0\vendor/laravel/socialite/59c666443f49cf231e2c48e7a17aefd5]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of C:\xampp\htdocs\matatu6.0\vendor/laravel/socialite/59c666443f49cf231e2c48e7a17aefd5 or
C:\xampp\htdocs\matatu6.0\vendor/laravel/socialite/59c666443f49cf231e2c48e7a17aefd5.zip, and cannot find C:\xampp\htdocs\matatu6.0\vendor/laravel/socialite/59c666443f49cf231
e2c48e7a17aefd5.ZIP, period.
Now trying to download from source
Installing laravel/socialite (v5.1.0): Cloning 14082c6651 from cache
guzzlehttp/psr7 suggests installing laminas/laminas-httphandlerrunner (Emit PSR-7 responses)
guzzlehttp/guzzle suggests installing ext-intl (Required for Internationalized Domain Name (IDN) support)
Package jakub-onderka/php-console-color is abandoned, you should avoid using it. Use php-parallel-lint/php-console-color instead.
Package jakub-onderka/php-console-highlighter is abandoned, you should avoid using it. Use php-parallel-lint/php-console-highlighter instead.
Writing lock file
Generating optimized autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump
#php artisan package:discover --ansi
In ProviderRepository.php line 149:
Call to undefined method Laravel\Socialite\Facades\Socialite::isDeferred()
Script #php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
Installation failed, reverting ./composer.json to its original content.
update: upgrading from the laravel 5 way of declaring provide class in config/app, this ended up conflicting with laravel 6 package auto discovery, therefore causing even php artisan config:clear and composer dump-autoload not to work. removing 'Socialite' => Laravel\Socialite\Facades\Socialite::class in config/app.php solved this issue and re-installing the socialite package
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.
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 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.
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