integrated a simple version of anbu into the laravel core
Signed-off-by: Dayle Rees <thepunkfan@gmail.com>
This commit is contained in:
59
application/config/anbu.php
Normal file
59
application/config/anbu.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Show the LOG tab.
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Display a tog showing all entries made using the Laravel Log class.
|
||||
|
|
||||
*/
|
||||
|
||||
'tab_logs' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Show the QUERIES tab.
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Display a tab showing all queries performed by the Database layer.
|
||||
|
|
||||
*/
|
||||
|
||||
'tab_queries' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Include jQuery?
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Anbu needs the jQuery JavaScript framework to function, if you are already
|
||||
| using jQuery in your templates, set this value to false.
|
||||
|
|
||||
*/
|
||||
|
||||
'include_jquery' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Event Listeners
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These are the Laravel event listeners, feel free to modify them to use
|
||||
| a different data source, or include more if necessary.
|
||||
|
|
||||
*/
|
||||
|
||||
'event_listeners' => function()
|
||||
{
|
||||
// pass laravel log entries to anbu
|
||||
Event::listen('laravel.log', 'Anbu::log');
|
||||
|
||||
// pass executed SQL queries to anbu
|
||||
Event::listen('laravel.query', 'Anbu::sql');
|
||||
},
|
||||
|
||||
);
|
||||
16
application/start.php
Normal file → Executable file
16
application/start.php
Normal file → Executable file
@@ -125,6 +125,20 @@ Event::listen(Lang::loader, function($bundle, $language, $file)
|
||||
|
||||
Blade::sharpen();
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Enable The Anbu Profiler
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The Anbu profiler is an easy way to view all of your Executed SQL
|
||||
| queries, log entries and other useful data from the front-end of your
|
||||
| web app, to enable output simply add Anbu::render(); after the <body>
|
||||
| tag of your main template, or page.
|
||||
|
|
||||
*/
|
||||
|
||||
Anbu::register();
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Set The Default Timezone
|
||||
@@ -154,4 +168,4 @@ date_default_timezone_set(Config::get('application.timezone'));
|
||||
if ( ! Request::cli() and Config::get('session.driver') !== '')
|
||||
{
|
||||
Session::load();
|
||||
}
|
||||
}
|
||||
|
||||
3
application/views/home/index.php
Normal file → Executable file
3
application/views/home/index.php
Normal file → Executable file
@@ -88,6 +88,7 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<?php Anbu::render(); ?>
|
||||
<div id="main">
|
||||
<h1>Welcome To Laravel</h1>
|
||||
|
||||
@@ -126,4 +127,4 @@
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user