2017 © Pedro Peláez
 

library stackphp-xhprof

Stack middleware for Xhprof library

image

vilartoni/stackphp-xhprof

Stack middleware for Xhprof library

  • Tuesday, February 23, 2016
  • by vilartoni
  • Repository
  • 1 Watchers
  • 0 Stars
  • 138 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 2 % Grown

The README.md

Xhprof middleware for StackPHP

This package contains a StackPHP middleware that activates XHProf profiling by leveraging the lox/xhprof library., (*1)

Just by sending xhprof=1 on the GET request, XhprofMiddleware will generate the profiling for the requested URL and append a link to the results to the response., (*2)

Requirements

xhprof extension must be loaded. Otherwise an exception will be thrown., (*3)

Options

The XhprofMiddleware accepts an array of options:, (*4)

  • output_dir: the directory used to store XHProf runs.

Example

<?php

use Avs\Stack\XhprofMiddleware;

require_once __DIR__ . '../vendor/autoload.php';

$app = new Silex\Application();

$stack = (new Stack\Builder())
    ->push(XhprofMiddleware::class, '/secret/xhprof');

$app = $stack->resolve($app);

$request = Request::createFromGlobals();
$response = $app->handle($request)->send();

$app->terminate($request, $response);

Installation

The recommended way to install XhprofMiddleware is through Composer:, (*5)

``` json { "require": { "vilartoni/stackphp-xhprof": "dev-master" } }, (*6)


**Note:** as this package depends on `lox/xhprof` which is in `dev` stability, you may need to allow it explicitly in case you're not already using it. ```json { "require": { "vilartoni/stackphp-xhprof": "dev-master", "lox/xhprof": "@dev" } }

The Versions

23/02 2016

dev-master

9999999-dev

Stack middleware for Xhprof library

  Sources   Download

MIT

The Requires

 

by Antonio Vilar

debug stack profiler xhprof