Code Monkey home page Code Monkey logo

profiler's Introduction

Profiler

A PHP 5.3 profiler based off of Laravel 3's Anbu.

Installation

Installing profiler is simple. First, you'll need to add the package to the require attribute of your composer.json file.

{
    "require": {
        "loic-sharma/profiler": "1.1.*"
    },
}

Installing Using Laravel 4

To enable te profiler in Laravel 4 you will need to register the Service Provider and the Facade.

  1. Add 'Profiler\ProfilerServiceProvider', to the list of service providers in app/config/app.php
  2. Add 'Profiler' => 'Profiler\Facades\Profiler', to the list of class aliases in app/config/app.php
  3. In console run php artisan config:publish loic-sharma/profiler

And voila! You can use the profiler.

Profiler::startTimer('testLogging');

// The profiler listens to Laravel's logger.
Log::info('Hello World!');
Log::notice('Some event occured.');

Profiler::endTimer('testLogging');

Installing For Your Own Project

Add the following to your code:

$logger = new Profiler\Logger\Logger;
$profiler = new Profiler\Profiler($logger);

You can now use the profiler to your heart's content.

$profiler->startTimer('testLogging');

$logger->debug($object);
$logger->info('Hello World!');
$logger->notice('Some event occurred.');
$logger->warning('Careful: some warning.');
$logger->error('Runtime error.');
$logger->critical('This needs to be fixed now!');
$logger->emergency('The website is down right now.');

$profiler->endTimer('testLogging');

echo $profiler;

Copyright and License

Profiler was written by Loic Sharma. Profiler is released under the 2-clause BSD License. See the LICENSE file for details.

Copyright 2012 Loic Sharma

profiler's People

Contributors

barryvdh avatar briankiewel avatar loic-sharma avatar lordcoste avatar ltsochev-dev avatar radmen avatar syphernl avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.