Download the PHP package kehikko/profiler without Composer

On this page you can find all versions of the php package kehikko/profiler. 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 profiler

Profiling PHP

Generic profiling implementation for PHP.

Has a browser based UI to view profiled calls.

Tested with tideways and PHP 7.2 in Ubuntu 18.04.

All the code is based on a much older implementation that used xhprof and PHP 5.x (tested and used at least in Ubuntu 14.04 and CentOS/cPanel v???). Ported the code as a standalone version from Kehikko v1 framework when starting Kehikko v2.

Should still work even with PHP 5.x since no changes have been made to the core functionality, but I made PHP 7.0 as a requirement when installing this from Composer.

Requirements

PHP 7.0, PHP profiler extension (listed below) and command dot (from GraphViz). Twig is optional since it can be installed using Composer.

One of these PHP-extensions is required:

In Ubuntu 18.04 you should be able to install required depencies this way:

Simple test example

Do the following after you have installed tideways and graphviz:

And if you did this on your local machine, you should be able to browse to url http://localhost:8080 and see some results.

Install

To install this profiler into existing project, run:

If you plan to use this without Composer, you need to install Twig manually so that it is autoloaded when this profiler code is run.

The part that writes profiling data doe not need Twig. Only the part that is used to view profiled calls, needs Twig.

NOTE: Usually you probably do not want to install profiler into your project and it should be installed elsewhere in a manner like in Simple test example and profiler.php included to your project from there only on local test installation.

Setup

Generating profiling data

Call profiler_start from your code:

Call profiler_stop later (or don't and let it be called automatically when PHP execution stops):

Also you can call profiler_running to see whether or not profiler has been started:

Apache

Enable mod_rewrite in Apache and add/set this to your .htaccess in your public web directory:

Create a PHP file called profiler.php in that same directory with following contents:

Now you can see your profiled calls when browsing to http://your.web.server/_profiler.

NOTE: This script assumes that Composer installed vendor directory containing libraries is located one step down from the directory it is located in.

NOTE: At least in Ubuntu 18.04 systemd forces /tmp/ in PHP with apache to a different location, usually /tmp/systemd-private-*-apache2.service-*/. This is not the case when running PHP from command line, so don't get baffled when profiling stuff in command line does not show up in your apache side.

Screenshots

Profiles

Profile

Call graph


All versions of profiler with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
twig/twig 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 kehikko/profiler contains the following files

Loading the files please wait ....