ecoapm / libyear
A simple measure of software dependency freshness
Installs: 128 274
Dependents: 1
Suggesters: 0
Security: 0
Stars: 19
Watchers: 1
Forks: 7
Open Issues: 2
Requires
- php: >=7.4
- ext-json: >=7.4
- composer/semver: 3.3.2
- guzzlehttp/guzzle: 7.5.0
- wp-cli/php-cli-tools: 0.11.16
Requires (Dev)
- mockery/mockery: 1.5.1
- phpunit/phpunit: 9.5.27
README
A simple measure of dependency freshness
Calculates the total number of years behind their respective newest versions for all dependencies listed in composer.json
.
Requirements
- PHP v7.4 or later
- Composer v2
Note that 2.3.0 is the last release that will support PHP 7.4 and 8.0; v3 (expected Q3 2023) will only support PHP 8.1+.
Ongoing commercial support for legacy versions of PHP is available for Corporate, Premier, and Title Sponsors.
Installation
Recommended: Composer
Run composer global require ecoapm/libyear
and make sure your global composer directory is in your $PATH
.
Alternatively, composer require --dev ecoapm/libyear
will add libyear
as a local dev dependency for your current directory's app.
Alternative: PHP Archive (PHAR) File
Download libyear.phar
from the latest release, and put it in the current directory, or somewhere in your $PATH
to be able to reference it from anywhere.
Windows Users
Note that PHP for Windows does not include CA certificates, so you'll need to install them if you haven't done so already:
- Download http://curl.haxx.se/ca/cacert.pem to somewhere permanent (PHP's
extras
directory is a great place) - Add
curl.cainfo = "[full path to]\cacert.pem"
to yourphp.ini
file
Usage
vendor/bin/libyear <path> [-q|--quiet] [-v|--verbose]
(or php path/to/libyear.phar <path> [-q|--quiet] [-v|--verbose]
for the PHAR version)
Arguments:
path
: required, directory containingcomposer.json
andcomposer.lock
files
Options:
-h
,--help
: show help text and exit without checking dependencies-q
,--quiet
: quiet mode will only output libraries which are not up-to-date (that is, where "Libyears Behind" > 0)-u
,--update
: update mode will write the latest version info to yourcomposer.json
file (note that you'll still need to runcomposer update
to actually update your local dependencies)-v
,--verbose
: verbose mode will output processing details like when a library isn't found in a repository
Contributing
Please be sure to read and follow ecoAPM's Contribution Guidelines when submitting issues or pull requests.
When testing new features and bug fixes, you can run the script via ./libyear { path } [-q]
before building the phar
file.
To build the phar
file for final manual testing, run php -dphar.readonly=0 build.php
. You may wish to run composer install --no-dev
first to speed up the build process by removing dev dependencies, but will need to reinstall them via composer install
(specifically, phpunit
and mockery
for unit testing).