Which version is my SDK-X PHP Composer package? - php

So I did composer update and now my dependencies updated to the latest version.
I have a copy of my repo locally with the same vendor dependency - how do I find out what exact version this package is so I can update my composer.json to pull the older working version?

Guess the answer is:
composer show -i

Related

How to downgrade or install a specific version of Composer?

I'm getting the following error in a project I'm setting up:
You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.
I've started at a new company this week, just trying to get their projects installed and there doesn't seem to be a way to change my composer version on Windows. I'd rather not update all their packages as I'm not familiar with the projects yet and have no clue what kind of implications go into that.
Assuming a regular composer installation, to rollback to version 1 of composer, you simply execute:
composer self-update --1
When you want to go back to version 2 (which you should, after updating or removing the incompatible plugins):
composer self-update --2
The above will take you to the latest on any of the two major versions.
You can also "update" to a specific version just by passing the version number to self-update:
composer self-update 1.10.12
composer self-update 2.0.7
After performing any self-update, you can specify --rollback to go back to the previously installed version.
composer self-update
composer self-update --rollback
Finally, if you are feeling adventurous, you can update to a pre-release version by executing:
composer self-update --preview
If you have already installed composer on your system. then paste the below code to downgrade the composer version with a specific version as per your need.
composer self-update 1.10.14
for ubuntu system use the below command
sudo -H composer self-update 1.10.14
Just two commands worked for me. Currently I have composer 2.x.x , I had 1.10.x . First one command will download downgrade version and then second command will rollback to 1.x.x
php composer self-update --1
composer self-update --rollback
I found a flag in composer installer "--1" and "--2".
I'm using this command inside of my Dockerfile:
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --1
You can use following code for update to specific versions
composer self-update 1.10.12
composer self-update 2.0.7
or
composer self-update --1 or 2
The below command is used to update the specific version of the composer.
composer self-update [version no of composer]
Use phar instead.
Download specific version of composer.phar file from :
https://getcomposer.org/download
Place this phar file in your project root directory where you are trying to run composer install/update/require
now instead of composer require use php composer.phar require

Wordpress Roots Bedrock Composer Update

Does anyone know if Wordpress Roots Bedrock Composer updates the Wordpress version? I have tried composer update but it doesn't update the Wordpress version. Any help will be highly appreciated.
Thanks,
Danish.
Wordpress is treated as a required dependency by composer, so yes. It is updated when you run composer update.
You can check if your composer packages are outdated with: composer outdated (or composer show -l). Each package will be listed showing the desired version (the version number specified in composer.json) and the current released version.
Running composer update, (or composer.phar update) will update each package to your specified version. If you want to update the package to the latest version, but you're unaware of the current version number. You can remove the package, and then add it back in. Composer will add the package to your required dependency list with the latest version.

How can I get the Package version from a composer package

I am currently dealing with something with the php composer theme. I have some github projects installed using composer and loaded with the autoload. Now I would like to find in my PHP code the current version number and packagename. How can I do that?
thanks
bjoern
After installing the dependencies, Composer writes the list of the exact versions it installed into a composer.lock file. You can parse composer.lock file to get version numbers and package names for all project's dependencies.

How to update Composer in Windows 10

I am using Composer for my PHP project. I am new to Composer. Now when I update my dependencies using composer update command, it is saying that my Composer version is too old and ask me to update. So I tried as below. But all failed.
My composer.phar file is in C:/ProgramData/ComposerSetup/bin/composer.phar
I opened terminal and tried
composer.phar update
php composer.phar update
composer C:/ProgramData/ComposerSetup/bin/composer.phar update
php composer C:/ProgramData/ComposerSetup/bin/composer.phar update
When I run composer-self-update, error as in screenshot.
All command failed. I am using XAMPP. There is no composer.phar file in xampp/php folder as well. How can I update Composer in Windows 10?
Try
composer self-update
If this doesn't work check your PATH variable, if it's not there try searching composer.bat in windows and add it to your PATH variable. Normally, its in following path.
C:\ProgramData\ComposerSetup\bin
Windows 10 update for Composer still works (end of 2020, pre version 2) with:
Follow This below Image:
composer self-update --1 it will be updated from 1.x
composer self-update --2 it will be updated from 2.x and from 1.x
composer self-update --rollback If you need to rollback to your previous version
composer -V For check your composer version
composer self-update:
If you run composer self-update from 1.x, it will warn you that a new stable major version of Composer is available, and you can use composer self-update --2 to migrate to it.
So run composer self-update --2
How easy is it to upgrade?
Composer 2.0 still supports PHP 5.3 and above, much like Composer 1.x
composer.lock files are interoperable between versions, so you can
upgrade to 2.0 and roll back easily if needed.
Most commands and arguments remain the same, and largely what you
know about Composer remains true in 2.0.
Windows 10 update for Composer still works (end of 2020, pre version 2) with:
composer self-update
If you need to rollback to your previous version, you can do that with:
composer self-update --rollback
Try.
php composer.phar self-update
'update' updates your dependencies not composer itself.
Use
composer self-update --2
By default, the installer and composer self-update will download the latest stable version only.
To programmatically install specific major versions you can use the --1 or --2 flag.
To go back to the previous version:
composer self-update --rollback
To check the current version
composer --version

Laravel 4.2 install on windows

I want to install Laravel 4.2 installation some packages via Composer. However, I am getting an error
“failed to clone git#github.com:symphony/Translation.git.git was not found. Check that it is installed in your path env. ‘git’ is not recognized as an internal or external command”
I want to use version 4.2.0 which is an older version of laravel. I’m successful to download if I do not mention version number but not when I include version number.
I tried:
C:\xampp\htdocs\laravel composer create-project laravel/laravel newapp 4.2 –prefer-dist
Or
C:\xampp\htdocs\laravel composer create-project laravel/laravel newapp –prefer-dist 4.2.0
Or
C:\xampp\htdocs\laravel composer create-project laravel/laravel newapp –prefer-dist 4.2.*
Or
C:\xampp\htdocs\laravel composer create-project laravel/laravel {{newapp}} 4.2.* –prefer-dist *
All with same error...
What do I need to make it work? Do I need to install git but How? i have no idea thanks for your help.
Note:I have latest composer downloaded yesterday July 24
Why do you want to use an old and not updated version of Laravel?
The first one is the correct way to install Laravel with composer/create-project.
Can you try to clone the laravel/laravel repository and to run composer udpate?
Lynda was a good source of information for me to learn Laravel(4.2) and if I recall there was a course that went into detail on installing Laravel on Windows, I could be wrong but if you have Git installed already you will also need to add it as a variable in your Paths to be used in your prompts.
The link below should help you in setting the Paths to Git and they should be something along these lines.
;"C:\path\git\bin";"C:\path\git\cmd"
http://www.computerhope.com/issues/ch000549.htm
I bullishly downloaded and installed GIT not knowing option to choose (used command prompt option) as Romain suggested , reboot and retried and it worked. Lynda indeed have a chapter on installation but did not mention Git so following instruction failed. Note: only trying previous version failed, was ok for latest laravel 5 version before installation of Git. Thank you all...one day lost of trying and testing but happy ending :)

Categories