summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@karoshi.org.uk>2015-03-30 11:24:44 +0100
committerRobin McCorkell <rmccorkell@karoshi.org.uk>2015-03-30 11:24:44 +0100
commit4f0abd910cae4e122ca8db2a9e6f588ac8df039a (patch)
treecff7a4d1b766b2db25afa8854079dce308f4917f /lib
parentcfe241a959d02fa856c0aca3cb7779b02cb3c943 (diff)
parent65202d2a18aca3b253ce5f3c7c9af17ee6d12e52 (diff)
downloadnextcloud-server-4f0abd910cae4e122ca8db2a9e6f588ac8df039a.tar.gz
nextcloud-server-4f0abd910cae4e122ca8db2a9e6f588ac8df039a.zip
Merge pull request #15269 from owncloud/migrate-checksetup-and-add-memcache
Add check for activated local memcache
Diffstat (limited to 'lib')
-rw-r--r--lib/private/setup.php3
-rw-r--r--lib/private/util.php43
2 files changed, 8 insertions, 38 deletions
diff --git a/lib/private/setup.php b/lib/private/setup.php
index 1aa2af124c6..7ca30e172ec 100644
--- a/lib/private/setup.php
+++ b/lib/private/setup.php
@@ -181,7 +181,8 @@ class Setup {
\OC\Setup::protectDataDirectory();
try {
- $htAccessWorking = \OC_Util::isHtaccessWorking();
+ $util = new \OC_Util();
+ $htAccessWorking = $util->isHtaccessWorking(\OC::$server->getConfig());
} catch (\OC\HintException $e) {
$errors[] = array(
'error' => $e->getMessage(),
diff --git a/lib/private/util.php b/lib/private/util.php
index 5aa65401b9a..e423bb6a7df 100644
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -1155,14 +1155,13 @@ class OC_Util {
/**
* Check if the .htaccess file is working
- *
- * @throws OC\HintException If the testfile can't get written.
+ * @param \OCP\IConfig $config
* @return bool
- * @description Check if the .htaccess file is working by creating a test
- * file in the data directory and trying to access via http
+ * @throws Exception
+ * @throws \OC\HintException If the test file can't get written.
*/
- public static function isHtaccessWorking() {
- if (\OC::$CLI || !OC::$server->getConfig()->getSystemValue('check_for_working_htaccess', true)) {
+ public function isHtaccessWorking(\OCP\IConfig $config) {
+ if (\OC::$CLI || !$config->getSystemValue('check_for_working_htaccess', true)) {
return true;
}
@@ -1176,7 +1175,7 @@ class OC_Util {
$testContent = 'testcontent';
// creating a test file
- $testFile = OC::$server->getConfig()->getSystemValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $fileName;
+ $testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $fileName;
if (file_exists($testFile)) {// already running this test, possible recursive call
return false;
@@ -1245,36 +1244,6 @@ class OC_Util {
}
/**
- * Check if the ownCloud server can connect to the internet
- *
- * @param \OCP\Http\Client\IClientService $clientService
- * @return bool
- */
- public static function isInternetConnectionWorking(\OCP\Http\Client\IClientService $clientService) {
- // in case there is no internet connection on purpose return false
- if (self::isInternetConnectionEnabled() === false) {
- return false;
- }
-
- try {
- $client = $clientService->newClient();
- $response = $client->get('https://www.owncloud.org/');
- return $response->getStatusCode() === 200;
- } catch (\Exception $e) {
- return false;
- }
- }
-
- /**
- * Check if the connection to the internet is disabled on purpose
- *
- * @return string
- */
- public static function isInternetConnectionEnabled() {
- return \OC_Config::getValue("has_internet_connection", true);
- }
-
- /**
* clear all levels of output buffering
*
* @return void