mhapach/projectversions
Composer 安装命令:
composer require mhapach/projectversions
包简介
vcs control of project
README 文档
README
This package is a Laravel (7.0+) utility which helps you keep and manage your project version(increment major, minor version numbers )
And also there is a UI for version checkout from VCS (only git based for a while )
Installation
Before install you need to be sure that git installed on your host
Step 1. Add Eloquent Model Generator to your project via Composer
$ composer require mhapach/projectversions
Set in .env next values
- optional fields
``` bash
#if you will not set it you will be propted to enter you account in Authorisation form for VCS in UI
VCS_LOGIN=Yourlogin
VCS_PASSWORD=YourPassword
#if it true you then access to UI will be through auth middleware, so only authorised users will able to update project
VCS_USE_AUTH_MIDDLEWARE=true
#if VCS_USE_AUTH_MIDDLEWARE is true then in this field enter comma separated ids of users allowed to checkout and update project from VCS
VCS_UPDATE_USERS=1,3
Step 2. Register ProjectVersionsServiceProvider in config/app.php
'providers' => [
//...
\mhapach\ProjectVersions\ProjectVersionsServiceProvider::class,
]
Usage
Use project version in your code. It's very useful when you need prevent loading of js of css libs from cache
Example 1 - getting current version number
print app('project.version');
Example 2 - usage within blade code
<link href="{{ asset('css/app.css') }}?v={{app("project.version")}}" rel="stylesheet">
Easily increment your version numbers, using Artisan commands
php artisan pv:commit
Which should commit last changes into VCS and print the new version number in file
project.info in root folder of project
Make diff zip archive between to commits or using number of last commits
php artisan pv:archive --help
Shows you arguments and options of command pv:archive
Example 1 - make zip archive between to commits
php artisan pv:archive commit_hash1 commit_hash2
Example 2 - make zip archive for last 10 commits
php artisan pv:archive -s 10
Example 3 - make zip archive for last 10 commits and specify path of archive file
php artisan pv:archive -s 10 -p storage/app/git_archives
or
php artisan pv:archive --shift=10 --path=storage/app/git_archives
Example of project.info file
---
{
"Project": "Your megaproject",
"Description": "New build commit",
"Date": "2022-09-02 11:42:09",
"Version": "1.1.2.12345"
}
Examples of usage artisan commands (attention run all examples from root folder of project:
Example 1 (source version 1.1.2.12345-Beta)
Command: php artisan pv:commit versionNumber (the same as: php artisan pv:commit versionNumber=+1)
Result: changes will be commited with descrition "New build commit. Version: 2.0.0.12346-Pre-Alfa"
In svn trunk will be coppied to folder tags with name of new version 2.0.0.1-Pre-Alfa
Example 2 (source version 1.1.2.12345-Beta)
Command: php artisan pv:commit versionNumber=3
Result: changes will be commited with descrition "New build commit. 3.1.2.12346-Beta"
In svn trunk will be coppied to folder tags with name of new version 3.1.2.12346-Beta
Example 3 (source version 1.1.2.12345-Beta)
Command: php artisan pv:commit releaseNumber (the same as: php artisan pv:commit releaseNumber=+1)
Result: changes will be commited with descrition "New build commit. Version: 1.2.0.1-Pre-Alfa"
In svn trunk will be coppied to folder tags with name of new version 1.2.0.1-Pre-Alfa
Example 4 (source version 1.1.2.12345-Beta)
Command: php artisan pv:commit buildNumber (the same as: php artisan pv:commit buildNumber=+1)
Result: changes will be commited with descrition "New build commit. Version: 1.1.3.1-Beta
Example 5 (source version 1.1.2.12345-Beta)
Command: php artisan pv:commit releaseType (the same as: php artisan pv:commit releaseType=+1)
Result: changes will be commited with descrition "New build commit. Version: 1.1.2.12346-Release-Candidate
Example 6 (source version 1.1.2.12345-Beta)
Command: php artisan pv:commit releaseType="Release"
Result: changes will be commited with descrition "New build commit. Version: 1.1.2.12346-Release
Rollback at previous project versions or checkout latest commited version.
It very useful at dev servers where you testing your project and want to make regression testing.
UI interface address
http://yourproject/project_versions
Find out if newest version exists by ajax request - get the json response and use it your javascript
http://yourproject/project_versions/new
Checkout latest VCS version - get the json response and use it your javascript, this command will update tour project till last version
http://yourproject/project_versions/update
Get current version of project
http://yourproject/project_versions/version
Change log
Please see the changelog for more information on what has changed recently.
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email author email instead of using the issue tracker.
Credits
License
license. Please see the license file for more information.
mhapach/projectversions 适用场景与选型建议
mhapach/projectversions 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 190 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 05 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「version」 「project」 「control」 「laravel」 「vcs」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mhapach/projectversions 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mhapach/projectversions 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mhapach/projectversions 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Versioning behaviour for eloquent models
Converts SemVer version (like Composer packages) into integer version with operators. Helps managing versions: store, compare, sort and retrive by conditions.
Provide a way to secure accesses to all routes of an symfony application.
Display a version number
PHP Version Manager for Windows CLI
Obtains the latest version release of Composer Packages from the Packagist API
统计信息
- 总下载量: 190
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-05-18