PHP code example of ministryofjustice / opg-core-health-check

1. Go to this page and download the library: Download ministryofjustice/opg-core-health-check library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ministryofjustice / opg-core-health-check example snippets


    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();
    }
config/application.config.php