if ($bDebugLogErrorFiles) { // DEBUG ERROR $strDescription = PHP_EOL . 'PHP DEBUG ERROR (testing log to error-file)' . PHP_EOL; $strLine = 'SECOND line with semicolon ";" debugging' . PHP_EOL; logError(0, $strDescription, $strLine, 2); } # 21.1 - Read Source # if (!($fSource = fopen($filenameSource, 'r'))) { // Error: failed to open file $strDescription = PHP_EOL . '## error opening source filename [' . $filenameSource . '] ##' . PHP_EOL; $strLine = ''; logError(0, $strDescription, $strLine, 2); $strDescription = '> PHP EXIT <' . PHP_EOL; $strLine = ''; logError(0, $strDescription, $strLine, 2); flushExit(); exit; } else { // Log open source file $strDescription = '- open source filename [' . $filenameSource . ']' . PHP_EOL; $strLine = ''; logLog(0, $strDescription, $strLine, 2); } while (!feof($fSource)) { $strLineFile = trim(fgets($fSource)); if (false === $strLineFile) { $strDescription = '-- done reading source file (readline === false)' . PHP_EOL; $strLine = ''; logLog(0, $strDescription, $strLine, 2); } else { if ($nLineSourceHeaderLimit >= $nLineSource) {
function openErrorFile() { // Open error-file for append if not already opened // Declare global variables global $bErrorFileOpen, $fError, $filenameError; if (!$bErrorFileOpen) { // Open Error-file for writing if (!($fError = fopen($filenameError, 'a'))) { // Error: failed to open file $strDescription = PHP_EOL . '## error opening error filename [' . $filenameError . '] ##' . PHP_EOL; $strLine = ''; logError(0, $strDescription, $strLine, 2); $strDescription = '> PHP EXIT <' . PHP_EOL; $strLine = ''; logError(0, $strDescription, $strLine, 2); flushExit(); exit; } else { $bErrorFileOpen = true; // Log open error-filename $strDescription = '- open error filename [' . $filenameError . ']' . PHP_EOL; $strLine = ''; logLog(0, $strDescription, $strLine, 2); } } // Error-file open }