}
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 {
{
'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();
});
});
{
'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();
});
});
$c->query('Request'),
$c->query('Config'),
$c->query('ClientService'),
+ $c->query('URLGenerator'),
$c->query('Util')
);
});
use OCP\IConfig;
use OCP\IRequest;
use OC_Util;
+use OCP\IURLGenerator;
/**
* @package OC\Settings\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;
}
/**
'serverHasInternetConnection' => $this->isInternetConnectionWorking(),
'dataDirectoryProtected' => $this->util->isHtaccessWorking($this->config),
'isMemcacheConfigured' => $this->isMemcacheConfigured(),
+ 'memcacheDocs' => $this->urlGenerator->linkToDocs('admin-performance'),
]
);
}
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
private $config;
/** @var IClientService */
private $clientService;
+ /** @var IURLGenerator */
+ private $urlGenerator;
/** @var OC_Util */
private $util;
->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
);
}
$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());