mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-11-28 10:30:42 +00:00
memcached port and host can be configured
This commit is contained in:
parent
8b80df9519
commit
81fc17a812
|
|
@ -146,6 +146,10 @@ class Settings { /* {{{ */
|
|||
var $_showSingleSearchHit = true;
|
||||
// enable/disable use of memcached
|
||||
var $_enableMemcached = false;
|
||||
// memcached host
|
||||
var $_memcachedHost = 'localhost';
|
||||
// memcached port
|
||||
var $_memcachedPort = '11211';
|
||||
// contentOffsetDirTo
|
||||
var $_contentOffsetDir = "1048576";
|
||||
// Maximum number of sub-directories per parent directory
|
||||
|
|
@ -653,6 +657,8 @@ class Settings { /* {{{ */
|
|||
$this->_maxUploadSize = strval($tab["maxUploadSize"]);
|
||||
$this->_enableXsendfile = Settings::boolVal($tab["enableXsendfile"]);
|
||||
$this->_enableMemcached = Settings::boolVal($tab["enableMemcached"]);
|
||||
$this->_memcachedHost = strval($tab["memcachedHost"]);
|
||||
$this->_memcachedPort = strval($tab["memcachedPort"]);
|
||||
}
|
||||
|
||||
// XML Path: /configuration/system/authentication
|
||||
|
|
@ -1055,6 +1061,8 @@ class Settings { /* {{{ */
|
|||
$this->setXMLAttributValue($node, "maxUploadSize", $this->_maxUploadSize);
|
||||
$this->setXMLAttributValue($node, "enableXsendfile", $this->_enableXsendfile);
|
||||
$this->setXMLAttributValue($node, "enableMemcached", $this->_enableMemcached);
|
||||
$this->setXMLAttributValue($node, "memcachedHost", $this->_memcachedHost);
|
||||
$this->setXMLAttributValue($node, "memcachedPort", $this->_memcachedPort);
|
||||
|
||||
// XML Path: /configuration/system/authentication
|
||||
$node = $this->getXMLNode($xml, '/configuration/system', 'authentication');
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ $dms = new SeedDMS_Core_DMS($db, $storage ? $storage : $settings->_contentDir.$s
|
|||
if($settings->_enableMemcached && extension_loaded('memcached')) {
|
||||
$memcache = new Memcached('seeddms');
|
||||
$memcache->addServers(array(
|
||||
array('localhost',11211),
|
||||
array($settings->_memcachedHost ?? 'localhost', $settings->_memcachedPort ?? 11211),
|
||||
));
|
||||
$dms->setMemcache($memcache);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,6 +189,8 @@ if ($action == "saveSettings")
|
|||
setStrValue("maxUploadSize"); // TODO: check if valid value, e.g. 1M or 5K
|
||||
setBoolValue("enableXsendfile");
|
||||
setBoolValue("enableMemcached");
|
||||
setStrValue("memcachedHost");
|
||||
setStrValue("memcachedPort");
|
||||
|
||||
// SETTINGS - SYSTEM - AUTHENTICATION
|
||||
setBoolValue("enableGuestLogin");
|
||||
|
|
|
|||
|
|
@ -755,6 +755,8 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
|
|||
<?php $this->showConfigText('settings_maxUploadSize', 'maxUploadSize'); ?>
|
||||
<?php $this->showConfigCheckbox('settings_enableXsendfile', 'enableXsendfile'); ?>
|
||||
<?php $this->showConfigCheckbox('settings_enableMemcached', 'enableMemcached'); ?>
|
||||
<?php $this->showConfigText('settings_memcachedHost', 'memcachedHost', '', 'localhost'); ?>
|
||||
<?php $this->showConfigText('settings_memcachedPort', 'memcachedPort', '', '11211'); ?>
|
||||
<!--
|
||||
-- SETTINGS - SYSTEM - AUTHENTICATION
|
||||
-->
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user