]> source.dussan.org Git - nextcloud-server.git/commitdiff
Remove hardcoded link to performance docs
authorJoas Schilling <nickvergessen@owncloud.com>
Tue, 7 Apr 2015 09:11:31 +0000 (11:11 +0200)
committerJoas Schilling <nickvergessen@owncloud.com>
Tue, 7 Apr 2015 10:25:30 +0000 (12:25 +0200)
core/js/setupchecks.js
core/js/tests/specs/setupchecksSpec.js
settings/application.php
settings/controller/checksetupcontroller.php
tests/settings/controller/CheckSetupControllerTest.php

index 82c068cd6832d1844854b541044dc6daab6208ef..9bb3face7517d25b418468a35b7273f028aa4325 100644 (file)
@@ -61,7 +61,7 @@
                                        }
                                        if(!data.isMemcacheConfigured) {
                                                messages.push(
-                                                       t('core', 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href="https://doc.owncloud.org/server/8.0/admin_manual/configuration_server/performance_tuning.html">documentation</a>.')
+                                                       t('core', 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href="{docLink}">documentation</a>.', {docLink: data.memcacheDocs})
                                                );
                                        }
                                } else {
index 779faa2544909ee32401bcabef523f6290746a56..3e6382603f57651cdd2ae2e5359e06386906e81c 100644 (file)
@@ -66,11 +66,11 @@ describe('OC.SetupChecks tests', function() {
                                {
                                        'Content-Type': 'application/json'
                                },
-                               JSON.stringify({serverHasInternetConnection: false})
+                               JSON.stringify({serverHasInternetConnection: false, memcacheDocs: 'https://doc.owncloud.org/server/go.php?to=admin-performance'})
                        );
 
                        async.done(function( data, s, x ){
-                               expect(data).toEqual(['This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features.', 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.', 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href="https://doc.owncloud.org/server/8.0/admin_manual/configuration_server/performance_tuning.html">documentation</a>.']);
+                               expect(data).toEqual(['This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features.', 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.', 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href="https://doc.owncloud.org/server/go.php?to=admin-performance">documentation</a>.']);
                                done();
                        });
                });
@@ -83,11 +83,11 @@ describe('OC.SetupChecks tests', function() {
                                {
                                        'Content-Type': 'application/json'
                                },
-                               JSON.stringify({serverHasInternetConnection: false, dataDirectoryProtected: false})
+                               JSON.stringify({serverHasInternetConnection: false, dataDirectoryProtected: false, memcacheDocs: 'https://doc.owncloud.org/server/go.php?to=admin-performance'})
                        );
 
                        async.done(function( data, s, x ){
-                               expect(data).toEqual(['This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features.', 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.', 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href="https://doc.owncloud.org/server/8.0/admin_manual/configuration_server/performance_tuning.html">documentation</a>.']);
+                               expect(data).toEqual(['This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features.', 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.', 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href="https://doc.owncloud.org/server/go.php?to=admin-performance">documentation</a>.']);
                                done();
                        });
                });
index b4596037964be76b14fa036e2ee94d3d5d5e80a5..eb8f0f7a9997f6f2a09b2eaa043b4492e62c98dd 100644 (file)
@@ -124,6 +124,7 @@ class Application extends App {
                                $c->query('Request'),
                                $c->query('Config'),
                                $c->query('ClientService'),
+                               $c->query('URLGenerator'),
                                $c->query('Util')
                        );
                });
index ae3f1b99c52f1c7a7e291fef8efde4fed70b8f63..15719ce215f540f996ba1390da175d9f176532bb 100644 (file)
@@ -27,6 +27,7 @@ use OCP\Http\Client\IClientService;
 use OCP\IConfig;
 use OCP\IRequest;
 use OC_Util;
+use OCP\IURLGenerator;
 
 /**
  * @package OC\Settings\Controller
@@ -38,23 +39,28 @@ class CheckSetupController extends Controller {
        private $clientService;
        /** @var \OC_Util */
        private $util;
+       /** @var IURLGenerator */
+       private $urlGenerator;
 
        /**
         * @param string $AppName
         * @param IRequest $request
         * @param IConfig $config
         * @param IClientService $clientService
+        * @param IURLGenerator $urlGenerator
         * @param \OC_Util $util
         */
        public function __construct($AppName,
                                                                IRequest $request,
                                                                IConfig $config,
                                                                IClientService $clientService,
+                                                               IURLGenerator $urlGenerator,
                                                                \OC_Util $util) {
                parent::__construct($AppName, $request);
                $this->config = $config;
                $this->clientService = $clientService;
                $this->util = $util;
+               $this->urlGenerator = $urlGenerator;
        }
 
        /**
@@ -93,6 +99,7 @@ class CheckSetupController extends Controller {
                                'serverHasInternetConnection' => $this->isInternetConnectionWorking(),
                                'dataDirectoryProtected' => $this->util->isHtaccessWorking($this->config),
                                'isMemcacheConfigured' => $this->isMemcacheConfigured(),
+                               'memcacheDocs' => $this->urlGenerator->linkToDocs('admin-performance'),
                        ]
                );
        }
index fc17d2adc4929156e461e1f6d749990b391c9f1f..26f9f4e9459ea346e99b7cc439f6576359f1a5e9 100644 (file)
 namespace OC\Settings\Controller;
 
 use OCP\AppFramework\Http\DataResponse;
-use Test\TestCase;
-use OCP\IRequest;
-use OCP\IConfig;
 use OCP\Http\Client\IClientService;
+use OCP\IConfig;
+use OCP\IRequest;
+use OCP\IURLGenerator;
 use OC_Util;
+use Test\TestCase;
 
 /**
  * Class CheckSetupControllerTest
@@ -42,6 +43,8 @@ class CheckSetupControllerTest extends TestCase {
        private $config;
        /** @var IClientService */
        private $clientService;
+       /** @var IURLGenerator */
+       private $urlGenerator;
        /** @var OC_Util */
        private $util;
 
@@ -58,12 +61,15 @@ class CheckSetupControllerTest extends TestCase {
                        ->disableOriginalConstructor()->getMock();
                $this->util = $this->getMockBuilder('\OC_Util')
                        ->disableOriginalConstructor()->getMock();
+               $this->urlGenerator = $this->getMockBuilder('\OCP\IURLGenerator')
+                       ->disableOriginalConstructor()->getMock();
 
                $this->checkSetupController = new CheckSetupController(
                        'settings',
                        $this->request,
                        $this->config,
                        $this->clientService,
+                       $this->urlGenerator,
                        $this->util
                );
        }
@@ -218,12 +224,17 @@ class CheckSetupControllerTest extends TestCase {
                $this->util->expects($this->once())
                        ->method('isHtaccessWorking')
                        ->will($this->returnValue(true));
+               $this->urlGenerator->expects($this->once())
+                       ->method('linkToDocs')
+                       ->with('admin-performance')
+                       ->willReturn('http://doc.owncloud.org/server/go.php?to=admin-performance');
 
                $expected = new DataResponse(
                        [
                                'serverHasInternetConnection' => false,
                                'dataDirectoryProtected' => true,
                                'isMemcacheConfigured' => true,
+                               'memcacheDocs' => 'http://doc.owncloud.org/server/go.php?to=admin-performance',
                        ]
                );
                $this->assertEquals($expected, $this->checkSetupController->check());