Fråga Google

You searched for: generating (Turkiska - Rumänska)

Mänskliga bidrag

Från professionella översättare, företag, webbsidor och fritt tillgängliga översättningsdatabaser.

Lägg till en översättning

Turkiska

Rumänska

Info

Turkiska

?php / / signal handler function function sig_handler( $signo) {switch($signo) {case SIGTERM: / / handle shutdown tasks exit; break; case SIGHUP: / / handle restart tasks break; case SIGUSR1: print "Caught SIGUSR1...\n"; break; default: / / handle all other signals}} print "Installing signal handler...\n"; / / setup signal handlers pcntl_signal(SIGTERM, "sig_handler"); pcntl_signal(SIGHUP, "sig_handler"); pcntl_signal(SIGUSR1, "sig_handler"); print "Generating signal SIGTERM to self...\n"; / / send SIGUSR1 to current process id posix_kill(posix_getpid(), SIGUSR1); print "Done\n "?

Rumänska

Exemplu 1. pcntl_signal() Example

Senast uppdaterad: 2011-10-24
Användningsfrekvens: 1
Kvalitet:

Varning: Innehåller osynlig HTML-formatering

Turkiska

?php / / redefine the user error constants - PHP 4 only define (FATAL,E_USER_ERROR); define (ERROR,E_USER_WARNING); define (WARNING,E_USER_NOTICE); / / set the error reporting level for this script error_reporting (FATAL _BAR_ ERROR _BAR_ WARNING); / / error handler function function myErrorHandler ($errno, $errstr, $errfile, $errline) {switch ($errno) {case FATAL: echo "b FATAL / b [$errno] $errstr br \n"; echo" Fatal error in line ".$errline. "of file ".$errfile; echo", PHP ".PHP_VERSION. "(".PHP_OS .") br \n"; echo "Aborting... br \n"; exit 1; break; case ERROR: echo" b ERROR / b [$errno] $errstr br \n"; break; case WARNING: echo "b WARNING / b [$errno] $errstr br \n"; break; default: echo "Unkown error type: [$errno] $errstr br \n"; break;}} / / function to test the error handling function scale_by_log ($vect, $scale) {if (!is_numeric($scale) _BAR_ _BAR_ $scale = 0) trigger_error("log(x) for x = 0 is undefined, you used: scale = $scale", FATAL); if (!is_array($vect)) {trigger_error("Incorrect input vector, array of values expected", ERROR); return null;} for ($i=0; $i count($vect); $i++) {if (!is_numeric($vect[$i])) trigger_error("Value at position $i is not a number, using 0 (zero)", WARNING); $temp[$i] = log($scale) * $vect[$i];} return $temp;} / / set to the user defined error handler $old_error_handler = set_error_handler("myErrorHandler"); / / trigger some errors, first define a mixed array with a non-numeric item echo "vector a\n"; $a = array(2,3 ,"foo",5.5,43.3,21.11); print_r($a); / / now generate second array, generating a warning echo "----\nvector b - a warning (b = log(PI) * a)\n"; $b = scale_by_log($a, M_PI); print_r($b); / / this is trouble, we pass a string instead of an array echo "----\nvector c - an error\n"; $c = scale_by_log("not array",2.3); var_dump($c); / / this is a critical error, log of zero or negative number is undefined echo "----\nvector d - fatal error\n"; $d = scale_by_log($a, -2.5);?

Rumänska

PHP_OS. ") br \n"; "Abandon... br \n"; exit(1); break; case ERROR: echo" b ERROR / b [$errlevel] $errstr br \n"; break; case WARNING: echo "b WARNING / b [$errlevel] $errstr br \n"; break; default: echo "Eroare de tip necunoscut: [$errlevel] $errstr br \n"; break;}} / / funcţie pentru testarea tratării erorilor function scale_by_log ($vect, $scale) {if (!is_numeric($scale) _BAR_ _BAR_ $scale = 0) {trigger_error("log(x) pentru x = 0 nu este definita, ati folosit: scale = $scale", FATAL);} if (!is_array($vect)) {trigger_error("Tablou de intrare incorect, trebuia un tablou de valori", ERROR); return null;} for ($i = 0; $i count($vect); $i++) {if (!is_numeric($vect[$i])) {trigger_error("Valoarea de la pozitia $i nu este un numar, se va folosi 0 (zero)", WARNING);} $temp[$i] = log($scale) * $vect[$i];} return $temp;} / / setarea gestionarului de erori definit de utilizator $old_error_handler = set_error_handler("myErrorHandler"); / / se defineşte un tablou cu un element non-numeric / / şi se declanşează eroare echo "tablou a pre \n"; $a = array(2, 3, "foo", 5.5, 43.3, 21.11); print_r($a); echo" / pre "; / / se generează al doilea tablou şi se declanşează o avertizare echo "--- - br \ntablou b - o atentionare (b = log(PI) * a)\n pre"; $b = scale_by_log($a, M_PI); print_r($b); echo "/ pre"; / / se transmite un şir de caractere în loc de un tablou echo "--- - br \ntablou c - eroare\n pre "; $c = scale_by_log("nu este tablou", 2.3); var_dump($c); echo" / pre \n"; / / o eroare critica: nu este definit log() pentru zero sau numere negative echo "--- - br \ntablou d - eroare fatala\n"; $d = scale_by_log($a, -2.5);?

Senast uppdaterad: 2011-10-24
Användningsfrekvens: 1
Kvalitet:

Varning: Innehåller osynlig HTML-formatering

Få en bättre översättning med
4,401,923,520 mänskliga bidrag

Användare ber nu om hjälp:



Vi använder cookies för att förbättra din upplevelse. Genom att fortsätta besöka den här webbplatsen godkänner du vår användning av cookies. Läs mer. OK