From professional translators, enterprises, web pages and freely available translation repositories.
when you open a script, the program will prompt you with the following message: are you sure you want to run the service script %scriptname% ?
При открытии сценария на экран будет выведено следующее сообщение: «Выполнить сценарий службы "%scriptname%"?»
?php / / we will do our own error handling error_reporting( 0); / / user defined error handling function function usererrorhandler ($errno, $errmsg, $filename, $linenum, $vars) {/ / timestamp for the error entry $dt = date("y-m-d h:i:s (t)"); / / define an assoc array of error string / / in reality the only entries we should / / consider are 2,8,256,512 and 1024 $errortype = array (1 = "error", 2 = "warning", 4 = "parsing error", 8 = "notice", 16 = "core error", 32 = "core warning", 64 = "compile error", 128 = "compile warning", 256 = "user error", 512 = "user warning", 1024= "user notice "); / / set of errors for which a var trace will be saved $user_errors = array(e_user_error, e_user_warning, e_user_notice); $err =" errorentry \n"; $err .= "\t datetime ".$dt. "/ datetime \n"; $err .= "\t errornum ".$errno." / errornum \n"; $err .= "\t errortype ".$errortype[$errno]. "/ errortype \n"; $err .= "\t errormsg ".$errmsg." / errormsg \n"; $err .= "\t scriptname ".$filename. "/ scriptname \n"; $err .= "\t scriptlinenum ".$linenum." / scriptlinenum \n"; if (in_array($errno, $user_errors)) $err .= "\t vartrace ".wddx_serialize_value($vars ,"variables"). "/ vartrace \n"; $err .=" / errorentry \n\n"; / / for testing / / echo $err; / / save to the error log, and e-mail me if there is a critical user error error_log($err, 3, "/ usr / local / php4 / error.log"); if ($errno == e_user_error) mail("phpdev@example.com" ,"critical user error",$err);} function distance ($vect1, $vect2) {if (!is_array($vect1) _bar_ _bar_ !is_array($vect2)) {trigger_error("incorrect parameters, arrays expected", e_user_error); return null;} if (count($vect1) != count($vect2)) {trigger_error("vectors need to be of the same size", e_user_error); return null;} for ($i=0; $i count($vect1); $i++) {$c1 = $vect1[$i]; $c2 = $vect2[$i]; $d = 0.0; if (!is_numeric($c1)) {trigger_error("coordinate $i in vector 1 is not a number, using zero", e_user_warning); $c1 = 0.0;} if (!is_numeric($c2)) {trigger_error("coordinate $i in vector 2 is not a number, using zero", e_user_warning); $c2 = 0.0;} $d += $c2*$c2 - $c1*$c1;} return sqrt($d);} $old_error_handler = set_error_handler("usererrorhandler"); / / undefined constant, generates a warning $t = i_am_not_defined; / / define some "vectors" $a = array(2,3 ,"foo"); $b = array(5.5, 4.3, -1.6); $c = array (1,-3); / / generate a user error $t1 = distance($c,$b) ."\n"; / / generate another user error $t2 = distance($b ,"i am not an array") ."\n"; / / generate a warning $t3 = distance($a,$b) ."\n";?
Смотрите также