2017 © Pedro Peláez
 

library opg-core-health-check

OPG Core Health Check ZF2 Module

image

ministryofjustice/opg-core-health-check

OPG Core Health Check ZF2 Module

  • Thursday, May 24, 2018
  • by ministryofjustice
  • Repository
  • 67 Watchers
  • 0 Stars
  • 125 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

OPG Health Check ZF2 Module

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, (*1)

Installation

  1. 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/
  2. register module with your application

Your composer.json should look something like this, (*2)

{
    "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, (*3)

$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., (*4)

    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

  1. Clone it.
  2. Install dependencies via composer. If you don't have composer then follow the steps to download it from their site: https://getcomposer.org/download/
  3. 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

  1. Clone it.
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

History

2015-04-16: Repository repurposed as a zf2 module from original empty zf2 skeleton app, (*5)

Credits

The Versions

07/09 2017

dev-DAPH-180-catch-all-error-handler

dev-DAPH-180-catch-all-error-handler https://github.com/ministryofjustice/opg-core-health-check

OPG Core Health Check ZF2 Module

  Sources   Download

ministryofjustice

The Requires

 

The Development Requires

ministryofjustice opg

15/06 2015
15/06 2015
20/04 2015

1.0.0

1.0.0.0 https://github.com/ministryofjustice/opg-core-health-check

OPG Core Health Check ZF2 Module

  Sources   Download

ministryofjustice

The Requires

 

The Development Requires

ministryofjustice opg