2017 © Pedro Peláez
 

library cakephp-new-relic

CakePHP New Relic plugin.

image

brunitto/cakephp-new-relic

CakePHP New Relic plugin.

  • Saturday, June 23, 2018
  • by brunitto
  • Repository
  • 4 Watchers
  • 8 Stars
  • 3,082 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 10 Versions
  • 14 % Grown

The README.md

CakePHP NewRelic

CakePHP New Relic plugin., (*1)

Build status

Build Status, (*2)

Overview

This plugin extends the CakePHP Request cycle, adding a specialized Dispatcher Filter that adds support for New Relic. The current version supports:, (*3)

  • Name transactions
  • Browser timing

For more information, visit:, (*4)

PHP Frameworks: Integrating support for New Relic, (*5)

Requirements

This plugin has the following requirements:, (*6)

  • CakePHP 3.6 or greater
  • PHP 7.1 or greater
  • New Relic PHP extension

Development requirements:, (*7)

  • PHPUnit 7.1 or greater

Installation

Install the plugin using Composer, executing the following command in your project's root directory (where the composer.json file is located.), (*8)

composer require brunitto/cakephp-new-relic

Usage

Enable name transaction

Using Dispatcher

Add the Dispatcher Filter to the bootstrap.php file:, (*9)

// New Relic name transaction dispatcher filter
DispatcherFactory::add('NewRelic.NameTransaction');

Using Middleware

Add the Middleware to the src/Application.php file after the RoutingMiddleware:, (*10)

$middlewareQueue
    ->add(new RoutingMiddleware($this))
    ->add(new NameTransactionMiddleware());

Enable browser timing

Load the plugin helper within src/View/AppView.php, add the following line within the initialize() method:, (*11)

$this->loadHelper('NewRelic.NewRelic');

Like this:, (*12)

public function initialize()
{
    parent::initialize();
    $this->loadHelper('NewRelic.NewRelic');
}

In your Layouts files, use the NewRelic helper methods to get the browser timing header and footer., (*13)

The header goes right before the </head> element:, (*14)

<head>
...
<!-- NEW RELIC BROWSER TIMING HEADER -->
<?= $this->NewRelic->getBrowserTimingHeader() ?>
</head>

And the footer goes right before the </body> element:, (*15)

<body>
...
<!-- NEW RELIC BROWSER TIMING FOOTER -->
<?= $this->NewRelic->getBrowserTimingFooter() ?>
</body>

Middleware support

This plugin is ready for Middleware, as defined in:, (*16)

Middleware, (*17)

Development guidelines

Install dependencies

Install using composer program:, (*18)

$ composer install --ignore-platform-reqs

Running tests

Run using phpunit program:, (*19)

$ vendor/bin/phpunit tests --color

Releasing a new version

  1. Plan a release on GitHub, using Semantic Versioning, defining which issues will be on this release
  2. Checkout to development and merge master, starting from the last stable version
  3. Work in development, commiting and pushing to origin when you have working code. This will trigger Travis CI and run tests as soon as possible. If you fix an issue, use the , fix #N suffix in commit messages, where #N is the issue identifier. This will close issues on GitHub
  4. When the development is ready to go, merge in master and creates two soft tags: the version tag 1.2.3 and the stable tag. It might be necessary to remove the stable tag before pushing. The version tag is used by GitHub and Packagist to define a new release and a stable release
  5. Push master to origin including the tags and wait for Travis CI to run and the tests to pass

Issues

If you have some problem with this plugin, please open an issue on:, (*20)

https://github.com/brunitto/cakephp-new-relic/issues, (*21)

Contribute

If you'd like to contribute, you can fork the project, add features and send pull requests in the official repository:, (*22)

https://github.com/brunitto/cakephp-new-relic, (*23)

The Versions

23/06 2018

dev-master

9999999-dev

CakePHP New Relic plugin.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bruno Moyle

23/06 2018

1.3.1

1.3.1.0

CakePHP New Relic plugin.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bruno Moyle

17/06 2018

1.3.0

1.3.0.0

CakePHP New Relic plugin.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bruno Moyle

17/06 2018

dev-development

dev-development

CakePHP New Relic plugin.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bruno Moyle

10/06 2017

1.2.2

1.2.2.0

CakePHP New Relic plugin.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bruno Moyle

30/03 2017

1.2.1

1.2.1.0

CakePHP New Relic plugin.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bruno Moyle

05/01 2017

1.2.0

1.2.0.0

CakePHP New Relic plugin.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bruno Moyle

11/11 2016

1.1.0

1.1.0.0

CakePHP New Relic plugin.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bruno Moyle

19/02 2016

1.0.1

1.0.1.0

CakePHP New Relic plugin.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bruno Moyle

16/02 2016

1.0.0

1.0.0.0

CakePHP New Relic plugin.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bruno Moyle