Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Joomla-Framework

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5
Source code for file /joomla/utilities/error.php

Documentation is available at error.php

  1. <?php
  2. /**
  3. @version        $Id: error.php 6762 2007-03-03 08:37:41Z tcp $
  4. @package        Joomla.Framework
  5. @subpackage    Utilities
  6. @copyright    Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.
  7. @license        GNU/GPL, see LICENSE.php
  8. *  Joomla! is free software. This version may have been modified pursuant
  9. *  to the GNU General Public License, and as distributed it includes or
  10. *  is derivative of works licensed under the GNU General Public License or
  11. *  other free or open source software licenses.
  12. *  See COPYRIGHT.php for copyright notices and details.
  13. */
  14.  
  15. // Check to ensure this file is within the rest of the framework
  16. defined('JPATH_BASE'or die();
  17.  
  18. // Import library dependencies
  19. jimport('joomla.i18n.language');
  20.  
  21. define('JERR_PHP5'version_compare(phpversion()'5'>= 0);
  22. // Error Definition: Illegal Options
  23. define'JERR_ILLEGAL_OPTIONS');
  24. // Error Definition: Callback does not exist
  25. define'JERR_CALLBACK_NOT_CALLABLE');
  26. // Error Definition: Illegal Handler
  27. define'JERR_ILLEGAL_MODE');
  28.  
  29. /*
  30.  * JError exception stack
  31.  */
  32. $GLOBALS['_JError_Stack'array();
  33.  
  34. /*
  35.  * Default available error levels
  36.  */
  37. $GLOBALS['_JError_Levels'arrayE_NOTICE => 'Notice'E_WARNING => 'Warning'E_ERROR => 'Error' );
  38.  
  39. /*
  40.  * Default error handlers
  41.  */
  42. $GLOBALS['_JError_Handlers'arrayE_NOTICE => array'mode' => 'message' )E_WARNING => array'mode' => 'message' )E_ERROR => array'mode' => 'callback''options' => array('JError','customErrorPage') ) );
  43.  
  44. /**
  45.  * Error Handling Class
  46.  *
  47.  * This class is inspired in design and concept by patErrorManager <http://www.php-tools.net>
  48.  *
  49.  * patErrorManager contributors include:
  50.  *     - gERD Schaufelberger    <[email protected]>
  51.  *     - Sebastian Mordziol    <[email protected]>
  52.  *     - Stephan Schmidt        <[email protected]>
  53.  *
  54.  * @static
  55.  * @author        Louis Landry <[email protected]>
  56.  * @author        Johan Janssens <[email protected]>
  57.  * @package     Joomla.Framework
  58.  * @subpackage    Utilities
  59.  * @since        1.5
  60.  */
  61. class JError
  62. {
  63.     /**
  64.      * Method to determine if a value is an exception object.  This check supports both JException and PHP5 Exception objects
  65.      *
  66.      * @static
  67.      * @access    public
  68.      * @param    mixed    &$object    Object to check
  69.      * @return    boolean    True if argument is an exception, false otherwise.
  70.      * @since    1.5
  71.      */
  72.     function isError($object)
  73.     {
  74.         if (!is_object($object)) {
  75.             return false;
  76.         }
  77.         // supports PHP 5 exception handling
  78.         return is_a($object'JException'is_a($object'Exception');
  79.     }
  80.  
  81.     /**
  82.      * Method for retrieving the last exception object in the error stack
  83.      *
  84.      * @static
  85.      * @access    public
  86.      * @return    mixed    Last exception object in the error stack or boolean false if none exist
  87.      * @since    1.5
  88.      */
  89.     function getError($unset false)
  90.     {
  91.         if (!isset($GLOBALS['_JError_Stack'][0])) {
  92.             $false false;
  93.             return $false;
  94.         }
  95.         if ($unset{
  96.             $error array_shift($GLOBALS['_JError_Stack']);
  97.         else {
  98.             $error &$GLOBALS['_JError_Stack'][0];
  99.         }
  100.         return $error;
  101.     }
  102.  
  103.     /**
  104.      * Method for retrieving the exception stack
  105.      *
  106.      * @static
  107.      * @access    public
  108.      * @return    array     Chronological array of errors that have been stored during script execution
  109.      * @since    1.5
  110.      */
  111.     function getErrors()
  112.     {
  113.         return $GLOBALS['_JError_Stack'];
  114.     }
  115.  
  116.     /**
  117.      * Create a new JException object given the passed arguments
  118.      *
  119.      * @static
  120.      * @param    int        $level    The error level - use any of PHP's own error levels for this: E_ERROR, E_WARNING, E_NOTICE, E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE.
  121.      * @param    string    $code    The application-internal error code for this error
  122.      * @param    string    $msg    The error message, which may also be shown the user if need be.
  123.      * @param    mixed    $info    Optional: Additional error information (usually only developer-relevant information that the user should never see, like a database DSN).
  124.      * @return    mixed    The JException object
  125.      * @since    1.5
  126.      *
  127.      * @see        JException
  128.      */
  129.     function raise($level$code$msg$info null$backtrace false)
  130.     {
  131.         // build error object
  132.         $error new JException($level$code$msg$info$backtrace);
  133.  
  134.         // see what to do with this kind of error
  135.         $handler JError::getErrorHandling($level);
  136.  
  137.         $function 'handle'.ucfirst($handler['mode']);
  138.         if (is_callable(array('JError'$function))) {
  139.             $reference =JError::$function ($error(isset($handler['options'])) $handler['options'array());
  140.         else {
  141.             // This is required to prevent a very unhelpful white-screen-of-death
  142.             die(
  143.                 'JError::raise -> Static method JError::' $function ' does not exist.' .
  144.                 ' Contact a developer to debug' .
  145.                 '<br/><strong>Error was</strong> ' .
  146.                 '<br/>' $error->get('message')
  147.             );
  148.         }
  149.  
  150.         //store and return the error
  151.         $GLOBALS['_JError_Stack'][=$reference;
  152.         return $reference;
  153.     }
  154.  
  155.     /**
  156.      * Wrapper method for the {@link raise()} method with predefined error level of E_ERROR and backtrace set to true.
  157.      *
  158.      * @static
  159.      * @param    string    $code    The application-internal error code for this error
  160.      * @param    string    $msg    The error message, which may also be shown the user if need be.
  161.      * @param    mixed    $info    Optional: Additional error information (usually only developer-relevant information that the user should never see, like a database DSN).
  162.      * @return    object    $error    The configured JError object
  163.      * @since    1.5
  164.      */
  165.     function raiseError($code$msg$info null)
  166.     {
  167.         $reference JError::raise(E_ERROR$code$msg$infotrue);
  168.         return $reference;
  169.     }
  170.  
  171.     /**
  172.      * Wrapper method for the {@link raise()} method with predefined error level of E_WARNING and backtrace set to false.
  173.      *
  174.      * @static
  175.      * @param    string    $code    The application-internal error code for this error
  176.      * @param    string    $msg    The error message, which may also be shown the user if need be.
  177.      * @param    mixed    $info    Optional: Additional error information (usually only developer-relevant information that the user should never see, like a database DSN).
  178.      * @return    object    $error    The configured JError object
  179.      * @since    1.5
  180.      */
  181.     function raiseWarning($code$msg$info null)
  182.     {
  183.         $reference JError::raise(E_WARNING$code$msg$info);
  184.         return $reference;
  185.     }
  186.  
  187.     /**
  188.      * Wrapper method for the {@link raise()} method with predefined error level of E_NOTICE and backtrace set to false.
  189.      *
  190.      * @static
  191.      * @param    string    $code    The application-internal error code for this error
  192.      * @param    string    $msg    The error message, which may also be shown the user if need be.
  193.      * @param    mixed    $info    Optional: Additional error information (usually only developer-relevant information that the user should never see, like a database DSN).
  194.      * @return    object    $error    The configured JError object
  195.      * @since    1.5
  196.      */
  197.     function raiseNotice($code$msg$info null)
  198.     {
  199.         $reference JError::raise(E_NOTICE$code$msg$info);
  200.         return $reference;
  201.     }
  202.  
  203.    /**
  204.     * Method to get the current error handler settings for a specified error level.
  205.     *
  206.     * @static
  207.     * @param    int        $level    The error level to retrieve. This can be any of PHP's own error levels, e.g. E_ALL, E_NOTICE...
  208.     * @return    array    All error handling details
  209.     * @since    1.5
  210.     */
  211.     function getErrorHandling$level )
  212.     {
  213.         return $GLOBALS['_JError_Handlers'][$level];
  214.     }
  215.  
  216.     /**
  217.      * Method to set the way the JError will handle different error levels. Use this if you want to override the default settings.
  218.      *
  219.      * Error handling modes:
  220.      * - ignore
  221.      * - echo
  222.      * - verbose
  223.      * - die
  224.      * - message
  225.      * - log
  226.      * - trigger
  227.      * - callback
  228.      *
  229.      * You may also set the error handling for several modes at once using PHP's bit operations.
  230.      * Examples:
  231.      * - E_ALL = Set the handling for all levels
  232.      * - E_ERROR | E_WARNING = Set the handling for errors and warnings
  233.      * - E_ALL ^ E_ERROR = Set the handling for all levels except errors
  234.      *
  235.      * @static
  236.      * @param    int        $level        The error level for which to set the error handling
  237.      * @param    string    $mode        The mode to use for the error handling.
  238.      * @param    mixed    $options    Optional: Any options needed for the given mode.
  239.      * @return    mixed    True on success, or a JException object if failed.
  240.      * @since    1.5
  241.      */
  242.     function setErrorHandling($level$mode$options null)
  243.     {
  244.         $levels $GLOBALS['_JError_Levels'];
  245.  
  246.         $function 'handle'.ucfirst($mode);
  247.         if (!is_callable(array ('JError',$function))) {
  248.             return JError::raiseError(E_ERROR'JError:'.JERR_ILLEGAL_MODE'Error Handling mode is not knwon''Mode: '.$mode.' is not implemented.');
  249.         }
  250.  
  251.         foreach ($levels as $eLevel => $eTitle{
  252.             if (($level $eLevel!= $eLevel{
  253.                 continue;
  254.             }
  255.  
  256.             // set callback options
  257.             if ($mode == 'callback'{
  258.                 if (!is_array($options)) {
  259.                     return JError::raiseError(E_ERROR'JError:'.JERR_ILLEGAL_OPTIONS'Options for callback not valid');
  260.                 }
  261.  
  262.                 if (!is_callable($options)) {
  263.                     $tmp array ('GLOBAL');
  264.                     if (is_array($options)) {
  265.                         $tmp[0$options[0];
  266.                         $tmp[1$options[1];
  267.                     else {
  268.                         $tmp[1$options;
  269.                     }
  270.  
  271.                     return JError::raiseError(E_ERROR'JError:'.JERR_CALLBACK_NOT_CALLABLE'Function is not callable''Function:'.$tmp[1].' scope '.$tmp[0].'.');
  272.                 }
  273.             }
  274.  
  275.             // save settings
  276.             $GLOBALS['_JError_Handlers'][$eLevelarray ('mode' => $mode);
  277.             if ($options != null{
  278.                 $GLOBALS['_JError_Handlers'][$eLevel]['options'$options;
  279.             }
  280.         }
  281.  
  282.         return true;
  283.     }
  284.  
  285.    /**
  286.     * Method to register a new error level for handling errors
  287.     *
  288.     * This allows you to add custom error levels to the built-in
  289.     * - E_NOTICE
  290.     * - E_WARNING
  291.     * - E_NOTICE
  292.     *
  293.     * @static
  294.     * @param    int        $level        Error level to register
  295.     * @param    string    $name        Human readable name for the error level
  296.     * @param    string    $handler    Error handler to set for the new error level [optional]
  297.     * @return    boolean    True on success; false if the level already has been registered
  298.     * @since    1.5
  299.     */
  300.     function registerErrorLevel$level$name$handler 'ignore' )
  301.     {
  302.         ifisset($GLOBALS['_JError_Levels'][$level]) ) {
  303.             return false;
  304.         }
  305.         $GLOBALS['_JError_Levels'][$level$name;
  306.         JError::setErrorHandling($level$handler);
  307.         return true;
  308.     }
  309.  
  310.    /**
  311.     * Translate an error level integer to a human readable string
  312.     * e.g. E_ERROR will be translated to 'Error'
  313.     *
  314.     * @static
  315.     * @param    int        $level    Error level to translate
  316.     * @return    mixed    Human readable error level name or boolean false if it doesn't exist
  317.     * @since    1.5
  318.     */
  319.     function translateErrorLevel$level )
  320.     {
  321.         ifisset($GLOBALS['_JError_Levels'][$level]) ) {
  322.             return $GLOBALS['_JError_Levels'][$level];
  323.         }
  324.         return false;
  325.     }
  326.  
  327.     /**
  328.      * Ignore error handler
  329.      *     - Ignores the error
  330.      *
  331.      * @static
  332.      * @param    object    $error        Exception object to handle
  333.      * @param    array    $options    Handler options
  334.      * @return    object    The exception object
  335.      * @since    1.5
  336.      *
  337.      * @see    raise()
  338.      */
  339.     function handleIgnore(&$error$options)
  340.     {
  341.         return $error;
  342.     }
  343.  
  344.     /**
  345.      * Echo error handler
  346.      *     - Echos the error message to output
  347.      *
  348.      * @static
  349.      * @param    object    $error        Exception object to handle
  350.      * @param    array    $options    Handler options
  351.      * @return    object    The exception object
  352.      * @since    1.5
  353.      *
  354.      * @see    raise()
  355.      */
  356.     function handleEcho(&$error$options)
  357.     {
  358.         $level_human JError::translateErrorLevel($error->get('level'));
  359.  
  360.         if (isset ($_SERVER['HTTP_HOST'])) {
  361.             // output as html
  362.             echo "<br /><b>jos-$level_human</b>: ".$error->get('message')."<br />\n";
  363.         else {
  364.             // output as simple text
  365.             if (defined('STDERR')) {
  366.                 fwrite(STDERR"jos-$level_human".$error->get('message')."\n");
  367.             else {
  368.                 echo "jos-$level_human".$error->get('message')."\n";
  369.             }
  370.         }
  371.         return $error;
  372.     }
  373.  
  374.     /**
  375.      * Verbose error handler
  376.      *     - Echos the error message to output as well as related info
  377.      *
  378.      * @static
  379.      * @param    object    $error        Exception object to handle
  380.      * @param    array    $options    Handler options
  381.      * @return    object    The exception object
  382.      * @since    1.5
  383.      *
  384.      * @see    raise()
  385.      */
  386.     function handleVerbose($error$options)
  387.     {
  388.         $level_human JError::translateErrorLevel($error->get('level'));
  389.         $info $error->get('info');
  390.  
  391.         if (isset ($_SERVER['HTTP_HOST'])) {
  392.             // output as html
  393.             echo "<br /><b>J$level_human</b>: ".$error->get('message')."<br />\n";
  394.             if ($info != null{
  395.                 echo "&nbsp;&nbsp;&nbsp;".$info."<br />\n";
  396.             }
  397.             echo $error->getBacktrace(true);
  398.         else {
  399.             // output as simple text
  400.             echo "J$level_human".$error->get('message')."\n";
  401.             if ($info != null{
  402.                 echo "\t".$info."\n";
  403.             }
  404.  
  405.         }
  406.         return $error;
  407.     }
  408.  
  409.     /**
  410.      * Die error handler
  411.      *     - Echos the error message to output and then dies
  412.      *
  413.      * @static
  414.      * @param    object    $error        Exception object to handle
  415.      * @param    array    $options    Handler options
  416.      * @return    object    The exception object
  417.      * @since    1.5
  418.      *
  419.      * @see    raise()
  420.      */
  421.     function handleDie($error$options)
  422.     {
  423.         $level_human JError::translateErrorLevel($error->get('level'));
  424.  
  425.         if (isset ($_SERVER['HTTP_HOST'])) {
  426.             // output as html
  427.             die("<br /><b>J$level_human</b".$error->get('message')."<br />\n");
  428.         else {
  429.             // output as simple text
  430.             if (defined('STDERR')) {
  431.                 fwrite(STDERR"J$level_human ".$error->get('message')."\n");
  432.             else {
  433.                 die("J$level_human ".$error->get('message')."\n");
  434.             }
  435.         }
  436.         return $error;
  437.     }
  438.  
  439.     /**
  440.      * Message error handler
  441.      *     - Enqueues the error message into the system queue
  442.      *
  443.      * @static
  444.      * @param    object    $error        Exception object to handle
  445.      * @param    array    $options    Handler options
  446.      * @return    object    The exception object
  447.      * @since    1.5
  448.      *
  449.      * @see    raise()
  450.      */
  451.     function handleMessage($error$options)
  452.     {
  453.         global $mainframe;
  454.         $mainframe->enqueueMessage($error->get('message')'error');
  455.         return $error;
  456.     }
  457.  
  458.     /**
  459.      * Log error handler
  460.      *     - Logs the error message to a system log file
  461.      *
  462.      * @static
  463.      * @param    object    $error        Exception object to handle
  464.      * @param    array    $options    Handler options
  465.      * @return    object    The exception object
  466.      * @since    1.5
  467.      *
  468.      * @see    raise()
  469.      */
  470.     function handleLog($error$options)
  471.     {
  472.         static $log;
  473.  
  474.         if ($log == null{
  475.             jimport('joomla.utilities.log');
  476.             $fileName date('Y-m-d').'.error.log';
  477.             $options['format'"{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}";
  478.             $log JLog::getInstance($fileName$options);
  479.         }
  480.  
  481.         $entry['level'$error->get('level');
  482.         $entry['code'$error->get('code');
  483.         $entry['message'str_replace(array ("\r","\n")array ('','\\n')$error->get('message'));
  484.         $log->addEntry($entry);
  485.  
  486.         return $error;
  487.     }
  488.  
  489.     /**
  490.      * Trigger error handler
  491.      *     - Triggers a PHP native error with the error message
  492.      *
  493.      * @static
  494.      * @param    object    $error        Exception object to handle
  495.      * @param    array    $options    Handler options
  496.      * @return    object    The exception object
  497.      * @since    1.5
  498.      *
  499.      * @see    raise()
  500.      */
  501.     function &handleTrigger&$error$options )
  502.     {
  503.         switch$error->get('level') )
  504.         {
  505.             case    E_NOTICE:
  506.                 $level    =    E_USER_NOTICE;
  507.                 break;
  508.             case    E_WARNING:
  509.                 $level    =    E_USER_WARNING;
  510.                 break;
  511.             case    E_NOTICE:
  512.                 $level =    E_NOTICE;
  513.                 break;
  514.             default:
  515.                 $level    =    E_USER_ERROR;
  516.                 break;
  517.         }
  518.  
  519.         trigger_error$error->get('message')$level );
  520.         return $error;
  521.     }
  522.  
  523.      /**
  524.      * Callback error handler
  525.      *     - Send the error object to a callback method for error handling
  526.      *
  527.      * @static
  528.      * @param    object    $error        Exception object to handle
  529.      * @param    array    $options    Handler options
  530.      * @return    object    The exception object
  531.      * @since    1.5
  532.      *
  533.      * @see    raise()
  534.      */
  535.     function &handleCallback&$error$options )
  536.     {
  537.         $result call_user_func$options$error );
  538.         return $result;
  539.     }
  540.  
  541.     /**
  542.      * Display a custom error page and exit gracefully
  543.      *
  544.      * @static
  545.      * @param    object    $error Exception object
  546.      * @return    void 
  547.      * @since    1.5
  548.      */
  549.     function customErrorPage($error)
  550.     {
  551.         global $mainframe;
  552.  
  553.         // Initialize variables
  554.         jimport('joomla.document.document');
  555.         $document    JDocument::getInstance('error');
  556.         $config        JFactory::getConfig();
  557.  
  558.         // Get the current template from the application
  559.         $template $mainframe->getTemplate();
  560.  
  561.         // Push the error object into the document
  562.         $document->setError($error);
  563.  
  564.         @ob_end_clean();
  565.         jimport('joomla.i18n.language');
  566.         $document->setTitle(JText::_('Error').': '.$error->code);
  567.         $data $document->render(falsearray (
  568.             'template' => $template,
  569.             'directory' => JPATH_BASE.DS.'templates',
  570.             'debug' => $config->getValue('config.debug')
  571.         ));
  572.  
  573.         JResponse::setBody($data);
  574.         echo JResponse::toString();
  575.         $mainframe->close(0);
  576.     }
  577. }
  578.  
  579. /**
  580.  * Joomla! Exception object.
  581.  *
  582.  * This class is inspired in design and concept by patError <http://www.php-tools.net>
  583.  *
  584.  * patError contributors include:
  585.  *     - gERD Schaufelberger    <[email protected]>
  586.  *     - Sebastian Mordziol    <[email protected]>
  587.  *     - Stephan Schmidt        <[email protected]>
  588.  *
  589.  * @author        Louis Landry <[email protected]>
  590.  * @package     Joomla.Framework
  591.  * @subpackage    Utilities
  592.  * @since        1.5
  593.  */
  594. class JException extends JObject
  595. {
  596.    /**
  597.     * Error level
  598.     * @var string 
  599.     */
  600.     var    $level        = null;
  601.  
  602.    /**
  603.     * Error code
  604.     * @var string 
  605.     */
  606.     var    $code        = null;
  607.  
  608.    /**
  609.     * Error message
  610.     * @var string 
  611.     */
  612.     var    $message    = null;
  613.  
  614.    /**
  615.     * Additional info about the error relevant to the developer
  616.     *  - e.g. if a database connect fails, the dsn used
  617.     * @var string 
  618.     */
  619.     var    $info        = '';
  620.  
  621.    /**
  622.     * Name of the file the error occurred in [Available if backtrace is enabled]
  623.     * @var string 
  624.     */
  625.     var    $file        = null;
  626.  
  627.    /**
  628.     * Line number the error occurred in [Available if backtrace is enabled]
  629.     * @var int 
  630.     */
  631.     var    $line        = 0;
  632.  
  633.    /**
  634.     * Name of the method the error occurred in [Available if backtrace is enabled]
  635.     * @var string 
  636.     */
  637.     var    $function    = null;
  638.  
  639.    /**
  640.     * Name of the class the error occurred in [Available if backtrace is enabled]
  641.     * @var string 
  642.     */
  643.     var    $class        = null;
  644.  
  645.    /**
  646.     * Error type
  647.     * @var string 
  648.     */
  649.     var    $type        = null;
  650.  
  651.    /**
  652.     * Arguments recieved by the method the error occurred in [Available if backtrace is enabled]
  653.     * @var array 
  654.     */
  655.     var    $args        = array();
  656.  
  657.    /**
  658.     * Backtrace information
  659.     * @var mixed 
  660.     */
  661.     var    $backtrace    = false;
  662.  
  663.    /**
  664.     * Constructor
  665.     *     - used to set up the error with all needed error details.
  666.     *
  667.     * @access    protected
  668.     * @param    int        $level    The error level (use the PHP constants E_ALL, E_NOTICE etc.).
  669.     * @param    string    $code    The error code from the application
  670.     * @param    string    $msg    The error message
  671.     * @param    string    $info    Optional: The additional error information.
  672.     */
  673.     function __construct$level$code$msg$info null$backtrace false )
  674.     {
  675.         $this->level    =    $level;
  676.         $this->code        =    $code;
  677.         $this->message    =    $msg;
  678.  
  679.         if$info != null {
  680.             $this->info = $info;
  681.         }
  682.  
  683.         if$backtrace && function_exists'debug_backtrace' ) ) {
  684.             $this->backtrace = debug_backtrace();
  685.  
  686.             for$i count$this->backtrace 1$i >= 0--$i )
  687.             {
  688.                 ++$i;
  689.                 ifisset$this->backtrace[$i]['file') )
  690.                     $this->file        = $this->backtrace[$i]['file'];
  691.                 ifisset$this->backtrace[$i]['line') )
  692.                     $this->line        = $this->backtrace[$i]['line'];
  693.                 ifisset$this->backtrace[$i]['class') )
  694.                     $this->class    = $this->backtrace[$i]['class'];
  695.                 ifisset$this->backtrace[$i]['function') )
  696.                     $this->function    = $this->backtrace[$i]['function'];
  697.                 ifisset$this->backtrace[$i]['type') )
  698.                     $this->type        = $this->backtrace[$i]['type'];
  699.  
  700.                 $this->args        = false;
  701.                 ifisset$this->backtrace[$i]['args') ) {
  702.                     $this->args        = $this->backtrace[$i]['args'];
  703.                 }
  704.                 break;
  705.             }
  706.         }
  707.     }
  708.  
  709.    /**
  710.     * Method to get the backtrace information for an exception object
  711.     *
  712.     * @access    public
  713.     * @return    array backtrace
  714.     * @since    1.5
  715.     */
  716.     function getBacktrace$formatted=false )
  717.     {
  718.         if ($formatted && is_array$this->backtrace )) {
  719.             $result '';
  720.             foreach$this->backtrace as $back{
  721.                 if (isset($back['file']&& strpos($back['file']'error.php'=== false{
  722.                     $result .= '<br />'.$back['file'].':'.$back['line'];
  723.                 }
  724.             }
  725.             return $result;
  726.         }
  727.         return $this->backtrace;
  728.     }
  729. }
  730. ?>

Documentation generated on Mon, 05 Mar 2007 20:57:47 +0000 by phpDocumentor 1.3.1