frostiede/silex-version-serviceprovider
Composer 安装命令:
composer require frostiede/silex-version-serviceprovider
包简介
README 文档
README
ServiceProvider for Silex which enables loading a version file to specify application version.
Installation
$ composer require frostiede/silex-version-serviceprovider
Afterwards, register the ServiceProvider:
$app->register(new VersionServiceProvider(), [ 'version.file' => __DIR__ . '/VERSION' ]);
Usage
You can now use $app['version'] to determine the current application version.
Configuration
You must specify the parameter version.file which holds the path to the VERSION file which is
loaded.
Optional: if you want to add an suffix to the version (e.g. -dev), you can do that, too. Just
specify the option version.suffix. Example:
$app->register(new VersionServiceProvider(), [ 'version.file' => __DIR__ . '/VERSION', 'version.suffix' => $app['debug'] ? 'debug' : '' ]);
This adds the suffix debug in case Silex is in debug mode.
Contribution
Any help is welcomed. Feel free to create issues and merge requests :-)
License
MIT License
统计信息
- 总下载量: 488
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-10-16