Mailinglisten-Archive |
Ich hab in dem Beispiel das throw unterschlagen: :-)
Am Montag, 23. Oktober 2006 15:02 schrieb Lutz Zetzsche:
> public function getMyFile($myFileName) {
> ....
> try {
if (file_exists($myFileName)) {
$myFileContent = file($myFileName);
} else {
throw new MyException('...');
}
> } catch (MyException $myException) {
> // Erstbehandlung: z.B. Mail, wenn Fehler auftritt
> mail(...);
> }
> ...
> }
php::bar PHP Wiki - Listenarchive