Download the PHP package imhelle/yii2-xhprof-lib without Composer

On this page you can find all versions of the php package imhelle/yii2-xhprof-lib. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yii2-xhprof-lib

yii2-xhprof

Simple extension to use XHProf with Yii Framework 2.x. This is the updated version of yii-xhprof extension for Yii Framework 1.x.

Bundled with debug panel for official yii2-debug extension.

By default profile starts during bootstrap process and stops in PHP shutdown function. You can change this behavior and manually start and stop profiler.

Tested on Yii Framework v2.0.6+.

Xhprof installation

(CentOS)

sudo yum install gcc

cd /www/biglion/general/data/lib/vendor/imhelle/yii2-xhprof-lib/lib/
phpize
./configure
make
make test
sudo make install

sudo yum install graphviz

Yii extension installation

This extension is available at packagist.org and can be installed via composer by following command:

composer require --dev imhelle/yii2-xhprof.

Minimal configuration to enable profiler:

To use bundled debug panel - update configuration next way:

Note: xhprof should be after debug in preload section to be able to ignore requests to debug module pages.

Required XHProf files (library files - xhprof_lib and UI - xhprof_html) you can find in this GitHub repo.

Component configuration

Extension provide next configuration options for Yii component:

XHProf class configuration

Component from extension use own developed simple wrapper for xhprof_enable / xhprof_disable functions: XHProf class. This class provide functionality to start/stop profiling, save reports and get URLs for reports with XHProf library by Facebook.

Available configuration options (applicable for configure method, see example below):

All options can be changed with setters (e.g. setFlagCpu(<value>)). For more details see the source code of the class.

Manual profiling

If you disable auto start (autoStart option) or stop (autoStop option) you can place code to start/stop profiler in any place of your code and be able to see report and callgraph result via overlay or debug panel.

To manual start you need to write some kind of next code:

To manual stop you need to write next code:

Note: If you use XHProf class (with or without this extension) - all profile results can be found on XHProf UI page (it's by default by xhprof developers).

Note for PHP 7 and XHProf

If you want to use this extension with PHP 7, you can use next forked version of xhprof extension: https://github.com/rustjason/xhprof. This extension was tested on PHP 7.1.11 with extension built from provided repository.

Another better option - is to use officially ported xhprof extension by tideways.io - https://github.com/tideways/php-xhprof-extension.


All versions of yii2-xhprof-lib with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
yiisoft/yii2 Version 2.0.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package imhelle/yii2-xhprof-lib contains the following files

Loading the files please wait ....