juy / profiler
A profiler for Laravel 4
Requires
- php: >=5.3.0
- illuminate/support: ~4
This package is not auto-updated.
Last update: 2016-01-29 19:10:48 UTC
README
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.
Screenshoot
Features
- Environment info
- Current controller/action info
- Routes
- Log events
- SQL query log with syntax highlighting
- Total execution time
- Custom "checkpoints", see this section
- 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/profilerProfiler
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 TimersTo 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.
License
This project is open-sourced software licensed under the MIT license.