ministryofjustice / opg-core-health-check
此包已被废弃,不再维护。未建议替代包。
OPG Core Health Check ZF2 模块
1.0.1
2015-06-15 16:10 UTC
Requires
- php: >=5.4
- symfony/http-kernel: 2.6.*
- zendframework/zend-servicemanager: 2.*
- zendframework/zendframework: 2.*
Requires (Dev)
- phpunit/phpunit: 4.0.14
- zendframework/zend-test: 2.*
This package is not auto-updated.
Last update: 2020-01-17 21:03:27 UTC
README
此模块提供与检查其他 opg 核心应用程序健康状况相关的 zend 服务,具体包括 opg-core-back-end、opg-core-front-end 和 opg-core-auth-membrane
安装
- 通过 Composer 将此模块作为 zf2 项目的依赖项安装。如果您没有 composer,请按照他们的网站上的步骤下载: https://getcomposer.org.cn/download/
- 使用应用程序注册模块
您的 composer.json
应该看起来像这样
{
"repositories": [
{
"type": "vcs",
"url": "git@github.com:ministryofjustice/opg-core-health-check.git"
}
],
"require": {
"ministryofjustice/opg-core-health-check": "1.0.*",
}
}
您的 config/application.config.php
应该看起来像这样
$modules = array(
...
'HealthCheck',
);
用法
示例控制器操作:使用环境变量检查服务,如果缺少任何内容,则返回错误 500 和 json 错误。
public function checkEnvVarsAreSetAction() { try { $this->getServiceLocator()->get('EnvironmentVariablesChecker')->check(); } catch (HttpException $e) { // Environment variable(s) missing: $this->getResponse()->setStatusCode($e->getStatusCode()); return new JsonModel(array('error' => $e->getMessage())); } return $this->getResponse(); }
测试
- 克隆它。
- 通过 composer 安装依赖项。如果您没有 composer,请按照他们的网站上的步骤下载: https://getcomposer.org.cn/download/
- 运行 PHPUnit。
git clone git@github.com:ministryofjustice/opg-core-health-check.git
cd opg-core-health-check.git
composer install
php ./vendor/bin/phpunit
贡献
- 克隆它。
- 创建您的功能分支:
git checkout -b my-new-feature
- 提交您的更改:
git commit -am 'Add some feature'
- 推送到分支:
git push origin my-new-feature
- 提交 pull request :D
历史
2015-04-16: 将仓库重用为从原始空 zf2 框架应用程序转换的 zf2 模块