Integrate the NewRelic PHP Agent API into Silex framework
- PHP 5.3.x
- intouch/newrelic
- newrelic >= 3.1
The recommended way to install NewRelic/Silex is through composer. You can see the package information on Packagist.
{
"require": {
"mcuadros/silex-newrelic": "dev-master"
}
}
Set all parameters in the array $app['newrelic.options']:
application_name
(default 'Silex PHP Application'): Sets the name of the application to name.transaction_name_method
(default 'uri'): if 'uri' the request URI will be used as transaction name, if 'route' will be used the alias name from the route.transaction_tracer_detail
(default 1): check it at newrelic.transaction_tracer.detailcapture_params
(default false): check it at newrelic.capture_paramsignored_params
(default ''): check it at newrelic.ignored_paramsdisable_auto_rum
(default false): Prevents the output filter from attempting to insert RUM JavaScript for this current transaction. Useful for AJAX calls, for example.
$app->register(new NewRelic\Silex\NewRelicServiceProvider());
$app['newrelic.options'] = array(
'application_name' => 'Example PHP Application',
'transaction_name_method' => 'route'
);
Tests are in the tests
folder.
To run them, you need PHPUnit.
Example:
$ phpunit --configuration phpunit.xml.dist
MIT, see LICENSE