Download the PHP package fabfuel/prophiler without Composer

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

Prophiler - A PHP Profiler & Developer Toolbar built for Phalcon

Scrutinizer Code Quality Code Coverage Build Status License Latest Stable Version

Demo

The demo website has been moved to a separate repository: https://github.com/fabfuel/prophiler-demo

Here you can see the toolbar in action: http://prophiler.fabfuel.de/demo.php

Timeline Preview

Installation

You can use composer to install the Prophiler. Just add it as dependency:

"require": {
    "fabfuel/prophiler": "~1.0",
}

Setup (general)

Setting up the Prophiler and the developer toolbar can be done via the following simple steps. It could all be done in your front-controller (e.g. public/index.php in Phalcon)

1. Initialize the Profiler (as soon as possible)

Generally it makes sense to initialize the profiler as soon as possible, to measure as much execution time as you can. You should initialize the profiler in your front-controller or the bootstrap file right after requiring the Composer autoloader.

2. Initialize and register the Toolbar

To visualize the profiling results, you have to initialize and render the Prophiler Toolbar. This component takes care for rendering all results of the profiler benchmarks and other data collectors. Put that at the end of the front-controller.

You can also add other data collectors to the Toolbar, to show e.g. request data like in this example.

You can also easily create you own data collectors, by implementing the DataCollectorInterface and adding an instance to the Toolbar.

Additional setup for Phalcon applications

1. Add the profiler to the dependency injection container

Add the profiler instance to the DI container, that other plugins and adapters can use it across the application. This should be done in or after your general DI setup.

2. Initialize the plugin manager

The plugin manager registers all included Phalcon plugins automatically and attaches them to the events manager. To make the plugins work properly, make sure that the default events manager is attached to your Dispatcher, View and Connection services.

Custom Benchmarks

You can easily add custom benchmarks to your code:

Or stop without passing the benchmark

In some scenarios (e.g. custom adapters) it might be hard to pass the received benchmark to the stop() method. Alternatively you can simply omit the $benchmark parameter. If that is the case, the profiler simply stops the last started benchmark, but it is not possible to run overlapping benchmarks.

Aggregations

Prophiler now features benchmark aggregations. These give you a lot more insights and are extremely useful to:

Setup

Prophiler comes with some aggregators, but you can easily create your own. To Set up an aggregator, all you need to do is to register the aggregator at the profiler instance:

That's it. You immediately see all database and cache queries, grouped by command/query, including the total number of executions, the total duration of all executions as well as the minimum, maximum and average execution time.

Logging

You can use Prophiler to log events and other data and view it in the timeline and in the separate "Logs" tab. If you already have a logging infrastructure, you can add the PSR-3 compliant Logger adapter to it. Otherwise you can also just instantiate and use it directly:

Adapters and Decorators

Doctrine

To profile all SQL queries made by Doctrine, you just have to register the SQLLogger adapter in your Doctrine configuration, for example in your bootstrap.php like that:

PDO

To profile your PDO database actions, you can use the Prophiler PDO decorator. It will record all query() & exec() calls and prepared statements as well. Just decorate your PDO instance with the Prophiler decorator and use that instead:

Cache

To profile Phalcon cache backend requests, you only need to decorate the cache backend with the BackendDecorator. It will benchmark all cache operations automatically. Here is an example with the APC backend:

Elasticsearch

To profile Elasticsearch requests, you only need to decorate the Elasticsearch client with the ClientDecorator:

Tips

Record session writing

To record session writing, you can commit (this is also known as session_write_close()) the session before rendering the toolbar


All versions of prophiler with dependencies

PHP Build Version
Package Version
Requires psr/log Version ~1.0
php Version >=5.5
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 fabfuel/prophiler contains the following files

Loading the files please wait ....