Entries with the tag “composer”
These entries are tagged “composer” which is a PHP package manager.
A composer script is often named after the underlying tool, like phpstan, because that is the binary the script calls.
But what if you or the team always refers to the tool as larastan because that is the plugin or package providing most of the functionality for your project?
“Did Larastan catch that?” asks another programmer, even though composer.json says phpstan.
In the previous tip, I showed you how to list your dependencies’ licenses.
Now let’s make it more useful.
Your project pulls in dozens of dependencies.
Each one has a license.
Do you actually know what you’re shipping?
I use Laravel Nova in a lot of my projects, but I’ve never liked the idea of storing the files in a local directory after download. Yes, you can use credentials for a Composer-based install, true, but I wanted something that didn’t require that. Turns out you can install packages like Laravel Nova from a zip file locally. Here’s how.
There are tons of ways to answer this question each with its own benefits. Let’s check out a few.
Turns out there’s a few different mechanisms to remove a package from your composer project. It’s important to understand what each method does and what its side effects are.
One of the lesser known pieces of functionality from Composer is the ability to create a project from skeleton/scaffolding. This ability allows you to create a project structure, directory, files and requirements based on the suggested setup from the project maintainer. A common installation mechanism of Laravel uses this functionality. (Even I use it to save time and set up my own custom configuration for new project skeletons.)
Just another case of RTFM I’m sure, but I was wondering how to preview the changes that will happen if I do a composer update on my current project. I wanted to get an idea of how many libraries would change so I could see if it would be a short or long project (potentially) to do a 3rd Party Library update. (I already hear you - and I agree - the number of files changing isn’t always indicative of how long the task to update your project’s dependencies will take. Shhh - quiet you.)
I’m a huge fan of tools like PHPUnit. Or any other tool that will help my project carry on.