Download the PHP package charlesportwoodii/yii-newrelic without Composer
On this page you can find all versions of the php package charlesportwoodii/yii-newrelic. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download charlesportwoodii/yii-newrelic
More information about charlesportwoodii/yii-newrelic
Files in charlesportwoodii/yii-newrelic
Package yii-newrelic
Short Description Yii wrapper around the New Relic PHP API
License Modified BSD
Informations about the package yii-newrelic
yii-newrelic
Yii wrapper around the New Relic PHP API.
Introduction
yii-newrelic is a wrapper around the New Relic PHP API. Automatic tracking of module/controller/action ID's is supported. Automatic injection of timing header and footer also supported.
Requirements
- PHP 5.2+
- New Relic for PHP
- One of the following OS's:
- Linux 2.6+, glibc 2.5+ with NPTL support
- OpenSolaris 10
- FreeBSD 7.3+
- MacOS/X 10.5+
- Apache 2.2 or 2.4 via mod_php
- Intel CPU
Installation
1) Install the New Relic PHP driver on your web server per New Relic For PHP instructions.
2) Place this extension in /protected/extensions/yii-newrelic/.
3) In main.php, add the following to 'components':
4) If you are using a script that subclasses CClientScript
, instead of adding
'clientScript' to your 'components', you will instead need to orphan that
extension's script and extend it from YiiNewRelicClientScript
instead. To do so,
change extends CClientScript
to extends YiiNewRelicClientScript
, and then
add a line before that class declaration that says:
5) In main.php, add the following to the top-level array:
6) Create subclass of CWebApplication
, e.g. NewRelicApplication
.
7) In this new class, e.g. NewRelicApplication
, add a method::
8) To use your new subclassed CWebApplication
, modify index.php similar to:
9) In console.php, add the following to 'components':
10) In console.php, add the following to the top-level array:
Features
- yii-newrelic automatically detects whether the New Relic PHP extension is properly installed.
- Automatic association of Yii module/controller/action ID's.
- Automatic injection of New Relic timing header/footer into your HTML layouts.
- Console commands also supported.
Usage
- TODO: Finish docs with use cases with YiiNewRelic API wrapper methods
Known issues and other comments
- A future release will aim to avoid needing to call YiiNewRelic::nameTransaction() via CWebApplication subclass. This seems to be the only reliable mechanism for determining the actual controller/action in use. An attempt was made to use Yii::app()->getUrlManager()->parseUrl(Yii::app()->getRequest()) in YiiNewRelicWebAppBehavior, but this does not seem to produce consistent results.
- Console apps currently only set the class name to YiiNewRelic::nameTransaction().
A future release will attempt to include the action as well. - Your contributions, as always, are greatly appreciated.
License
Modified BSD License https://github.com/gtcode/yii-newrelic