2017-25 © Pedro Peláez
 

library thunder

Simple debug helper

image

anhu/thunder

Simple debug helper

  • Saturday, August 30, 2014
  • by pickaboo
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Thunder - a simple bug hunt helper

#

Thunder is a simple, light weight, debug helper for the PHP framework Anax. By setting a marker in a class or a function - a frame will be generated that can be viewed by adding the View to you page., (*1)

The marker will provide information about, (*2)

  • Text (your own message)
  • Selected variable (optional)
  • Name of current Class
  • Name of current Function
  • Filepath
  • Time
  • Time passed since last mark

See below for Usage and more info., (*3)

By Andreas Hultman, andreas.hultman@me.com, (*4)

License

This software is free software and carries a MIT license., (*5)

Use of external libraries

Thunder uses Bootstrap and Fontawesome. These are included in the view template using the CDN support from maxCDN. So make sure that you are online when using Thunder., (*6)

Installation

You can either clone it from github or use Composer to install with Packagist. For installation with Composer - require the package in your composer.json using:, (*7)

"anhu/thunder": "dev-master"

add to project, (*8)

In Anax the easiest way to include Thunder is to add it do $di in the froncontroller., (*9)

$di->setShared('thunder', function() {
$thunder = new \Anhu\Thunder\CThunder();
return $thunder;  
});

output result to a view, (*10)

A template view are included in the package (thunder.tpl.php). In Anax framework just simply move it to your view folder and add in frontcontroller., (*11)

$app->router->add('thunder', function() use ($app) {   
$app->theme->setVariable('title', "Thunder test");
$app->views->add('packTest/thunder', [ 
'content' => $app->thunder->getMarkers(), ]);
});

Usage

When thunder is included you can put a mark anywhere in your code. When the mark runs - information is saved to the session and will be available for output in a view. There are several different ways you can set a mark., (*12)

Examples below shows how mark is set after thunder are included in $di - in the Anax framework. If included in another way make sure to adjust path to setMarker., (*13)

the marker, (*14)

The mark is set by calling the setMarker function and passing a message and an optional parameter., (*15)

$this->di->thunder->setMarker("This is my own message", $Optional);, (*16)

Its possible to pass values in the first parameter aswell and use Html., (*17)

$this->di->thunder->setMarker("<h1>Value of $x -> Value of $z</h1>", $testVar);, (*18)

knock your self out ..., (*19)

History

8/29/2014 Ver 0.1 - First attempt, (*20)

The Versions

30/08 2014

dev-master

9999999-dev http://github.com/pickaboo

Simple debug helper

  Sources   Download

MIT

The Requires

  • php >=5.4

 

debug education