SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot CDitty's Avatar
    Join Date
    Feb 2000
    Location
    Memphis Tn
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP Fusebox and Error Handling

    I am trying to integrate some error checking into our fusebox app. However, no matter what I try, I get errors reported where there were no previous errors. That happened yesterday. I have since brought home the error checking code and I just tried it on a much smaller, less complicated fusebox program I am working on. Same result.

    Can anyone post some samples of what you do?

    Below is what I am currently trying

    fbx_Settings.php
    PHP Code:
    // Define what type of errors we want to handle
    error_reporting(E_ERROR E_WARNING);

    // Define the error handling function
    set_error_handler("errorHandler" );

    // The actual error handler function
    require('act/act_errorHandler.php'); 
    act_errorHandler.php
    PHP Code:
    function errorHandler($errno$errmsg$filename$linenum) {
    # create array to hold type of error
    $errorType = array (
    => "Error",
    => "Warning",
    => "Parsing Error",
    => "Notice",
    16 => "Core Error",
    32 => "Core Warning",
    64 => "Compile Error",
    128 => "Compile Warning",
    256 => "User Error",
    512 => "User Warning",
    1024 => "User Notice" );

    # found an error so alert user to error message and log error
    header('location:http://linuxdev/dsp/dsp_errorHandler.php?name=' basename($filename) . '&num=' $linenum '&type=' $errorType[$errno]);

    # prevent further script execution
    exit();

    This is the error that I am getting. Strange thing is, I haven't touched that file. Standard fusebox file straight from the zip file.
    The error originated from file fbx_Fusebox3.0_PHP4.1.x.php at line number 203

    Here are the lines around it. Line 203 is the line with $FB_["fullPath"]
    PHP Code:
    /*
    *********************SECTION NINE*********************
    Attempt to include any nested fbx_Settings.php files, in top-to-bottom order so that variables set in children fbx_Settings.php files can overwrite variables set in higher fbx_Settings.php files. To prevent children fbx_Settings.php files from overwriting variables, use if(!isset(...)) rather than an outright variable assignment ($var = "value"[img]images/smilies/wink.gif[/img]. Alternately, any child fbx_Settings.php can set a variable and lower fbx_Settings.cfm files cannot overwrite it unless they set the variable outright. If any fbx_Settings.php file or directory alias cannot be found, continue on.
    */
    $FB_["fullPath"] = ListRest($Fusebox["circuits"][$Fusebox["targetCircuit"]], "/" ); //make a variable to hold the full path down to the target, excluding the root
    $FB_["corePath"] = ""//initialize
    $Fusebox["thisCircuit"] = $Fusebox["homeCircuit"]; //current circuit, set to root now 
    Any ideas?

  2. #2
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your error handling looks okay; basically I have roughly the same script

    It could be the path set in the last parameter for the variable

    PHP Code:
    # check last parameter ?
    .
    $FB_['fullPath'] = ... '/'); 
    Also check that the re-direct file exists ? Chance that you'll not get the error output to your screen as your using your own handler - if the file doesn't exist for example, or is in another directory...

  3. #3
    SitePoint Zealot CDitty's Avatar
    Join Date
    Feb 2000
    Location
    Memphis Tn
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Uhhh, yea... I, uhhh, found this error handling somewhere on the web.

    As for that line, if I remove the error checking, all is ok. This is pure fusebox code right out of the zip file.

    I'll send you a pm with my url so you can see what is happening.

    Chris

  4. #4
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Read your message although I couldn't help much keep an eye on your thread since there is bound to be another member who has used Fusebox who can help ?

    Have you got Fuseboxes URL and I'll have a look at their documentation to see what it says ?

  5. #5
    SitePoint Zealot CDitty's Avatar
    Join Date
    Feb 2000
    Location
    Memphis Tn
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is the main one. http://bombusbee.com/

    Thanks

    Chris


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •