Download the PHP package codon/profiler without Composer

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

Codon/Profiler

A PHP 5.4+ profiling class, loosely based on the PEAR Benchmark package.

Current to-do list:

Installation

Add to your composer.json file:

Then run the composer update

Basic Usage

This class extensively uses closures, and all of the methods (except for getResults) are chainable. Declare a new Profiler class:

Which will output something like:

Settings

To change profiler settings, use the function:

Some settings (type and (default)):

Using the Profiler

There are two ways you can use the profile:

  1. Add tests using ; (see test/benchmark.php)
  2. Profile code inline using the ; (see test/inline.php)

add()

To add a test, you use the method, which accepts an array of:

This method can be chained

Tip: To use checkpoints/timers and other functionality within your test run, pass the Profiler object via (as a reference). You can also pass any other data/variables needed for your tests via the

run()

To run all of the tests, call :

Passing parameters

Your test function can also have any parameters, and any parameters passed to will be passed to the closure. I.e, if you're measuring run-times of methods in a class:

clear()

Use the function to clear the results of previous tests.

clearAll()

Use the function to reset the profiler to having no tests or runs.

startTimer($name)/endTimer($name)

To measure points within a running benchmark. Can also be used inline (see below)

checkpoint($name)

Mark a checkpoint time from the start of the current test

markMemoryUsage($name)

This will take note of a memory usage at the point that this is called. Gets the usage by the script, PHP engine, and peak usage.

showResults($html = false, $return = false)

Shows a formatted table

getResults()

Returns an array with the raw results of a run

Using the profiler inline

You can call the and functions in any inline code.

Which shows:

Examples

Measuring two ways of doing a for() loop:

Showing:

Using Timers and checkpoints

Which will output:


All versions of profiler with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.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 codon/profiler contains the following files

Loading the files please wait ....