Welcome

BoltWire is a content management system developed by Dan Vis.

Welcome Tour
Documentation
Mailing List



Popular Posts

Version 5.11 Released
May 26, 2016

Big Changes Coming Soon...
April 28, 2016

Catching Up
April 6, 2016



Other Sites

Here's some other sites by Dan Vis:

Alexa Echoes
Join my adventures developing for Amazons exciting new voice platform.

Firefly Spot
Personal rambling about new gadgets, technology news, and space travel.

FAST Missions
My ministry hub, with news and updates about our online school.

You can follow him at www.danvis.info.

Debugging

Documentation > Concepts > Debugging

Writing new code can be a challenge some times. Fortunately, BoltWire has a couple built-in tools to help with debugging.

Error Reporting
Set "$errorReporting = 'true';" in index.php before calling the engine to turn on PHP's error messages. If you want to limit who can see these messages, try doing something like this:

if ($_SESSION['field']['ID']['id'] == 'admin') $errorReporting = 'true';

Debug
Set $debug = 'true'; in index.php (or config.php) to bypass BoltWire's normal output method, which buffers the output and sends it back devoid of any print messages BoltWire might generate. In other words, if you don't do this and put print_r($check); in your plugin--you won't see the message. Turn it on, and the message will appear.

Note: This turns off automatic indexing, so don't forget to remove this line when finished.

P and PP
There's a couple quick utilities in engine.php to simplify sending error messages back to the browser.

p('some text'); turns debugging mode on and prints the message without stopping page processing.

pp('some text'); prints the message and aborts page processing immediately.

These won't solve all your programming problems, but hopefully they can help a bit!

To leave a comment, please login using your Facebook account: