Some of may ask how much that actually have been done with the upcoming 1.4.2 version. This post will give you a quick update about the progress.

Read the rest of this entry »

A way to handle errors in PHP

January 4th, 2008

Found a built-in error handling in PHP that can be useful in future versions of ClanWeb.

<?php// define a custom error handler

set_error_handler('oops');

// initialize the $string variable

$string = 'a string';

// explode() a string
// this will generate a warning because the number of arguments to explode() is incorrect
// the error will be caught by the custom error handler

explode($string);

// custom error handler

function oops($type, $msg, $file, $line, $context) {
   echo "<h1>Error!</h1>";
    echo "An error occurred while executing this script. Please contact the <a href=mailto:webmaster@somedomain.com>webmaster</a> to report this error.";
    echo "<p />";
    echo "Here is the information provided by the script:";
    echo "<hr><pre>";
    echo "Error code: $type<br />";
    echo "Error message: $msg<br />";
    echo "Script name and line number of error: $file:$line<br />";
    $variable_state = array_pop($context);
    echo "Variable state when error occurred: ";
    print_r($variable_state);
    echo "</pre><hr>";
}
?>

Example nr 2:

<?php// define a custom error handler
set_error_handler('oops');

// initialize $string variable$string = 'a string';

// this will generate a warningexplode($string);

// custom error handlerfunction oops($type, $msg, $file, $line, $context) {
    switch ($type) {
        // notices
        case E_NOTICE:
            // do nothing
            break;

// warnings        case E_WARNING:
            // report error
            print "Non-fatal error on line $line of $file: $msg <br />";
            break;

// other        default:
            print "Error of type $type on line $line of $file: $msg <br />";
            break;
    }

}
?>

Hopefully this functions could smoothen the error reporting in the future.

Welcome to the Development Log

January 4th, 2008

Since I started working on ClanWeb over 5 years ago I could never imagine that this little project would turn out to grow into a international known management application. But now I realise that the net needed a application like ClanWeb to drive the development of “Clan Management Systems” onward. I have since the start followed the development of other scripts close and noticed that some of them offered the same functions as ClanWeb, after they been made public in a clanweb application. That’s really nice to see and it is a receipt on how big impact the application have had on the “market”.

Two years ago I started the development of the 1.4.x series which have resulted in huge changes of the app since the 1.3.x versions. Sadly I haven’t been able to live up to all the expectations that people have had on me and ClanWeb. Although I acctually never stopped working on the new version , 1.4.2, I went lazy and didnt post any new updates. I now notice the full effect of this and this development log is a counter measure to ensure that people still will find a interest in the powerful application that ClanWeb still is.

This devlog will not only work as a “news section” but also as a log for me to keep track of what I have done and what that needs to be done. But not only that, I also invite YOU to help me in the development by posting your comments about different functions, what you acctually think is more important to have and what that need to be fixed from previous versions.

In the coming days this devlog will be updated with a public TODO list aswell as a separete page where you can post bugs that need to be fixed.

Truly yours,
Michael “ArreliuS” Winberg
Founder and programmer, ClanWeb