Are there any debugging tools in Scriptcase, such as basic syntax checking? Or should I load the code into another debugging tool?
Re: Debugging tools?
Use echo … <vbg>
Have a look at:
http://www.phpunit.de/
http://www.xdebug.org/
http://www.php-debugger.com/dbg/
For writing code,
I have used Aptana Studio. Very nice multi-platform editor. (modified Eclipse)
There is also geany,
gedit (install plugins to get pas defaults)
http://www.micahcarrick.com/gedit-html-editor.html
Firebug is a very useful tool for use in FireFox.
Google: php debug for more.
I do not believe there is anything in SC except the settings in Application/Settings to display SQL statements, etc.
Regards,
Scott.
Re: Debugging tools?
That’s what I use for my own coding and current debugging of SC generated code.
I do not believe there is anything in SC except the settings in Application/Settings to display SQL statements, etc.
OK. Something they need to focus on. It’s annoying to generate code and then to that you get only a blank screen because you forgot a $ token before a variable name
Cheers
Re: Debugging tools?
If you use FireFox, the Error Console (under tools) is your friend. V4 is supposed to have an elaborate Error Console. It will display any page errors. This is more the case with bad JS code (blank page).
Regards,
Scott.
Re: Debugging tools?
I’m getting blank pages on PHP errors, particularly on bad SQL statements when using sc_lookup. But thanks for reminding me about the Error Console. It had slipped my mind.
Re: Debugging tools?
Just create a little function in libraries like:
function debug_message($var_message) {
if (isset($_SESSION['myapp']['debug'])) { // defined in onInit
if ($_SESSION['myapp']['debug'] === true) {
if (is_array($var_message)) {
echo "<br/>".PHP_EOL;
print_r($var_message);
}
else {
echo $var_message."<br/>".PHP_EOL;
}
}
}
}
in your code:
// to display messages
$_SESSION['myapp']['debug'] = true;
$sql = 'SELECT ....';
sc_lookup(my_data, $sql);
if ({my_data} === false || empty({my_data})) {
debug_message($sql);
// die('.'); // if needed to stop script for viewing
} else {
// code
}
Regards,
Scott.
Re: Debugging tools?
If you are getting parsing errors from the engine, perhaps a error handler in your code (try,catch,exception).
Regards,
Scott.
Re: Debugging tools?
it would be very cool if you could just run the code without generating the whole project. just run the piece of code an view the output in the scriptcase-backend.
Re: Debugging tools?
A) create a blank app and run the app.
B) create a file yourself: myapp.php and load it in a browser.
<?php
your code
?>
Regards,
Scott.
Re: Debugging tools?
Thank You scott.
Regards,
ghulma