From 2965a981b7ec22866fbdf2d567d87e2d068d3617 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Fri, 31 Jul 2015 16:04:08 -0400
Subject: [PATCH] Allow to search and import missing PGP pubkeys from keyservers using Publickey.js
---
program/lib/Roundcube/rcube.php | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php
index cf6ebf9..ae5957e 100644
--- a/program/lib/Roundcube/rcube.php
+++ b/program/lib/Roundcube/rcube.php
@@ -37,6 +37,8 @@
const REQUEST_ERROR_URL = 1;
const REQUEST_ERROR_TOKEN = 2;
+ const DEBUG_LINE_LENGTH = 4096;
+
/**
* Singleton instace of rcube
*
@@ -1453,6 +1455,32 @@
/**
+ * Write debug info to the log
+ *
+ * @param string Engine type - file name (memcache, apc)
+ * @param string Data string to log
+ * @param bool Operation result
+ */
+ public static function debug($engine, $data, $result = null)
+ {
+ static $debug_counter;
+
+ $line = '[' . (++$debug_counter[$engine]) . '] ' . $data;
+
+ if (($len = strlen($line)) > self::DEBUG_LINE_LENGTH) {
+ $diff = $len - self::DEBUG_LINE_LENGTH;
+ $line = substr($line, 0, self::DEBUG_LINE_LENGTH) . "... [truncated $diff bytes]";
+ }
+
+ if ($result !== null) {
+ $line .= ' [' . ($result ? 'TRUE' : 'FALSE') . ']';
+ }
+
+ self::write_log($engine, $line);
+ }
+
+
+ /**
* Returns current time (with microseconds).
*
* @return float Current time in seconds since the Unix
--
Gitblit v1.9.1