summaryrefslogtreecommitdiff
path: root/plugins/libkolab/lib/kolab_format_configuration.php
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-08-19 12:20:47 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2014-08-19 12:20:47 (GMT)
commit07308521792a182e9cd4de10d067b96c190d21a5 (patch)
treed6d96356c7eb52fe0af9f538e3bb3c4732be44e9 /plugins/libkolab/lib/kolab_format_configuration.php
parente3d29617ae5a0f72efca8f08b5c3f57af6cb4c26 (diff)
downloadroundcubemail-plugins-kolab-07308521792a182e9cd4de10d067b96c190d21a5.tar.gz
Cache relation members for better performance (#3452)
Diffstat (limited to 'plugins/libkolab/lib/kolab_format_configuration.php')
-rw-r--r--plugins/libkolab/lib/kolab_format_configuration.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/plugins/libkolab/lib/kolab_format_configuration.php b/plugins/libkolab/lib/kolab_format_configuration.php
index 6b71f3e..17b46a7 100644
--- a/plugins/libkolab/lib/kolab_format_configuration.php
+++ b/plugins/libkolab/lib/kolab_format_configuration.php
@@ -220,4 +220,29 @@ class kolab_format_configuration extends kolab_format
return $tags;
}
+
+ /**
+ * Callback for kolab_storage_cache to get words to index for fulltext search
+ *
+ * @return array List of words to save in cache
+ */
+ public function get_words()
+ {
+ $words = array();
+
+ foreach ((array)$this->data['members'] as $url) {
+ $member = kolab_storage_config::parse_member_url($url);
+
+ if (empty($member)) {
+ if (strpos($url, 'urn:uuid:') === 0) {
+ $words[] = substr($url, 9);
+ }
+ }
+ else if (!empty($member['params']['message-id'])) {
+ $words[] = $member['params']['message-id'];
+ }
+ }
+
+ return $words;
+ }
}