| |
| * Link führt ins Internet |
|

| |
Befehl | Version | Beschreibung | Inhalt der Datei zahlen.txt | Beispiel | Ausgabe |
Befehl
| int connection_timeout ( void $ ) |
Version
Beschreibung
Mit connection_timeout() kann man feststellen, ob ein Skript durch ein Timeout beendet wurde. Dieser Status wird eintreten, wenn das eingestellte Zeitlimit überschritten wird. Standard-Timeout in der Apache-Konfigurationsdatei ist 30 Sekunden, oder über set_time_limit() eine vorgegebene Zeit. Diese Funktion ist ab der PHP-Version 4.0.5 nicht mehr vorhanden.
Siehe auch:
connevtion_aborted()
• connection_status()
• register_shutdown_function() |
Inhalt der Datei zahlen.txt
Monitore||17#"-Monitor||Monday 30th of July 2001 10:45:26 PM
|
Beispiel
<?PHP
register_shutdown_function ( 'countdown' );
set_time_limit ( 2 );
$produktseite = 'Monitore';
$produkt = '17"-Monitor';
$zeit = date ( 'l dS of F Y h:i:s A' );
for ( $x = 1; $x <= 666666666; $x++ )
{
echo $x . '<br>';
}
echo 'Ein simpler Shop<br>';
function countdown ()
{
$var = connection_timeout ();
switch ( $var )
{
case 1:
global $produktseite, $produkt, $zeit;
$werte = $produktseite . '||' . $produkt . '||' . $zeit . "\n";
$fp = fopen ( 'timeout.txt', 'a' );
fwrite ( $fp, $werte );
fclose ( $fp );
break;
default:
echo 'Alles OK - weiter gehts!';
break;
}
}
?>
|
Ausgabe
1
2
3
.
.
.
55983
55984
Fatal error: Maximum execution time of 2 seconds exceeded in e:\apache\htdocs/php/index.php on line 8
|
|
|
|
|
|
|


|