Read 'max_allowed_packet' from mysql config (requires latest HEAD of Roundcube core)

This commit is contained in:
Thomas Bruederli 2012-05-26 15:37:35 +02:00
parent b5b26e6800
commit e9be3f05ff

View file

@ -49,10 +49,14 @@ class kolab_storage_cache
$this->imap = $rcmail->get_storage();
$this->enabled = $rcmail->config->get('kolab_cache', false);
// remove sync-lock on script termination
if ($this->enabled)
if ($this->enabled) {
// remove sync-lock on script termination
$rcmail->add_shutdown_function(array($this, '_sync_unlock'));
// read max_allowed_packet from mysql config
$this->max_sql_packet = min($this->db->get_variable('max_allowed_packet', 1048500), 4*1024*1024) - 2000; // mysql limit or max 4 MB
}
if ($storage_folder)
$this->set_folder($storage_folder);
}