Diagnostics
Configurable diagnostic tests for PHP applications based on ZendDiagnostics, (*1)
, (*2)
Requirements
This application has the following requirements:, (*3)
Installation
You can install this application in two different ways, (*4)
As a Phar release (recommended)
Download the latest release to yor project root, (*5)
As a Composer dependency
Install Composer in your project:, (*6)
$ curl -s https://getcomposer.org/installer | php
Create a composer.json file in your project root:, (*7)
{
"require": {
"evolver/diagnostics": "dev-master"
}
}
Install this package via Composer:, (*8)
$ php composer.phar install
Or add this package as a requirement to an existing project:, (*9)
$ php composer.phar require evolver/diagnostics
Usage
Create a diagnostics.yml file in your project root:, (*10)
checks:
- name: "PhpVersion"
arguments:
expectedVersion: "5.4"
operator: ">="
You may specify any other diagnostic checks according to the sample above, (*11)
This application ships with some additional diagnostic checks:, (*12)
-
PhpExtension - make sure given extension is (not) loaded in a defined version
Run diagnostic checks:, (*13)
- with the Phar release:
$ php diagnostics.phar check
- with the Composer binary:
$ vendor/bin/diagnostics check
Additional diagnostic checks
This package comes with some additional diagnostic checks, (*14)
PhpExtension
Make sure that a given extension is loaded, (*15)
checks:
- name: "PhpExtension"
arguments:
extensionName: "mbstring"
Make sure that a given extension is loaded in a defined version, (*16)
checks:
- name: "PhpExtension"
arguments:
extensionName: "yaml"
extensionVersion: "1.1.1"
Make sure that a given extension is absent, (*17)
checks:
- name: "PhpExtension"
arguments:
extensionName: "apc"
extensionVersion: false