Download the PHP package rmzamora/zenddiagnostics without Composer

On this page you can find all versions of the php package rmzamora/zenddiagnostics. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zenddiagnostics

ZendDiagnostics

Simple component for performing diagnostic tests in real-world PHP applications.

ZendDiagnostics

It currently ships with the following Diagnostic Checks:

File validation checks:

Using diagnostics with Zend Framework 2

  1. Install the ZFTool module.
  2. Enable diagnostic tests in your application config.php.
  3. In your console type php public/index.php diag to run diagnostics.

Using diagnostics with Symfony 2

  1. Install the LiipMonitorBundle.
  2. Enable diagnostic tests in your application configuration.
  3. In your console type ./app/console monitor:health to run diagnostics.

Using diagnostics with PSR-7 middleware

Install the rstgroup/diagnostics-middleware.

Using diagnostics in plain PHP

  1. Add ZendDiagnostics component to your application
  2. If you are not using Composer, use include "autoload_register.php";
  3. Create an instance of ZendDiagnostics\Runner
  4. Add tests using Runner::addTest()
  5. Optionally add a reporter to display progress using Runner::addReporter()
  6. Run diagnostics Runner::run()

For example:

``

You can now run the file in your console (command line):

`

Using Result Collection

The Runner will always return a Result\Collection (even without any attached Reporter). This collection contains results for all tests and failure counters.

Simple example:

``

Architecture

A single diagnostic Check performs one particular test on the application or environment.

It must return a Result which implements one of the following result interfaces:

Each test Result can additionally return:

One can define additional result interfaces, i.e. denoting severity levels (i.e. critical, alert, notice) or appropriate actions (i.e. missing, incomplete). However, it is recommended to extend the primary set of Success, Warning, Failure interfaces for compatibility with other applications and libraries.

Writing custom Checks

A Check class has to implement Check and provide the following methods:

``

The main check() method is responsible for doing the actual check and is expected to return a Result. It is recommended to use the built-in result classes for compatibility with Runner and other checks.

Here is an example trivial class, that will check if PHP default timezone is set to UTC.

``

Writing custom Reporters

A Reporter is a class implementing ReporterInterface.

``

A Runner invokes above methods while running diagnostics in the following order:

Some Reporter methods can be used to interrupt the operation of a Runner:

All other return values are ignored.

ZendDiagnostics ships with a simple Console reporter - it can serve as a good example on how to write your own Reporters.

Built-in diagnostics checks

ZendDiagnostics provides several "just add water" checks you can use straight away.

The following built-in tests are currently available:

ApcFragmentation

Make sure that APC memory fragmentation level is below given threshold:

``

ApcMemory

Check APC memory usage percent and make sure it's below given threshold.

``

Callback

Run a function (callback) and use return value as the result:

``

Note: The callback must return either a boolean (true for success, false for failure) or a valid instance of ResultInterface. All other objects will result in an exception and scalars (i.e. a string) will be interpreted as warnings.

ClassExists

Check if a class (or an array of classes) exist. For example:

``

CpuPerformance

Benchmark CPU performance and return failure if it is below the given ratio. The baseline for performance calculation is the speed of Amazon EC2 Micro Instance (Q1 2013). You can specify the expected performance for the test, where a ratio of 1.0 (one) means at least the speed of EC2 Micro Instance. A ratio of 2 would mean "at least double the performance of EC2 Micro Instance" and a fraction of 0.5 means "at least half the performance of Micro Instance".

The following check will test if current server has at least half the CPU power of EC2 Micro Instance:

``

DirReadable

Check if a given path (or array of paths) points to a directory and it is readable.

``

DirWritable

Check if a given path (or array of paths) points to a directory and if it can be written to.

``

DiskFree

Check if there is enough remaining free disk space.

The first parameter is the minimum disk space, which can be supplied as integer (in bytes, i.e. 1024) or as a string with a multiplier (IEC, SI or Jedec, i.e. "150MB"). The second parameter is the path to check - on *NIX systems it is an ordinary path (i.e. /home), on Windows systems it is a drive letter (i.e. "C:").

``

ExtensionLoaded

Check if a PHP extension (or an array of extensions) is currently loaded.

``

HttpService

Attempt connection to given HTTP host or IP address and try to load a web page. The check also supports checking response codes and page contents.

``

GuzzleHttpService

Attempt connection to given HTTP host or IP address and try to load a web page using Guzzle. The check also supports checking response codes and page contents.

``

Memcache

Attempt to connect to given Memcache server.

``

PhpVersion

Check if current PHP version matches the given requirement. The test accepts 2 parameters - baseline version and optional comparison operator.

``

PhpFlag

Make sure that given PHP flag(s) is enabled or disabled (i.e. as defined in php.ini). You can use this test to alert the user about unsafe or behavior-changing PHP settings.

``

ProcessRunning

Check if a given unix process is running. This check supports PIDs and process names.

``

RabbitMQ

Validate that a RabbitMQ service is running.

Redis

Validate that a Redis service is running.

SecurityAdvisory

Run a security check of libraries locally installed by Composer against SensioLabs Security Advisory database and warn about potential security vulnerabilities.

``

StreamWrapperExists

Check if a given stream wrapper (or an array of wrappers) is available. For example:

``

DoctrineMigration

Make sure all migrations are applied:

``

IniFile

Read an INI-file from the given path and try to parse it.

``

JsonFile

Read a JSON-file from the given path and try to decode it.

``

XmlFile

Read an XML-file from the given path, try to parse it and validate it agaist its DTD schema if possible.

``

YamlFile

Read a YAML-file from the given path and try to parse it.

``


All versions of zenddiagnostics with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rmzamora/zenddiagnostics contains the following files

Loading the files please wait ....