senither / version-comparison
Compares current git commit SHA with a remotely tracked version to see if the application is outdated
Installs: 2 065
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^7.4|^8.0
- illuminate/contracts: ^8.0|^9.0
Requires (Dev)
- tightenco/tlint: ^6.0
README
A Laravel package that compares the current git commit SHA with a remotely tracked version to see if the application is outdated, this is used in some of my projects to allow users to see when their instance of my software is out of date.
Note: The project relies on private version tracking software, it will not do anything without a tracking ID the system can use to compare commit SHAs.
Installation
You can install the package via composer:
composer require senither/version-comparison
You can publish the config file with:
php artisan vendor:publish --provider="Senither\VersionComparison\VersionComparisonServiceProvider" --tag="config"
This is the contents of the published config file:
return [ /* |-------------------------------------------------------------------------- | Version Tracking ID |-------------------------------------------------------------------------- | | The unique ID for the project that the latest git commit SHA | should be compared with via the API, this can be found on | the version tracker when selecting the project. | | @url https://vt.senither.com/dashboard */ 'id' => env('VERSION_COMPARISON_ID', null), /* |-------------------------------------------------------------------------- | Cache Expiration Times |-------------------------------------------------------------------------- | | The amount of time in seconds that should elapse before | the current commit hash is refreshed, or the latest | version is fetched from the API. | */ 'cache_time' => [ 'version' => 7200, 'commit_hash' => 3600, ], ];
Usage
use Senither\VersionComparison\Facades\Version; // Gets the current version Version::getCurrentVersion();
License
The Version Comparison package open-sourced software licensed under the MIT license.