ministryofjustice / opg-core-health-check
OPG Core Health Check ZF2 Module
Installs: 2 699
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 68
Forks: 0
Open Issues: 1
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
This module provides zend services related to checking the health of the other opg core applications, specifically opg-core-back-end, opg-core-front-end and opg-core-auth-membrane
Installation
- Install this module as a dependency on your zf2 project via Composer. If you don't have composer then follow the steps to download it from their site: https://getcomposer.org/download/
- register module with your application
Your composer.json
should look something like this
{
"repositories": [
{
"type": "vcs",
"url": "git@github.com:ministryofjustice/opg-core-health-check.git"
}
],
"require": {
"ministryofjustice/opg-core-health-check": "1.0.*",
}
}
Your config/application.config.php
should look something like this
$modules = array(
...
'HealthCheck',
);
Usage
Example controller action: uses the environmental variables checker service and returns error 500 and json error if there are any missing.
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(); }
Testing
- Clone it.
- Install dependencies via composer. If you don't have composer then follow the steps to download it from their site: https://getcomposer.org/download/
- run PHPUnit.
git clone git@github.com:ministryofjustice/opg-core-health-check.git
cd opg-core-health-check.git
composer install
php ./vendor/bin/phpunit
Contributing
- Clone it.
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
History
2015-04-16: Repository repurposed as a zf2 module from original empty zf2 skeleton app