diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-10-02 16:17:56 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-10-06 08:51:47 +0200 |
commit | b51996540889b29b3b1d2bc118f652c7b942404b (patch) | |
tree | 9c324a8f8d93c27b4ee4f72a220ff3989813506f /core | |
parent | 3ff60cc2e3a47efd9796b5376694743c168efeb3 (diff) | |
download | nextcloud-server-b51996540889b29b3b1d2bc118f652c7b942404b.tar.gz nextcloud-server-b51996540889b29b3b1d2bc118f652c7b942404b.zip |
[admin] check for correct PHP memcached module
Diffstat (limited to 'core')
-rw-r--r-- | core/js/setupchecks.js | 6 | ||||
-rw-r--r-- | core/js/tests/specs/setupchecksSpec.js | 46 |
2 files changed, 46 insertions, 6 deletions
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index 2e21c6ad725..6e2058d54fc 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -98,6 +98,12 @@ type: OC.SetupChecks.MESSAGE_TYPE_WARNING }); } + if(!data.isCorrectMemcachedPHPModuleInstalled) { + messages.push({ + msg: t('core', 'Memcached is configured as distributed cache, but the wrong PHP module "memcache" is installed. \\OC\\Memcache\\Memcached only supports "memcached" and not "memcache". See the <a href="{wikiLink}">memcached wiki about both modules</a>.', {wikiLink: 'https://code.google.com/p/memcached/wiki/PHPClientComparison'}), + type: OC.SetupChecks.MESSAGE_TYPE_WARNING + }); + } } else { messages.push({ msg: t('core', 'Error occurred while checking server setup'), diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js index c70ea0ff9fa..8dd2214621a 100644 --- a/core/js/tests/specs/setupchecksSpec.js +++ b/core/js/tests/specs/setupchecksSpec.js @@ -73,7 +73,8 @@ describe('OC.SetupChecks tests', function() { isUrandomAvailable: true, serverHasInternetConnection: false, memcacheDocs: 'https://doc.owncloud.org/server/go.php?to=admin-performance', - forwardedForHeadersWorking: true + forwardedForHeadersWorking: true, + isCorrectMemcachedPHPModuleInstalled: true, }) ); @@ -106,7 +107,8 @@ describe('OC.SetupChecks tests', function() { serverHasInternetConnection: false, dataDirectoryProtected: false, memcacheDocs: 'https://doc.owncloud.org/server/go.php?to=admin-performance', - forwardedForHeadersWorking: true + forwardedForHeadersWorking: true, + isCorrectMemcachedPHPModuleInstalled: true, }) ); @@ -141,7 +143,8 @@ describe('OC.SetupChecks tests', function() { serverHasInternetConnection: false, dataDirectoryProtected: false, isMemcacheConfigured: true, - forwardedForHeadersWorking: true + forwardedForHeadersWorking: true, + isCorrectMemcachedPHPModuleInstalled: true, }) ); @@ -173,7 +176,8 @@ describe('OC.SetupChecks tests', function() { serverHasInternetConnection: true, dataDirectoryProtected: true, isMemcacheConfigured: true, - forwardedForHeadersWorking: true + forwardedForHeadersWorking: true, + isCorrectMemcachedPHPModuleInstalled: true, }) ); @@ -186,6 +190,34 @@ describe('OC.SetupChecks tests', function() { }); }); + it('should return an error if the wrong memcache PHP module is installed', function(done) { + var async = OC.SetupChecks.checkSetup(); + + suite.server.requests[0].respond( + 200, + { + 'Content-Type': 'application/json', + }, + JSON.stringify({ + isUrandomAvailable: true, + securityDocs: 'https://docs.owncloud.org/myDocs.html', + serverHasInternetConnection: true, + dataDirectoryProtected: true, + isMemcacheConfigured: true, + forwardedForHeadersWorking: true, + isCorrectMemcachedPHPModuleInstalled: false, + }) + ); + + async.done(function( data, s, x ){ + expect(data).toEqual([{ + msg: 'Memcached is configured as distributed cache, but the wrong PHP module "memcache" is installed. \\OC\\Memcache\\Memcached only supports "memcached" and not "memcache". See the <a href="https://code.google.com/p/memcached/wiki/PHPClientComparison">memcached wiki about both modules</a>.', + type: OC.SetupChecks.MESSAGE_TYPE_WARNING + }]); + done(); + }); + }); + it('should return an error if the forwarded for headers are not working', function(done) { var async = OC.SetupChecks.checkSetup(); @@ -200,7 +232,8 @@ describe('OC.SetupChecks tests', function() { dataDirectoryProtected: true, isMemcacheConfigured: true, forwardedForHeadersWorking: false, - reverseProxyDocs: 'https://docs.owncloud.org/foo/bar.html' + reverseProxyDocs: 'https://docs.owncloud.org/foo/bar.html', + isCorrectMemcachedPHPModuleInstalled: true, }) ); @@ -248,7 +281,8 @@ describe('OC.SetupChecks tests', function() { dataDirectoryProtected: true, isMemcacheConfigured: true, forwardedForHeadersWorking: true, - phpSupported: {eol: true, version: '5.4.0'} + phpSupported: {eol: true, version: '5.4.0'}, + isCorrectMemcachedPHPModuleInstalled: true, }) ); |