Download the PHP package roenschg/php-newrelic without Composer

On this page you can find all versions of the php package roenschg/php-newrelic. 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 php-newrelic

php-newrelic

This package provides a simple and clean wrapper around the newrelic APM agent API and also enables you to send large amounts of custom metrics into newrelic without dropping any data.

Installation

Basic Usage

You have one class that acts as a wrapper for every function that the PHP agent api defines.

Crossed fingers (Instead of using extension_loaded('newrelic'))

The CrossedFingers handler allows you to use the same methods on environments without a NewRelic extension installed without throwing errors. So instead of doing this if on every line where you want to send events to:

If the extension does not exist, nothing will be done.

HTTP Bulk sending (Send huge amounts of custom events reliable)

If you need to make sure that you send all the data to NewRelic even if you reach the limits of the agent you can use the CustomEventHandler AutoBulkHttp.

Please note that this means you application will be slowed down by the amount of requests you send to NewRelic because of the logged custom events.

The following code shows you how to setup the NewRelicHandler to send the CustomEvents over the API and automaticly pack requests together in bulks.

The NewRelicHttpInsertApi is responsible to connect to the InsightAPI and the NewRelicCustomEventBulkHttpHandler is responsible to pack custom events together in bulk and is aware of the API limitations.

If the package is big enough it will flush the buffer and send the request to the insights api. The Buffer will be cleared during shutdown of you application as well.

If the data you pass to the method ecordCustomEvent is invalid or to big, you will get an Exception.

List of methods

For further information about the methods please see the NewRelic documentation

Running Unit-Tests

Running Code-Sniffer


All versions of php-newrelic with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
ext-curl Version *
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 roenschg/php-newrelic contains the following files

Loading the files please wait ....