aterrien/forp

Wrapper for forp PHP profiler extension.

dev-master 2013-11-14 22:32 UTC

This package is not auto-updated.

Last update: 2024-05-07 00:29:03 UTC


README

Scrutinizer Quality Score

forp-php is a composer package that "simplifies" usage of forp PHP profiler on your application.

What it does :

  • it starts forp PHP profiler.
  • it registers the forp output callback on shutdown of the PHP script.
  • it selects the most appropriate response to the client.

Dependencies

Server-side :

Client-side :

OR

  • forp-ui : forp.min.js must be put on your own CDN

API = start($opts)

With $opts :

array(
    'no_internals' => 1,                // enable/disable collect of PHP internals
    'ui_src' => '<your forp-ui cdn>',   // URL of forp-ui forp.min.js on your CDN @link https://github.com/aterrien/forp-ui/
    'flags' =>  self::FLAG_ALL,         // forp flags @link https://github.com/aterrien/forp-PHP-profiler/#forp_start-flags
)

Example :

// if($theCurrentRequestCanProfileTheCurrentScript) {


$Forp = new Forp\Forp(array(
    'ui_src' => '<your forp-ui cdn>',
));
$Forp->start();


// }

It can be done in an auto-prepend-file.

Install

Just add this package to the requires of your project (composer.json):

{
    "require":{
        "aterrien/forp": "dev-master"
    }
}

Don't forget to run the install command.