Skip to content
This repository has been archived by the owner on Feb 15, 2020. It is now read-only.
/ profiler Public archive
forked from ursuleacv/profiler

Laravel package: (Abandoned) Profiler for Laravel 4

License

Notifications You must be signed in to change notification settings

bump44/profiler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Abandoned Still Maintained

This project is abandoned at 23 September 2013. Developers who want to be free to continue on own fork. I personally started using and support a much better interface with the barryvdh/laravel-debugbar.

Profiler

A profiler for Laravel 4. Backend based on sorora/omni, frontend based on loic-sharma/profiler, some features inspired by papajoker/profiler, some features 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 don't think this is really needed)
  • All variables passed to views
  • Session variables
  • Laravel auth variables (Need to test)
  • Sentry auth variables

Installation

To add Profiler to your Laravel application, follow these three steps:

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.

Add the below line to the providers array in app/config/app.php configuration file (add at the end):

'Juy\Profiler\Providers\ProfilerServiceProvider',

Add the below line to the aliases array in app/config/app.php configuration file (add at the end):

'Profiler' => 'Juy\Profiler\Facades\Profiler',

Configuration

You will want to run the following command to publish the config to your application, otherwise it will be overwritten when the package is updated.

php artisan config:publish juy/profiler

Profiler

Set this option to FALSE to disable the profiler. By default, it is NULL, which makes the profiler refer to the app debug option in config/app.php.

// config.php
'profiler' => NULL

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

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

// or

Profiler::disable();

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

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 Laravel's 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 color-coded in the Logs part of the profiler – colors may change in future to more accurately reflect the log type.

About

Laravel package: (Abandoned) Profiler for Laravel 4

Resources

License

Stars

Watchers

Forks

Packages

No packages published