Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- catch (PDOException $e) {
- if(!file_exists('countError.txt')) {
- $countErrorFile = fopen('countError.txt', 'w');
- fwrite($countErrorFile, 1);
- $fp = fopen('error.txt', 'w');
- fwrite($fp, 'Count bad requests ');
- fwrite($fp, 1);
- fwrite($fp, '. Error = ');
- fwrite($fp, $e->getMessage());
- }
- else {
- $readCountError = file_get_contents('countError.txt', NULL, NULL, 0);
- $countErrorFile = fopen('countError.txt', 'w');
- fwrite($countErrorFile, $readCountError + 1);
- $fp = fopen('error.txt', 'w');
- fwrite($fp, 'Count bad requests ');
- fwrite($fp, $readCountError + 1);
- fwrite($fp, '. Error = ');
- fwrite($fp, $e->getMessage());
- }
- die('<p>Произошла ошибка.</p>');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement