PHPackages                             vilartoni/stackphp-xhprof - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. vilartoni/stackphp-xhprof

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

vilartoni/stackphp-xhprof
=========================

Stack middleware for Xhprof library

v1.0(6y ago)0305MITPHPPHP &gt;=5.4.0

Since Feb 23Pushed 6y ago1 watchersCompare

[ Source](https://github.com/vilartoni/stackphp-xhprof)[ Packagist](https://packagist.org/packages/vilartoni/stackphp-xhprof)[ RSS](/packages/vilartoni-stackphp-xhprof/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Xhprof middleware for StackPHP
==============================

[](#xhprof-middleware-for-stackphp)

This package contains a [StackPHP](http://stackphp.com/) middleware that activates XHProf profiling by leveraging the [lox/xhprof](https://github.com/lox/xhprof) library.

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.

Requirements
------------

[](#requirements)

`xhprof` extension must be loaded. Otherwise an exception will be thrown.

Options
-------

[](#options)

The `XhprofMiddleware` accepts an array of options:

- **output\_dir**: the directory used to store XHProf runs.

Example
-------

[](#example)

```
