Ejemplo n.º 1
0
        $__jpg_err = $aErrObject;
    }
    function Raise($aMsg, $aHalt = true)
    {
        global $__jpg_err;
        $tmp = new $__jpg_err();
        $tmp->Raise($aMsg, $aHalt);
    }
}
//
// ... and install the default error handler
//
if (USE_IMAGE_ERROR_HANDLER) {
    JpGraphError::Install("JpGraphErrObjectImg");
} else {
    JpGraphError::Install("JpGraphErrObject");
}
//
// Routine to determine if GD1 or GD2 is installed
//
function CheckGDVersion()
{
    $GDfuncList = get_extension_funcs('gd');
    if (!$GDfuncList) {
        return 0;
    } else {
        if (in_array('imagegd2', $GDfuncList) && in_array('imagecreatetruecolor', $GDfuncList)) {
            return 2;
        } else {
            return 1;
        }
Ejemplo n.º 2
0
include $JPGRAPH_PATH . "/jpgraph_bar.php";
#include($JPGRAPH_PATH . "/jpgraph_regstat.php");
if (method_exists(JpGraphError, "Install")) {
    $GLOBALS['JPGRAPH_VERSION'] = 2;
    class JpGraphErrObjectADEIException extends JpGraphErrObject
    {
        function Raise($aMsg, $aHalt = true)
        {
            $num = ADEIException::PLOTTER_EXCEPTION;
            if (preg_match("/to\\s+small\\s+plot\\s+area/i", $aMsg)) {
                $num = ADEIException::PLOTTER_WINDOW_TOO_SMALL;
            }
            throw new ADEIException(translate("JpGraph Exception: %s", $aMsg), $num);
        }
    }
    JpGraphError::Install("JpGraphErrObjectADEIException");
} else {
    $GLOBALS['JPGRAPH_VERSION'] = 3;
    JpGraphError::SetImageFlag(false);
    /*
        This is actually is not needed any more, and exceptions should be caught
        by try blocks, I suppose.
        
        class JpGraphADEIException extends JpGraphException {
    	static public function defaultHandler($aMsg,$aHalt=true) {
    	    $num = ADEIException::PLOTTER_EXCEPTION;
    	    if (preg_match("/to\s+small\s+plot\s+area/i", $aMsg)) $num = ADEIException::PLOTTER_WINDOW_TOO_SMALL;
    
    	    throw new ADEIException(translate("JpGraph Exception: %s", $aMsg), $num);
    	}
        }