open($zipPath, ZipArchive::CREATE); if ($openResult === true) { if (file_exists($debugFilePath)) { $zip->addFile($debugFilePath, basename($debugFilePath)); } if (file_exists($oldDebugFilePath)) { $zip->addFile($oldDebugFilePath, basename($oldDebugFilePath)); } if (!$zip->close()) { abj404_logPhpFallback('logger-internal', 'debug log zip close failed for ' . $zipPath); } } else { abj404_logPhpFallback( 'logger-internal', 'debug log zip open failed for ' . $zipPath . ' (status ' . (string)$openResult . ')' ); } return $zipPath; } }