Browse Source

Remove hardcoded link to performance docs

tags/v8.1.0alpha1
Joas Schilling 9 years ago
parent
commit
81ec1c8a1a

+ 1
- 1
core/js/setupchecks.js View 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 {

+ 4
- 4
core/js/tests/specs/setupchecksSpec.js View 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();
});
});

+ 1
- 0
settings/application.php View File

@@ -124,6 +124,7 @@ class Application extends App {
$c->query('Request'),
$c->query('Config'),
$c->query('ClientService'),
$c->query('URLGenerator'),
$c->query('Util')
);
});

+ 7
- 0
settings/controller/checksetupcontroller.php View 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'),
]
);
}

+ 14
- 3
tests/settings/controller/CheckSetupControllerTest.php View File

@@ -22,11 +22,12 @@
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());

Loading…
Cancel
Save