Download the PHP package cheprasov/php-simple-profiler without Composer

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

MIT license

SimpleProfiler v3.0.0 for PHP >= 7.0

The SimpleProfiler is a tool for automatic analysis of code. Or, you can just using simple tools like Stopwatch and Counter.

Features:

1. How to add the profiler to you project for automatic analysis of code

Note. You can use profiler tools like 'Stopwatch' and 'Counter' without this step.

You need to open your 'autoload' function, and use the profiler's function for loading class.

Example:

2. How to get result

The Profiler has 2 methods that return collected data:

  1. \SimpleProfiler\Profiler::getRawData() : array|null

  2. \SimpleProfiler\Profiler::getLog() : string

You can use function \SimpleProfiler\Profiler::getLog() for getting already formatted log data as string.

Example of output:

Lets see what we have in the output

3. Usage of Profiler tool

  1. Add profiler to a file.

Arguments:

  1. Get result:

or

  1. Configure profile.

By default, the Profiler uses \SimpleProfiler\Unit\FunctionUnit::class for collecting statistic. You can set another unit

Another function setProfilerUnitVarName, it changes var's name that will injected in code.

4. Usage Counter tool

  1. Counter::clear() : void - clear all counters

  2. Counter::increment(string $name, int $count = 1): int - increment the counter, it returns new value

  3. Counter::decrement(string $name, int $count = 1): int - decrement the counter, it returns new value

  4. Counter::get(string $name): int - get the counter's value

  5. Counter::getAll(): array - get values of all counters

5. Usage Stopwatch tool

  1. Stopwatch::clear() : void - clear all timers

  2. Stopwatch::start(string $name): void - start timer, or continue it after stop.

  3. Stopwatch::stop(string $name): float - stop timer, and get duration in sec.

  4. Stopwatch::get(string $name): int - get the timer's duration

  5. Stopwatch::getAll(): array - get durations of all timers

Example with phpMyAdmin-4.6.0

  1. I changed the file phpMyAdmin-4.6.0/libraries/Psr4Autoloader.php

  2. I added echo of the Profiler's log in file phpMyAdmin-4.6.0/server_sql.php

  3. I opened phpMyAdmin in a browser and got this, and we can see that function PMA\libraries\Language::activate took 70.9% of working time.

Full log:

Composer

Download composer:

wget -nc http://getcomposer.org/composer.phar

and add dependency to your project:

php composer.phar cheprasov/php-simple-profiler

Something doesn't work

Feel free to fork project, fix bugs and finally request for pull


All versions of php-simple-profiler with dependencies

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

Loading the files please wait ....