Completed
Push — master ( a53aa4...e37cf2 )
by Lukas
01:05
created
cron.php 1 patch
Indentation   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -32,131 +32,131 @@
 block discarded – undo
32 32
 
33 33
 // Show warning if a PHP version below 5.6.0 is used
34 34
 if (version_compare(PHP_VERSION, '5.6.0') === -1) {
35
-	echo 'This version of Nextcloud requires at least PHP 5.6.0<br/>';
36
-	echo 'You are currently running ' . PHP_VERSION . '. Please update your PHP version.';
37
-	return;
35
+    echo 'This version of Nextcloud requires at least PHP 5.6.0<br/>';
36
+    echo 'You are currently running ' . PHP_VERSION . '. Please update your PHP version.';
37
+    return;
38 38
 }
39 39
 
40 40
 try {
41 41
 
42
-	require_once __DIR__ . '/lib/base.php';
43
-
44
-	if (\OCP\Util::needUpgrade()) {
45
-		\OCP\Util::writeLog('cron', 'Update required, skipping cron', \OCP\Util::DEBUG);
46
-		exit;
47
-	}
48
-	if (\OC::$server->getSystemConfig()->getValue('maintenance', false)) {
49
-		\OCP\Util::writeLog('cron', 'We are in maintenance mode, skipping cron', \OCP\Util::DEBUG);
50
-		exit;
51
-	}
52
-
53
-	// load all apps to get all api routes properly setup
54
-	OC_App::loadApps();
55
-
56
-	\OC::$server->getSession()->close();
57
-
58
-	// initialize a dummy memory session
59
-	$session = new \OC\Session\Memory('');
60
-	$cryptoWrapper = \OC::$server->getSessionCryptoWrapper();
61
-	$session = $cryptoWrapper->wrapSession($session);
62
-	\OC::$server->setSession($session);
63
-
64
-	$logger = \OC::$server->getLogger();
65
-	$config = \OC::$server->getConfig();
66
-
67
-	// Don't do anything if ownCloud has not been installed
68
-	if (!$config->getSystemValue('installed', false)) {
69
-		exit(0);
70
-	}
71
-
72
-	\OC::$server->getTempManager()->cleanOld();
73
-
74
-	// Exit if background jobs are disabled!
75
-	$appMode = \OCP\BackgroundJob::getExecutionType();
76
-	if ($appMode == 'none') {
77
-		if (OC::$CLI) {
78
-			echo 'Background Jobs are disabled!' . PHP_EOL;
79
-		} else {
80
-			OC_JSON::error(array('data' => array('message' => 'Background jobs disabled!')));
81
-		}
82
-		exit(1);
83
-	}
84
-
85
-	if (OC::$CLI) {
86
-		// set to run indefinitely if needed
87
-		if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
88
-			@set_time_limit(0);
89
-		}
90
-
91
-		// the cron job must be executed with the right user
92
-		if (!function_exists('posix_getuid')) {
93
-			echo "The posix extensions are required - see http://php.net/manual/en/book.posix.php" . PHP_EOL;
94
-			exit(1);
95
-		}
96
-		$user = posix_getpwuid(posix_getuid());
97
-		$configUser = posix_getpwuid(fileowner(OC::$configDir . 'config.php'));
98
-		if ($user['name'] !== $configUser['name']) {
99
-			echo "Console has to be executed with the same user as the web server is operated" . PHP_EOL;
100
-			echo "Current user: " . $user['name'] . PHP_EOL;
101
-			echo "Web server user: " . $configUser['name'] . PHP_EOL;
102
-			exit(1);
103
-		}
104
-
105
-		// We call ownCloud from the CLI (aka cron)
106
-		if ($appMode != 'cron') {
107
-			\OCP\BackgroundJob::setExecutionType('cron');
108
-		}
109
-
110
-		// Work
111
-		$jobList = \OC::$server->getJobList();
112
-
113
-		// We only ask for jobs for 14 minutes, because after 15 minutes the next
114
-		// system cron task should spawn.
115
-		$endTime = time() + 14 * 60;
116
-
117
-		$executedJobs = [];
118
-		while ($job = $jobList->getNext()) {
119
-			if (isset($executedJobs[$job->getId()])) {
120
-				$jobList->unlockJob($job);
121
-				break;
122
-			}
123
-
124
-			$job->execute($jobList, $logger);
125
-			// clean up after unclean jobs
126
-			\OC_Util::tearDownFS();
127
-
128
-			$jobList->setLastJob($job);
129
-			$executedJobs[$job->getId()] = true;
130
-			unset($job);
131
-
132
-			if (time() > $endTime) {
133
-				break;
134
-			}
135
-		}
136
-
137
-	} else {
138
-		// We call cron.php from some website
139
-		if ($appMode == 'cron') {
140
-			// Cron is cron :-P
141
-			OC_JSON::error(array('data' => array('message' => 'Backgroundjobs are using system cron!')));
142
-		} else {
143
-			// Work and success :-)
144
-			$jobList = \OC::$server->getJobList();
145
-			$job = $jobList->getNext();
146
-			if ($job != null) {
147
-				$job->execute($jobList, $logger);
148
-				$jobList->setLastJob($job);
149
-			}
150
-			OC_JSON::success();
151
-		}
152
-	}
153
-
154
-	// Log the successful cron execution
155
-	\OC::$server->getConfig()->setAppValue('core', 'lastcron', time());
156
-	exit();
42
+    require_once __DIR__ . '/lib/base.php';
43
+
44
+    if (\OCP\Util::needUpgrade()) {
45
+        \OCP\Util::writeLog('cron', 'Update required, skipping cron', \OCP\Util::DEBUG);
46
+        exit;
47
+    }
48
+    if (\OC::$server->getSystemConfig()->getValue('maintenance', false)) {
49
+        \OCP\Util::writeLog('cron', 'We are in maintenance mode, skipping cron', \OCP\Util::DEBUG);
50
+        exit;
51
+    }
52
+
53
+    // load all apps to get all api routes properly setup
54
+    OC_App::loadApps();
55
+
56
+    \OC::$server->getSession()->close();
57
+
58
+    // initialize a dummy memory session
59
+    $session = new \OC\Session\Memory('');
60
+    $cryptoWrapper = \OC::$server->getSessionCryptoWrapper();
61
+    $session = $cryptoWrapper->wrapSession($session);
62
+    \OC::$server->setSession($session);
63
+
64
+    $logger = \OC::$server->getLogger();
65
+    $config = \OC::$server->getConfig();
66
+
67
+    // Don't do anything if ownCloud has not been installed
68
+    if (!$config->getSystemValue('installed', false)) {
69
+        exit(0);
70
+    }
71
+
72
+    \OC::$server->getTempManager()->cleanOld();
73
+
74
+    // Exit if background jobs are disabled!
75
+    $appMode = \OCP\BackgroundJob::getExecutionType();
76
+    if ($appMode == 'none') {
77
+        if (OC::$CLI) {
78
+            echo 'Background Jobs are disabled!' . PHP_EOL;
79
+        } else {
80
+            OC_JSON::error(array('data' => array('message' => 'Background jobs disabled!')));
81
+        }
82
+        exit(1);
83
+    }
84
+
85
+    if (OC::$CLI) {
86
+        // set to run indefinitely if needed
87
+        if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
88
+            @set_time_limit(0);
89
+        }
90
+
91
+        // the cron job must be executed with the right user
92
+        if (!function_exists('posix_getuid')) {
93
+            echo "The posix extensions are required - see http://php.net/manual/en/book.posix.php" . PHP_EOL;
94
+            exit(1);
95
+        }
96
+        $user = posix_getpwuid(posix_getuid());
97
+        $configUser = posix_getpwuid(fileowner(OC::$configDir . 'config.php'));
98
+        if ($user['name'] !== $configUser['name']) {
99
+            echo "Console has to be executed with the same user as the web server is operated" . PHP_EOL;
100
+            echo "Current user: " . $user['name'] . PHP_EOL;
101
+            echo "Web server user: " . $configUser['name'] . PHP_EOL;
102
+            exit(1);
103
+        }
104
+
105
+        // We call ownCloud from the CLI (aka cron)
106
+        if ($appMode != 'cron') {
107
+            \OCP\BackgroundJob::setExecutionType('cron');
108
+        }
109
+
110
+        // Work
111
+        $jobList = \OC::$server->getJobList();
112
+
113
+        // We only ask for jobs for 14 minutes, because after 15 minutes the next
114
+        // system cron task should spawn.
115
+        $endTime = time() + 14 * 60;
116
+
117
+        $executedJobs = [];
118
+        while ($job = $jobList->getNext()) {
119
+            if (isset($executedJobs[$job->getId()])) {
120
+                $jobList->unlockJob($job);
121
+                break;
122
+            }
123
+
124
+            $job->execute($jobList, $logger);
125
+            // clean up after unclean jobs
126
+            \OC_Util::tearDownFS();
127
+
128
+            $jobList->setLastJob($job);
129
+            $executedJobs[$job->getId()] = true;
130
+            unset($job);
131
+
132
+            if (time() > $endTime) {
133
+                break;
134
+            }
135
+        }
136
+
137
+    } else {
138
+        // We call cron.php from some website
139
+        if ($appMode == 'cron') {
140
+            // Cron is cron :-P
141
+            OC_JSON::error(array('data' => array('message' => 'Backgroundjobs are using system cron!')));
142
+        } else {
143
+            // Work and success :-)
144
+            $jobList = \OC::$server->getJobList();
145
+            $job = $jobList->getNext();
146
+            if ($job != null) {
147
+                $job->execute($jobList, $logger);
148
+                $jobList->setLastJob($job);
149
+            }
150
+            OC_JSON::success();
151
+        }
152
+    }
153
+
154
+    // Log the successful cron execution
155
+    \OC::$server->getConfig()->setAppValue('core', 'lastcron', time());
156
+    exit();
157 157
 
158 158
 } catch (Exception $ex) {
159
-	\OCP\Util::writeLog('cron', $ex->getMessage(), \OCP\Util::FATAL);
159
+    \OCP\Util::writeLog('cron', $ex->getMessage(), \OCP\Util::FATAL);
160 160
 } catch (Error $ex) {
161
-	\OCP\Util::writeLog('cron', $ex->getMessage(), \OCP\Util::FATAL);
161
+    \OCP\Util::writeLog('cron', $ex->getMessage(), \OCP\Util::FATAL);
162 162
 }
Please login to merge, or discard this patch.
lib/private/Settings/Admin/Server.php 1 patch
Indentation   +108 added lines, -108 removed lines patch added patch discarded remove patch
@@ -37,123 +37,123 @@
 block discarded – undo
37 37
 use OCP\Settings\ISettings;
38 38
 
39 39
 class Server implements ISettings {
40
-	/** @var IDBConnection|Connection */
41
-	private $db;
42
-	/** @var IRequest */
43
-	private $request;
44
-	/** @var IConfig */
45
-	private $config;
46
-	/** @var ILockingProvider */
47
-	private $lockingProvider;
48
-	/** @var IL10N */
49
-	private $l;
40
+    /** @var IDBConnection|Connection */
41
+    private $db;
42
+    /** @var IRequest */
43
+    private $request;
44
+    /** @var IConfig */
45
+    private $config;
46
+    /** @var ILockingProvider */
47
+    private $lockingProvider;
48
+    /** @var IL10N */
49
+    private $l;
50 50
 
51
-	/**
52
-	 * @param IDBConnection $db
53
-	 * @param IRequest $request
54
-	 * @param IConfig $config
55
-	 * @param ILockingProvider $lockingProvider
56
-	 * @param IL10N $l
57
-	 */
58
-	public function __construct(IDBConnection $db,
59
-								IRequest $request,
60
-								IConfig $config,
61
-								ILockingProvider $lockingProvider,
62
-								IL10N $l) {
63
-		$this->db = $db;
64
-		$this->request = $request;
65
-		$this->config = $config;
66
-		$this->lockingProvider = $lockingProvider;
67
-		$this->l = $l;
68
-	}
51
+    /**
52
+     * @param IDBConnection $db
53
+     * @param IRequest $request
54
+     * @param IConfig $config
55
+     * @param ILockingProvider $lockingProvider
56
+     * @param IL10N $l
57
+     */
58
+    public function __construct(IDBConnection $db,
59
+                                IRequest $request,
60
+                                IConfig $config,
61
+                                ILockingProvider $lockingProvider,
62
+                                IL10N $l) {
63
+        $this->db = $db;
64
+        $this->request = $request;
65
+        $this->config = $config;
66
+        $this->lockingProvider = $lockingProvider;
67
+        $this->l = $l;
68
+    }
69 69
 
70
-	/**
71
-	 * @return TemplateResponse
72
-	 */
73
-	public function getForm() {
74
-		try {
75
-			if ($this->db->getDatabasePlatform() instanceof SqlitePlatform) {
76
-				$invalidTransactionIsolationLevel = false;
77
-			} else {
78
-				$invalidTransactionIsolationLevel = $this->db->getTransactionIsolation() !== Connection::TRANSACTION_READ_COMMITTED;
79
-			}
80
-		} catch (DBALException $e) {
81
-			// ignore
82
-			$invalidTransactionIsolationLevel = false;
83
-		}
70
+    /**
71
+     * @return TemplateResponse
72
+     */
73
+    public function getForm() {
74
+        try {
75
+            if ($this->db->getDatabasePlatform() instanceof SqlitePlatform) {
76
+                $invalidTransactionIsolationLevel = false;
77
+            } else {
78
+                $invalidTransactionIsolationLevel = $this->db->getTransactionIsolation() !== Connection::TRANSACTION_READ_COMMITTED;
79
+            }
80
+        } catch (DBALException $e) {
81
+            // ignore
82
+            $invalidTransactionIsolationLevel = false;
83
+        }
84 84
 
85
-		$envPath = getenv('PATH');
85
+        $envPath = getenv('PATH');
86 86
 
87
-		// warn if outdated version of a memcache module is used
88
-		$caches = [
89
-			'apcu'	=> ['name' => $this->l->t('APCu'), 'version' => '4.0.6'],
90
-			'redis'	=> ['name' => $this->l->t('Redis'), 'version' => '2.2.5'],
91
-		];
92
-		$outdatedCaches = [];
93
-		foreach ($caches as $php_module => $data) {
94
-			$isOutdated = extension_loaded($php_module) && version_compare(phpversion($php_module), $data['version'], '<');
95
-			if ($isOutdated) {
96
-				$outdatedCaches[$php_module] = $data;
97
-			}
98
-		}
87
+        // warn if outdated version of a memcache module is used
88
+        $caches = [
89
+            'apcu'	=> ['name' => $this->l->t('APCu'), 'version' => '4.0.6'],
90
+            'redis'	=> ['name' => $this->l->t('Redis'), 'version' => '2.2.5'],
91
+        ];
92
+        $outdatedCaches = [];
93
+        foreach ($caches as $php_module => $data) {
94
+            $isOutdated = extension_loaded($php_module) && version_compare(phpversion($php_module), $data['version'], '<');
95
+            if ($isOutdated) {
96
+                $outdatedCaches[$php_module] = $data;
97
+            }
98
+        }
99 99
 
100
-		if ($this->lockingProvider instanceof NoopLockingProvider) {
101
-			$fileLockingType = 'none';
102
-		} else if ($this->lockingProvider instanceof DBLockingProvider) {
103
-			$fileLockingType = 'db';
104
-		} else {
105
-			$fileLockingType = 'cache';
106
-		}
100
+        if ($this->lockingProvider instanceof NoopLockingProvider) {
101
+            $fileLockingType = 'none';
102
+        } else if ($this->lockingProvider instanceof DBLockingProvider) {
103
+            $fileLockingType = 'db';
104
+        } else {
105
+            $fileLockingType = 'cache';
106
+        }
107 107
 
108
-		$suggestedOverwriteCliUrl = '';
109
-		if ($this->config->getSystemValue('overwrite.cli.url', '') === '') {
110
-			$suggestedOverwriteCliUrl = $this->request->getServerProtocol() . '://' . $this->request->getInsecureServerHost() . \OC::$WEBROOT;
111
-			if (!$this->config->getSystemValue('config_is_read_only', false)) {
112
-				// Set the overwrite URL when it was not set yet.
113
-				$this->config->setSystemValue('overwrite.cli.url', $suggestedOverwriteCliUrl);
114
-				$suggestedOverwriteCliUrl = '';
115
-			}
116
-		}
108
+        $suggestedOverwriteCliUrl = '';
109
+        if ($this->config->getSystemValue('overwrite.cli.url', '') === '') {
110
+            $suggestedOverwriteCliUrl = $this->request->getServerProtocol() . '://' . $this->request->getInsecureServerHost() . \OC::$WEBROOT;
111
+            if (!$this->config->getSystemValue('config_is_read_only', false)) {
112
+                // Set the overwrite URL when it was not set yet.
113
+                $this->config->setSystemValue('overwrite.cli.url', $suggestedOverwriteCliUrl);
114
+                $suggestedOverwriteCliUrl = '';
115
+            }
116
+        }
117 117
 
118
-		$parameters = [
119
-			// Diagnosis
120
-			'readOnlyConfigEnabled'            => \OC_Helper::isReadOnlyConfigEnabled(),
121
-			'isLocaleWorking'                  => \OC_Util::isSetLocaleWorking(),
122
-			'isAnnotationsWorking'             => \OC_Util::isAnnotationsWorking(),
123
-			'checkForWorkingWellKnownSetup'    => $this->config->getSystemValue('check_for_working_wellknown_setup', true),
124
-			'has_fileinfo'                     => \OC_Util::fileInfoLoaded(),
125
-			'invalidTransactionIsolationLevel' => $invalidTransactionIsolationLevel,
126
-			'getenvServerNotWorking'           => empty($envPath),
127
-			'OutdatedCacheWarning'             => $outdatedCaches,
128
-			'fileLockingType'                  => $fileLockingType,
129
-			'suggestedOverwriteCliUrl'         => $suggestedOverwriteCliUrl,
118
+        $parameters = [
119
+            // Diagnosis
120
+            'readOnlyConfigEnabled'            => \OC_Helper::isReadOnlyConfigEnabled(),
121
+            'isLocaleWorking'                  => \OC_Util::isSetLocaleWorking(),
122
+            'isAnnotationsWorking'             => \OC_Util::isAnnotationsWorking(),
123
+            'checkForWorkingWellKnownSetup'    => $this->config->getSystemValue('check_for_working_wellknown_setup', true),
124
+            'has_fileinfo'                     => \OC_Util::fileInfoLoaded(),
125
+            'invalidTransactionIsolationLevel' => $invalidTransactionIsolationLevel,
126
+            'getenvServerNotWorking'           => empty($envPath),
127
+            'OutdatedCacheWarning'             => $outdatedCaches,
128
+            'fileLockingType'                  => $fileLockingType,
129
+            'suggestedOverwriteCliUrl'         => $suggestedOverwriteCliUrl,
130 130
 
131
-			// Background jobs
132
-			'backgroundjobs_mode' => $this->config->getAppValue('core', 'backgroundjobs_mode', 'ajax'),
133
-			'lastcron'            => $this->config->getAppValue('core', 'lastcron', false),
134
-			'cronErrors'		  => $this->config->getAppValue('core', 'cronErrors'),
135
-			'cli_based_cron_possible' => function_exists('posix_getpwuid'),
136
-			'cli_based_cron_user' => function_exists('posix_getpwuid') ? posix_getpwuid(fileowner(\OC::$configDir . 'config.php'))['name'] : '',
137
-		];
131
+            // Background jobs
132
+            'backgroundjobs_mode' => $this->config->getAppValue('core', 'backgroundjobs_mode', 'ajax'),
133
+            'lastcron'            => $this->config->getAppValue('core', 'lastcron', false),
134
+            'cronErrors'		  => $this->config->getAppValue('core', 'cronErrors'),
135
+            'cli_based_cron_possible' => function_exists('posix_getpwuid'),
136
+            'cli_based_cron_user' => function_exists('posix_getpwuid') ? posix_getpwuid(fileowner(\OC::$configDir . 'config.php'))['name'] : '',
137
+        ];
138 138
 
139
-		return new TemplateResponse('settings', 'settings/admin/server', $parameters, '');
140
-	}
139
+        return new TemplateResponse('settings', 'settings/admin/server', $parameters, '');
140
+    }
141 141
 
142
-	/**
143
-	 * @return string the section ID, e.g. 'sharing'
144
-	 */
145
-	public function getSection() {
146
-		return 'server';
147
-	}
142
+    /**
143
+     * @return string the section ID, e.g. 'sharing'
144
+     */
145
+    public function getSection() {
146
+        return 'server';
147
+    }
148 148
 
149
-	/**
150
-	 * @return int whether the form should be rather on the top or bottom of
151
-	 * the admin section. The forms are arranged in ascending order of the
152
-	 * priority values. It is required to return a value between 0 and 100.
153
-	 *
154
-	 * E.g.: 70
155
-	 */
156
-	public function getPriority() {
157
-		return 0;
158
-	}
149
+    /**
150
+     * @return int whether the form should be rather on the top or bottom of
151
+     * the admin section. The forms are arranged in ascending order of the
152
+     * priority values. It is required to return a value between 0 and 100.
153
+     *
154
+     * E.g.: 70
155
+     */
156
+    public function getPriority() {
157
+        return 0;
158
+    }
159 159
 }
Please login to merge, or discard this patch.
settings/templates/settings/admin/server.php 3 patches
Indentation   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -31,101 +31,101 @@  discard block
 block discarded – undo
31 31
 	<p class="settings-hint"><?php p($l->t('It\'s important for the security and performance of your instance that everything is configured correctly. To help you with that we are doing some automatic checks. Please see the Tips & Tricks section and the documentation for more information.'));?></p>
32 32
 	<ul>
33 33
 		<?php
34
-		// is php setup properly to query system environment variables like getenv('PATH')
35
-		if ($_['getenvServerNotWorking']) {
36
-			?>
34
+        // is php setup properly to query system environment variables like getenv('PATH')
35
+        if ($_['getenvServerNotWorking']) {
36
+            ?>
37 37
 			<li>
38 38
 				<?php p($l->t('PHP does not seem to be setup properly to query system environment variables. The test with getenv("PATH") only returns an empty response.')); ?><br>
39 39
 				<?php print_unescaped($l->t('Please check the <a target="_blank" rel="noreferrer" href="%s">installation documentation ↗</a> for PHP configuration notes and the PHP configuration of your server, especially when using php-fpm.', link_to_docs('admin-php-fpm'))); ?>
40 40
 			</li>
41 41
 			<?php
42
-		}
42
+        }
43 43
 
44
-		// is read only config enabled
45
-		if ($_['readOnlyConfigEnabled']) {
46
-			?>
44
+        // is read only config enabled
45
+        if ($_['readOnlyConfigEnabled']) {
46
+            ?>
47 47
 			<li>
48 48
 				<?php p($l->t('The Read-Only config has been enabled. This prevents setting some configurations via the web-interface. Furthermore, the file needs to be made writable manually for every update.')); ?>
49 49
 			</li>
50 50
 			<?php
51
-		}
51
+        }
52 52
 
53
-		// Are doc blocks accessible?
54
-		if (!$_['isAnnotationsWorking']) {
55
-			?>
53
+        // Are doc blocks accessible?
54
+        if (!$_['isAnnotationsWorking']) {
55
+            ?>
56 56
 			<li>
57 57
 				<?php p($l->t('PHP is apparently set up to strip inline doc blocks. This will make several core apps inaccessible.')); ?><br>
58 58
 				<?php p($l->t('This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator.')); ?>
59 59
 			</li>
60 60
 			<?php
61
-		}
61
+        }
62 62
 
63
-		// Is the Transaction isolation level READ_COMMITTED?
64
-		if ($_['invalidTransactionIsolationLevel']) {
65
-			?>
63
+        // Is the Transaction isolation level READ_COMMITTED?
64
+        if ($_['invalidTransactionIsolationLevel']) {
65
+            ?>
66 66
 			<li>
67 67
 				<?php p($l->t('Your database does not run with "READ COMMITTED" transaction isolation level. This can cause problems when multiple actions are executed in parallel.')); ?>
68 68
 			</li>
69 69
 			<?php
70
-		}
70
+        }
71 71
 
72
-		// Warning if memcache is outdated
73
-		foreach ($_['OutdatedCacheWarning'] as $php_module => $data) {
74
-			?>
72
+        // Warning if memcache is outdated
73
+        foreach ($_['OutdatedCacheWarning'] as $php_module => $data) {
74
+            ?>
75 75
 			<li>
76 76
 				<?php p($l->t('%1$s below version %2$s is installed, for stability and performance reasons it is recommended to update to a newer %1$s version.', $data)); ?>
77 77
 			</li>
78 78
 			<?php
79
-		}
79
+        }
80 80
 
81
-		// if module fileinfo available?
82
-		if (!$_['has_fileinfo']) {
83
-			?>
81
+        // if module fileinfo available?
82
+        if (!$_['has_fileinfo']) {
83
+            ?>
84 84
 			<li>
85 85
 				<?php p($l->t('The PHP module \'fileinfo\' is missing. It is strongly recommended to enable this module to get the best results with MIME type detection.')); ?>
86 86
 			</li>
87 87
 			<?php
88
-		}
88
+        }
89 89
 
90
-		// locking configured optimally?
91
-		if ($_['fileLockingType'] === 'none') {
92
-			?>
90
+        // locking configured optimally?
91
+        if ($_['fileLockingType'] === 'none') {
92
+            ?>
93 93
 			<li>
94 94
 				<?php print_unescaped($l->t('Transactional file locking is disabled, this might lead to issues with race conditions. Enable \'filelocking.enabled\' in config.php to avoid these problems. See the <a target="_blank" rel="noreferrer" href="%s">documentation ↗</a> for more information.', link_to_docs('admin-transactional-locking'))); ?>
95 95
 			</li>
96 96
 			<?php
97
-		}
97
+        }
98 98
 
99
-		// is locale working ?
100
-		if (!$_['isLocaleWorking']) {
101
-			?>
99
+        // is locale working ?
100
+        if (!$_['isLocaleWorking']) {
101
+            ?>
102 102
 			<li>
103 103
 				<?php
104
-				$locales = 'en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8';
105
-				p($l->t('System locale can not be set to a one which supports UTF-8.'));
106
-				?>
104
+                $locales = 'en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8';
105
+                p($l->t('System locale can not be set to a one which supports UTF-8.'));
106
+                ?>
107 107
 				<br>
108 108
 				<?php
109
-				p($l->t('This means that there might be problems with certain characters in filenames.'));
110
-				?>
109
+                p($l->t('This means that there might be problems with certain characters in filenames.'));
110
+                ?>
111 111
 				<br>
112 112
 				<?php
113
-				p($l->t('It is strongly proposed to install the required packages on your system to support one of the following locales: %s.', [$locales]));
114
-				?>
113
+                p($l->t('It is strongly proposed to install the required packages on your system to support one of the following locales: %s.', [$locales]));
114
+                ?>
115 115
 			</li>
116 116
 			<?php
117
-		}
117
+        }
118 118
 
119
-		if ($_['suggestedOverwriteCliUrl']) {
120
-			?>
119
+        if ($_['suggestedOverwriteCliUrl']) {
120
+            ?>
121 121
 			<li>
122 122
 				<?php p($l->t('If your installation is not installed at the root of the domain and uses system Cron, there can be issues with the URL generation. To avoid these problems, please set the "overwrite.cli.url" option in your config.php file to the webroot path of your installation (Suggested: "%s")', $_['suggestedOverwriteCliUrl'])); ?>
123 123
 			</li>
124 124
 			<?php
125
-		}
125
+        }
126 126
 
127
-		if ($_['cronErrors']) {
128
-			?>
127
+        if ($_['cronErrors']) {
128
+            ?>
129 129
 			<li>
130 130
 				<?php p($l->t('It was not possible to execute the cron job via CLI. The following technical errors have appeared:')); ?>
131 131
 				<br>
@@ -136,8 +136,8 @@  discard block
 block discarded – undo
136 136
 				</ol>
137 137
 			</li>
138 138
 			<?php
139
-		}
140
-		?>
139
+        }
140
+        ?>
141 141
 	</ul>
142 142
 
143 143
 	<div id="postsetupchecks" data-check-wellknown="<?php if($_['checkForWorkingWellKnownSetup']) { p('true'); } else { p('false'); } ?>">
@@ -158,9 +158,9 @@  discard block
 block discarded – undo
158 158
 	<h2 class="inlineblock"><?php p($l->t('Background jobs'));?></h2>
159 159
 	<p class="cronlog inlineblock">
160 160
 		<?php if ($_['lastcron'] !== false):
161
-			$relative_time = relative_modified_date($_['lastcron']);
162
-			$absolute_time = OC_Util::formatDate($_['lastcron']);
163
-			if (time() - $_['lastcron'] <= 3600): ?>
161
+            $relative_time = relative_modified_date($_['lastcron']);
162
+            $absolute_time = OC_Util::formatDate($_['lastcron']);
163
+            if (time() - $_['lastcron'] <= 3600): ?>
164 164
 				<span class="status success"></span>
165 165
 				<span class="crondate" title="<?php p($absolute_time);?>">
166 166
 				<?php p($l->t("Last job ran %s.", [$relative_time]));?>
@@ -171,10 +171,10 @@  discard block
 block discarded – undo
171 171
 				<?php p($l->t("Last job execution ran %s. Something seems wrong.", [$relative_time]));?>
172 172
 			</span>
173 173
 			<?php endif;
174
-		else: ?>
174
+        else: ?>
175 175
 			<span class="status error"></span>
176 176
 			<?php p($l->t("Background job didn’t run yet!"));
177
-		endif; ?>
177
+        endif; ?>
178 178
 	</p>
179 179
 	<a target="_blank" rel="noreferrer" class="icon-info"
180 180
 	   title="<?php p($l->t('Open documentation'));?>"
@@ -184,38 +184,38 @@  discard block
 block discarded – undo
184 184
 	<p>
185 185
 		<input type="radio" name="mode" value="ajax" class="radio"
186 186
 			   id="backgroundjobs_ajax" <?php if ($_['backgroundjobs_mode'] === "ajax") {
187
-			print_unescaped('checked="checked"');
188
-		} ?>>
187
+            print_unescaped('checked="checked"');
188
+        } ?>>
189 189
 		<label for="backgroundjobs_ajax">AJAX</label><br/>
190 190
 		<em><?php p($l->t("Execute one task with each page loaded")); ?></em>
191 191
 	</p>
192 192
 	<p>
193 193
 		<input type="radio" name="mode" value="webcron" class="radio"
194 194
 			   id="backgroundjobs_webcron" <?php if ($_['backgroundjobs_mode'] === "webcron") {
195
-			print_unescaped('checked="checked"');
196
-		} ?>>
195
+            print_unescaped('checked="checked"');
196
+        } ?>>
197 197
 		<label for="backgroundjobs_webcron">Webcron</label><br/>
198 198
 		<em><?php p($l->t("cron.php is registered at a webcron service to call cron.php every 15 minutes over HTTP.")); ?></em>
199 199
 	</p>
200 200
 	<p>
201 201
 		<input type="radio" name="mode" value="cron" class="radio"
202 202
 			   id="backgroundjobs_cron" <?php if ($_['backgroundjobs_mode'] === "cron") {
203
-			print_unescaped('checked="checked"');
204
-		}
205
-		if (!$_['cli_based_cron_possible']) {
206
-			print_unescaped('disabled');
207
-		}?>>
203
+            print_unescaped('checked="checked"');
204
+        }
205
+        if (!$_['cli_based_cron_possible']) {
206
+            print_unescaped('disabled');
207
+        }?>>
208 208
 		<label for="backgroundjobs_cron">Cron</label><br/>
209 209
 		<em><?php p($l->t("Use system cron service to call the cron.php file every 15 minutes.")); ?>
210 210
 			<?php if($_['cli_based_cron_possible']) {
211
-				p($l->t('The cron.php needs to be executed by the system user "%s".', [$_['cli_based_cron_user']]));
212
-			} else {
213
-				print_unescaped(str_replace(
214
-					['{linkstart}', '{linkend}'],
215
-					['<a href="http://php.net/manual/en/book.posix.php">', ' ↗</a>'],
216
-					$l->t('To run this you need the PHP POSIX extension. See {linkstart}PHP documentation{linkend} for more details.')
217
-				));
218
-		} ?></em>
211
+                p($l->t('The cron.php needs to be executed by the system user "%s".', [$_['cli_based_cron_user']]));
212
+            } else {
213
+                print_unescaped(str_replace(
214
+                    ['{linkstart}', '{linkend}'],
215
+                    ['<a href="http://php.net/manual/en/book.posix.php">', ' ↗</a>'],
216
+                    $l->t('To run this you need the PHP POSIX extension. See {linkstart}PHP documentation{linkend} for more details.')
217
+                ));
218
+        } ?></em>
219 219
 
220 220
 	</p>
221 221
 </div>
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
 ?>
28 28
 
29 29
 <div id="security-warning" class="section">
30
-	<h2><?php p($l->t('Security & setup warnings'));?></h2>
31
-	<p class="settings-hint"><?php p($l->t('It\'s important for the security and performance of your instance that everything is configured correctly. To help you with that we are doing some automatic checks. Please see the Tips & Tricks section and the documentation for more information.'));?></p>
30
+	<h2><?php p($l->t('Security & setup warnings')); ?></h2>
31
+	<p class="settings-hint"><?php p($l->t('It\'s important for the security and performance of your instance that everything is configured correctly. To help you with that we are doing some automatic checks. Please see the Tips & Tricks section and the documentation for more information.')); ?></p>
32 32
 	<ul>
33 33
 		<?php
34 34
 		// is php setup properly to query system environment variables like getenv('PATH')
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 				<?php p($l->t('It was not possible to execute the cron job via CLI. The following technical errors have appeared:')); ?>
131 131
 				<br>
132 132
 				<ol>
133
-					<?php foreach(json_decode($_['cronErrors']) as $error) { if(isset($error->error)) {?>
133
+					<?php foreach (json_decode($_['cronErrors']) as $error) { if (isset($error->error)) {?>
134 134
 						<li><?php p($error->error) ?> <?php p($error->hint) ?></li>
135 135
 					<?php }};?>
136 136
 				</ol>
@@ -140,35 +140,35 @@  discard block
 block discarded – undo
140 140
 		?>
141 141
 	</ul>
142 142
 
143
-	<div id="postsetupchecks" data-check-wellknown="<?php if($_['checkForWorkingWellKnownSetup']) { p('true'); } else { p('false'); } ?>">
143
+	<div id="postsetupchecks" data-check-wellknown="<?php if ($_['checkForWorkingWellKnownSetup']) { p('true'); } else { p('false'); } ?>">
144 144
 		<div class="loading"></div>
145 145
 		<ul class="errors hidden"></ul>
146 146
 		<ul class="warnings hidden"></ul>
147 147
 		<ul class="info hidden"></ul>
148 148
 		<p class="hint hidden">
149
-			<?php print_unescaped($l->t('Please double check the <a target="_blank" rel="noreferrer" href="%s">installation guides ↗</a>, and check for any errors or warnings in the <a href="%s">log</a>.', [link_to_docs('admin-install'), \OC::$server->getURLGenerator()->linkToRoute('settings.AdminSettings.index', ['section' => 'logging'])] )); ?>
149
+			<?php print_unescaped($l->t('Please double check the <a target="_blank" rel="noreferrer" href="%s">installation guides ↗</a>, and check for any errors or warnings in the <a href="%s">log</a>.', [link_to_docs('admin-install'), \OC::$server->getURLGenerator()->linkToRoute('settings.AdminSettings.index', ['section' => 'logging'])])); ?>
150 150
 		</p>
151 151
 	</div>
152 152
 	<div id="security-warning-state">
153
-		<span class="hidden icon-checkmark"><?php p($l->t('All checks passed.'));?></span>
153
+		<span class="hidden icon-checkmark"><?php p($l->t('All checks passed.')); ?></span>
154 154
 	</div>
155 155
 </div>
156 156
 
157 157
 <div class="section" id="backgroundjobs">
158
-	<h2 class="inlineblock"><?php p($l->t('Background jobs'));?></h2>
158
+	<h2 class="inlineblock"><?php p($l->t('Background jobs')); ?></h2>
159 159
 	<p class="cronlog inlineblock">
160 160
 		<?php if ($_['lastcron'] !== false):
161 161
 			$relative_time = relative_modified_date($_['lastcron']);
162 162
 			$absolute_time = OC_Util::formatDate($_['lastcron']);
163 163
 			if (time() - $_['lastcron'] <= 3600): ?>
164 164
 				<span class="status success"></span>
165
-				<span class="crondate" title="<?php p($absolute_time);?>">
166
-				<?php p($l->t("Last job ran %s.", [$relative_time]));?>
165
+				<span class="crondate" title="<?php p($absolute_time); ?>">
166
+				<?php p($l->t("Last job ran %s.", [$relative_time])); ?>
167 167
 			</span>
168 168
 			<?php else: ?>
169 169
 				<span class="status error"></span>
170
-				<span class="crondate" title="<?php p($absolute_time);?>">
171
-				<?php p($l->t("Last job execution ran %s. Something seems wrong.", [$relative_time]));?>
170
+				<span class="crondate" title="<?php p($absolute_time); ?>">
171
+				<?php p($l->t("Last job execution ran %s. Something seems wrong.", [$relative_time])); ?>
172 172
 			</span>
173 173
 			<?php endif;
174 174
 		else: ?>
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
 		endif; ?>
178 178
 	</p>
179 179
 	<a target="_blank" rel="noreferrer" class="icon-info"
180
-	   title="<?php p($l->t('Open documentation'));?>"
180
+	   title="<?php p($l->t('Open documentation')); ?>"
181 181
 	   href="<?php p(link_to_docs('admin-background-jobs')); ?>"></a>
182 182
 
183
-	<p class="settings-hint"><?php p($l->t('For optimal performance it\'s important to configure background jobs correctly. For bigger instances \'Cron\' is the recommended setting. Please see the documentation for more information.'));?></p>
183
+	<p class="settings-hint"><?php p($l->t('For optimal performance it\'s important to configure background jobs correctly. For bigger instances \'Cron\' is the recommended setting. Please see the documentation for more information.')); ?></p>
184 184
 	<p>
185 185
 		<input type="radio" name="mode" value="ajax" class="radio"
186 186
 			   id="backgroundjobs_ajax" <?php if ($_['backgroundjobs_mode'] === "ajax") {
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 		}?>>
208 208
 		<label for="backgroundjobs_cron">Cron</label><br/>
209 209
 		<em><?php p($l->t("Use system cron service to call the cron.php file every 15 minutes.")); ?>
210
-			<?php if($_['cli_based_cron_possible']) {
210
+			<?php if ($_['cli_based_cron_possible']) {
211 211
 				p($l->t('The cron.php needs to be executed by the system user "%s".', [$_['cli_based_cron_user']]));
212 212
 			} else {
213 213
 				print_unescaped(str_replace(
@@ -222,6 +222,6 @@  discard block
 block discarded – undo
222 222
 
223 223
 <div class="section">
224 224
 	<!-- should be the last part, so Updater can follow if enabled (it has no heading therefore). -->
225
-	<h2><?php p($l->t('Version'));?></h2>
225
+	<h2><?php p($l->t('Version')); ?></h2>
226 226
 	<p><strong><a href="<?php print_unescaped($theme->getBaseUrl()); ?>" rel="noreferrer" target="_blank"><?php p($theme->getTitle()); ?></a> <?php p(OC_Util::getHumanVersion()) ?></strong></p>
227 227
 </div>
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -165,15 +165,20 @@
 block discarded – undo
165 165
 				<span class="crondate" title="<?php p($absolute_time);?>">
166 166
 				<?php p($l->t("Last job ran %s.", [$relative_time]));?>
167 167
 			</span>
168
-			<?php else: ?>
168
+			<?php else {
169
+    : ?>
169 170
 				<span class="status error"></span>
170
-				<span class="crondate" title="<?php p($absolute_time);?>">
171
+				<span class="crondate" title="<?php p($absolute_time);
172
+}
173
+?>">
171 174
 				<?php p($l->t("Last job execution ran %s. Something seems wrong.", [$relative_time]));?>
172 175
 			</span>
173 176
 			<?php endif;
174
-		else: ?>
177
+		else {
178
+		    : ?>
175 179
 			<span class="status error"></span>
176 180
 			<?php p($l->t("Background job didn’t run yet!"));
181
+		}
177 182
 		endif; ?>
178 183
 	</p>
179 184
 	<a target="_blank" rel="noreferrer" class="icon-info"
Please login to merge, or discard this patch.