cvs: pear /Math_Vector CompactedTuple.php

From: Date: Wed, 24 Apr 2002 23:37:20 +0000
Subject: cvs: pear /Math_Vector CompactedTuple.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-3527@lists.php.net to get a copy of this message
jmcastagnetto Wed Apr 24 19:37:20 2002 EDT Modified files: /pear/Math_Vector CompactedTuple.php Log: Modified to just die when the constructor fails. Using PEAR_ERROR_DIE directly Index: pear/Math_Vector/CompactedTuple.php diff -u pear/Math_Vector/CompactedTuple.php:1.1 pear/Math_Vector/CompactedTuple.php:1.2 --- pear/Math_Vector/CompactedTuple.php:1.1 Wed Apr 24 18:36:03 2002 +++ pear/Math_Vector/CompactedTuple.php Wed Apr 24 19:37:19 2002 @@ -16,7 +16,7 @@ // | Authors: Jesus M. Castagnetto <jmcastagnetto@php.net> | // +----------------------------------------------------------------------+ // -// $Id: CompactedTuple.php,v 1.1 2002/04/24 22:36:03 jmcastagnetto Exp $ +// $Id: CompactedTuple.php,v 1.2 2002/04/24 23:37:19 jmcastagnetto Exp $ // require_once "PEAR.php"; @@ -32,12 +32,10 @@ } elseif (is_object($arg) && get_class($arg) == "math_tuple") { $this->data = $this->_genCompacterArray($arg->getData()); } else { - $this->_fatal( - "Incorrect parameter for Math_CompactedTuple constructor. ". + $msg = "Incorrect parameter for Math_CompactedTuple constructor. ". "Expecting an unidimensional array or a Math_Tuple object,". - " got '$arg'", - "in line ".__LINE__." of file ".__FILE__ - ); + " got '$arg'\n"; + new PEAR_Error($msg, null, PEAR_ERROR_DIE); } return true; } @@ -94,17 +92,6 @@ $out[] = $val; return $out; } - - function _fatal($msg, $dbg) { - return new PEAR_Error($msg, null, PEAR_ERROR_CALLBACK, "handleError", $dbg); - } -} - -function handleError($err) { - $msg = "*FATAL ERROR* ".$err->message."\n".$err->userinfo." ". - "(PHP ".PHP_VERSION.", ".PHP_OS.") ". - "Aborting ...\n"; - die(wordwrap($msg,50)); } ?>

« previous php.pear.cvs (#3527) next »