Skip to content

ursuleacv/profiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Profiler

A PHP 5.3 profiler for Laravel 4. Backend based on sorora/omni, fronted based on loic-sharma/profiler, some features inspirated from papajoker/profiler, some feature original by myself.

Features

  • Environment info
  • Current controller/action info
  • Routes
  • Log events
  • SQL Query Log with syntax highlighting
  • Total execution time
  • Total memory usage
  • Includes files (I think not realy need this)
  • All variables passed to views
  • Session variables
  • Laravel auth variables (Need test)
  • Sentry auth veriables

Installation

To add Profiler to your Laravel application, add the following to your composer.json file:

"juy/profiler" : "dev-master"

Then run composer update or composer install if you have not already installed packages. One final step is needed, add the below to the providers array in app/config/app.php configuration file:

'Juy\Profiler\Providers\ProfilerServiceProvider',

Configuration

You will want to run the following command to publish the config to your application, otherwise it will be overwritten in updates.

php artisan config:publish juy/profiler

Profiler

Set this option to false to disable the profiler. It is true by default.

// Config.php
'profiler' => true

If you wish to disable the profiler during your application, just do:

Config::set('profiler::profiler', false);

Note:: This will only disable the output, it will still do it's background listening but will not output it to the browser.

jQuery

Set this option to false to not pull in jQuery from within the profiler. This is useful if you already have jQuery present on your page requests. Set to true by default.

// config.php
'jquery' => true

Usage

Custom Timers

To start a timer, all you need to do is:

Profiler::start('my timer key');

To end the timer, simply call the end function like so:

Profiler::end('my timer key');

Logging

Profiler utilizes Laravels built in logging system and captures logged events. To log events, you can do (as you would with laravel) any of these:

Log::debug('Your message here');
Log::info('Your message here');
Log::notice('Your message here');
Log::warning('Your message here');
Log::error('Your message here');
Log::critical('Your message here');
Log::alert('Your message here');
Log::emergency('Your message here');

These are colour coded in the Logs part of the profiler - colours may change in future to more accurately reflect the log type.

About

A PHP 5.3 profiler for Laravel 4.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published