I have composer.json files on two different branches and I want to compare their (non-dev) dependencies. This is the command I run to compare the “require” section of composer.json on my current branch to the “require” section of composer.json on another branch.
composer
SemVer TLDR
Semantic versioning (SemVer) is a standard for defining the version numbers. A version number consists of three numbers separated by periods (X.Y.Z). The type of change being introduced (e.g. a new feature or a change that breaks backwards compatibility) determines which numbers are incremented.
composer.json and composer.lock out of sync
When I get the “Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.” message, I can update the hash in composer.lock, which is the root of the problem, by running ‘composer update –lock’.
Upgrade Composer – SHA384 is not supported by your openssl extension, could not verify the phar file integrity
Ideally, the PHP package manager Composer can update itself with the command composer self-update Unfortunately, when I ran this command I got [RuntimeException] SHA384 is not supported by your openssl extension, could not verify the phar file integrity This is a known issue (see Composer Issue 7669) but unfortunately the thread does not offer a […]
Composer fail required PHP version
You can tell composer to install dependencies as if you’re using a specific version of PHP. This can be helpful if you’re running composer outside of your virtual machine (and your virtual machine has the correct PHP version but your host machine does not).
Loading a Private WordPress Plugin with Composer
Previously, I described my process in loading WordPress.org plugins via composer, however, a number of plugins I use are private plugins (either because they are commercial plugins I’ve purchased or internal plugins I’ve written). One can use composer to load these plugins by doing two things: Create a repository for the plugin (this can be […]
Install WordPress with Composer
You can setup WordPress in a sub-directory using composer, thanks to John P Bloch‘s WordPress Core Installer. Below I’ve outlined the bare minimum steps to get this running. Step 1: composer.json Create a composer.json in the root of your project with the following content. { “require”: { “johnpbloch/wordpress”: “*” } } Step 2: Execute composer […]
Composer WordPress.org Plugins
I’ve recently been introduced to managing WordPress.org plugins via Composer. This makes it more convenient when excluding plugins from your working repository. Composer is capable of doing far more than managing plugins but at this point, that is the extent of how I’m using it. This allows me to exclude my plugins via .gitignore yet […]