@@ -41,7 +41,7 @@ |
||
41 | 41 | <?php p($theme->getName()); ?> |
42 | 42 | </h1> |
43 | 43 | <?php if(\OC::$server->getConfig()->getSystemValue('installed', false) |
44 | - && \OC::$server->getConfig()->getAppValue('theming', 'logoMime', false)): ?> |
|
44 | + && \OC::$server->getConfig()->getAppValue('theming', 'logoMime', false)): ?> |
|
45 | 45 | <img src="<?php p($theme->getLogo()); ?>"/> |
46 | 46 | <?php endif; ?> |
47 | 47 | </div> |
@@ -18,21 +18,21 @@ |
||
18 | 18 | <?php emit_script_loading_tags($_); ?> |
19 | 19 | <?php print_unescaped($_['headers']); ?> |
20 | 20 | </head> |
21 | - <body id="<?php p($_['bodyid']);?>"> |
|
21 | + <body id="<?php p($_['bodyid']); ?>"> |
|
22 | 22 | <?php include 'layout.noscript.warning.php'; ?> |
23 | 23 | <?php foreach ($_['initialStates'] as $app => $initialState) { ?> |
24 | 24 | <input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>"> |
25 | 25 | <?php }?> |
26 | 26 | <div class="wrapper"> |
27 | 27 | <div class="v-align"> |
28 | - <?php if ($_['bodyid'] === 'body-login' ): ?> |
|
28 | + <?php if ($_['bodyid'] === 'body-login'): ?> |
|
29 | 29 | <header role="banner"> |
30 | 30 | <div id="header"> |
31 | 31 | <div class="logo"> |
32 | 32 | <h1 class="hidden-visually"> |
33 | 33 | <?php p($theme->getName()); ?> |
34 | 34 | </h1> |
35 | - <?php if(\OC::$server->getConfig()->getSystemValue('installed', false) |
|
35 | + <?php if (\OC::$server->getConfig()->getSystemValue('installed', false) |
|
36 | 36 | && \OC::$server->getConfig()->getAppValue('theming', 'logoMime', false)): ?> |
37 | 37 | <img src="<?php p($theme->getLogo()); ?>"/> |
38 | 38 | <?php endif; ?> |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @return mixed the value or $default |
86 | 86 | */ |
87 | 87 | public function getValue($key, $default = null) { |
88 | - $envValue = getenv(self::ENV_PREFIX . $key); |
|
88 | + $envValue = getenv(self::ENV_PREFIX.$key); |
|
89 | 89 | if ($envValue !== false) { |
90 | 90 | return $envValue; |
91 | 91 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | foreach ($configFiles as $file) { |
198 | 198 | $fileExistsAndIsReadable = file_exists($file) && is_readable($file); |
199 | 199 | $filePointer = $fileExistsAndIsReadable ? fopen($file, 'r') : false; |
200 | - if($file === $this->configFilePath && |
|
200 | + if ($file === $this->configFilePath && |
|
201 | 201 | $filePointer === false) { |
202 | 202 | // Opening the main config might not be possible, e.g. if the wrong |
203 | 203 | // permissions are set (likely on a new installation) |
@@ -205,13 +205,13 @@ discard block |
||
205 | 205 | } |
206 | 206 | |
207 | 207 | // Try to acquire a file lock |
208 | - if(!flock($filePointer, LOCK_SH)) { |
|
208 | + if (!flock($filePointer, LOCK_SH)) { |
|
209 | 209 | throw new \Exception(sprintf('Could not acquire a shared lock on the config file %s', $file)); |
210 | 210 | } |
211 | 211 | |
212 | 212 | unset($CONFIG); |
213 | 213 | include $file; |
214 | - if(isset($CONFIG) && is_array($CONFIG)) { |
|
214 | + if (isset($CONFIG) && is_array($CONFIG)) { |
|
215 | 215 | $this->cache = array_merge($this->cache, $CONFIG); |
216 | 216 | } |
217 | 217 | |
@@ -236,29 +236,29 @@ discard block |
||
236 | 236 | $content .= var_export($this->cache, true); |
237 | 237 | $content .= ";\n"; |
238 | 238 | |
239 | - touch ($this->configFilePath); |
|
239 | + touch($this->configFilePath); |
|
240 | 240 | $filePointer = fopen($this->configFilePath, 'r+'); |
241 | 241 | |
242 | 242 | // Prevent others not to read the config |
243 | 243 | chmod($this->configFilePath, 0640); |
244 | 244 | |
245 | 245 | // File does not exist, this can happen when doing a fresh install |
246 | - if(!is_resource ($filePointer)) { |
|
246 | + if (!is_resource($filePointer)) { |
|
247 | 247 | // TODO fix this via DI once it is very clear that this doesn't cause side effects due to initialization order |
248 | 248 | // currently this breaks app routes but also could have other side effects especially during setup and exception handling |
249 | 249 | $url = \OC::$server->getURLGenerator()->linkToDocs('admin-dir_permissions'); |
250 | 250 | throw new HintException( |
251 | 251 | "Can't write into config directory!", |
252 | - 'This can usually be fixed by giving the webserver write access to the config directory. See ' . $url); |
|
252 | + 'This can usually be fixed by giving the webserver write access to the config directory. See '.$url); |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | // Try to acquire a file lock |
256 | - if(!flock($filePointer, LOCK_EX)) { |
|
256 | + if (!flock($filePointer, LOCK_EX)) { |
|
257 | 257 | throw new \Exception(sprintf('Could not acquire an exclusive lock on the config file %s', $this->configFilePath)); |
258 | 258 | } |
259 | 259 | |
260 | 260 | // Write the config and release the lock |
261 | - ftruncate ($filePointer, 0); |
|
261 | + ftruncate($filePointer, 0); |
|
262 | 262 | fwrite($filePointer, $content); |
263 | 263 | fflush($filePointer); |
264 | 264 | flock($filePointer, LOCK_UN); |
@@ -41,233 +41,233 @@ |
||
41 | 41 | */ |
42 | 42 | class Config { |
43 | 43 | |
44 | - const ENV_PREFIX = 'NC_'; |
|
44 | + const ENV_PREFIX = 'NC_'; |
|
45 | 45 | |
46 | - /** @var array Associative array ($key => $value) */ |
|
47 | - protected $cache = array(); |
|
48 | - /** @var string */ |
|
49 | - protected $configDir; |
|
50 | - /** @var string */ |
|
51 | - protected $configFilePath; |
|
52 | - /** @var string */ |
|
53 | - protected $configFileName; |
|
46 | + /** @var array Associative array ($key => $value) */ |
|
47 | + protected $cache = array(); |
|
48 | + /** @var string */ |
|
49 | + protected $configDir; |
|
50 | + /** @var string */ |
|
51 | + protected $configFilePath; |
|
52 | + /** @var string */ |
|
53 | + protected $configFileName; |
|
54 | 54 | |
55 | - /** |
|
56 | - * @param string $configDir Path to the config dir, needs to end with '/' |
|
57 | - * @param string $fileName (Optional) Name of the config file. Defaults to config.php |
|
58 | - */ |
|
59 | - public function __construct($configDir, $fileName = 'config.php') { |
|
60 | - $this->configDir = $configDir; |
|
61 | - $this->configFilePath = $this->configDir.$fileName; |
|
62 | - $this->configFileName = $fileName; |
|
63 | - $this->readData(); |
|
64 | - } |
|
55 | + /** |
|
56 | + * @param string $configDir Path to the config dir, needs to end with '/' |
|
57 | + * @param string $fileName (Optional) Name of the config file. Defaults to config.php |
|
58 | + */ |
|
59 | + public function __construct($configDir, $fileName = 'config.php') { |
|
60 | + $this->configDir = $configDir; |
|
61 | + $this->configFilePath = $this->configDir.$fileName; |
|
62 | + $this->configFileName = $fileName; |
|
63 | + $this->readData(); |
|
64 | + } |
|
65 | 65 | |
66 | - /** |
|
67 | - * Lists all available config keys |
|
68 | - * |
|
69 | - * Please note that it does not return the values. |
|
70 | - * |
|
71 | - * @return array an array of key names |
|
72 | - */ |
|
73 | - public function getKeys() { |
|
74 | - return array_keys($this->cache); |
|
75 | - } |
|
66 | + /** |
|
67 | + * Lists all available config keys |
|
68 | + * |
|
69 | + * Please note that it does not return the values. |
|
70 | + * |
|
71 | + * @return array an array of key names |
|
72 | + */ |
|
73 | + public function getKeys() { |
|
74 | + return array_keys($this->cache); |
|
75 | + } |
|
76 | 76 | |
77 | - /** |
|
78 | - * Returns a config value |
|
79 | - * |
|
80 | - * gets its value from an `NC_` prefixed environment variable |
|
81 | - * if it doesn't exist from config.php |
|
82 | - * if this doesn't exist either, it will return the given `$default` |
|
83 | - * |
|
84 | - * @param string $key key |
|
85 | - * @param mixed $default = null default value |
|
86 | - * @return mixed the value or $default |
|
87 | - */ |
|
88 | - public function getValue($key, $default = null) { |
|
89 | - $envValue = getenv(self::ENV_PREFIX . $key); |
|
90 | - if ($envValue !== false) { |
|
91 | - return $envValue; |
|
92 | - } |
|
77 | + /** |
|
78 | + * Returns a config value |
|
79 | + * |
|
80 | + * gets its value from an `NC_` prefixed environment variable |
|
81 | + * if it doesn't exist from config.php |
|
82 | + * if this doesn't exist either, it will return the given `$default` |
|
83 | + * |
|
84 | + * @param string $key key |
|
85 | + * @param mixed $default = null default value |
|
86 | + * @return mixed the value or $default |
|
87 | + */ |
|
88 | + public function getValue($key, $default = null) { |
|
89 | + $envValue = getenv(self::ENV_PREFIX . $key); |
|
90 | + if ($envValue !== false) { |
|
91 | + return $envValue; |
|
92 | + } |
|
93 | 93 | |
94 | - if (isset($this->cache[$key])) { |
|
95 | - return $this->cache[$key]; |
|
96 | - } |
|
94 | + if (isset($this->cache[$key])) { |
|
95 | + return $this->cache[$key]; |
|
96 | + } |
|
97 | 97 | |
98 | - return $default; |
|
99 | - } |
|
98 | + return $default; |
|
99 | + } |
|
100 | 100 | |
101 | - /** |
|
102 | - * Sets and deletes values and writes the config.php |
|
103 | - * |
|
104 | - * @param array $configs Associative array with `key => value` pairs |
|
105 | - * If value is null, the config key will be deleted |
|
106 | - */ |
|
107 | - public function setValues(array $configs) { |
|
108 | - $needsUpdate = false; |
|
109 | - foreach ($configs as $key => $value) { |
|
110 | - if ($value !== null) { |
|
111 | - $needsUpdate |= $this->set($key, $value); |
|
112 | - } else { |
|
113 | - $needsUpdate |= $this->delete($key); |
|
114 | - } |
|
115 | - } |
|
101 | + /** |
|
102 | + * Sets and deletes values and writes the config.php |
|
103 | + * |
|
104 | + * @param array $configs Associative array with `key => value` pairs |
|
105 | + * If value is null, the config key will be deleted |
|
106 | + */ |
|
107 | + public function setValues(array $configs) { |
|
108 | + $needsUpdate = false; |
|
109 | + foreach ($configs as $key => $value) { |
|
110 | + if ($value !== null) { |
|
111 | + $needsUpdate |= $this->set($key, $value); |
|
112 | + } else { |
|
113 | + $needsUpdate |= $this->delete($key); |
|
114 | + } |
|
115 | + } |
|
116 | 116 | |
117 | - if ($needsUpdate) { |
|
118 | - // Write changes |
|
119 | - $this->writeData(); |
|
120 | - } |
|
121 | - } |
|
117 | + if ($needsUpdate) { |
|
118 | + // Write changes |
|
119 | + $this->writeData(); |
|
120 | + } |
|
121 | + } |
|
122 | 122 | |
123 | - /** |
|
124 | - * Sets the value and writes it to config.php if required |
|
125 | - * |
|
126 | - * @param string $key key |
|
127 | - * @param mixed $value value |
|
128 | - */ |
|
129 | - public function setValue($key, $value) { |
|
130 | - if ($this->set($key, $value)) { |
|
131 | - // Write changes |
|
132 | - $this->writeData(); |
|
133 | - } |
|
134 | - } |
|
123 | + /** |
|
124 | + * Sets the value and writes it to config.php if required |
|
125 | + * |
|
126 | + * @param string $key key |
|
127 | + * @param mixed $value value |
|
128 | + */ |
|
129 | + public function setValue($key, $value) { |
|
130 | + if ($this->set($key, $value)) { |
|
131 | + // Write changes |
|
132 | + $this->writeData(); |
|
133 | + } |
|
134 | + } |
|
135 | 135 | |
136 | - /** |
|
137 | - * This function sets the value |
|
138 | - * |
|
139 | - * @param string $key key |
|
140 | - * @param mixed $value value |
|
141 | - * @return bool True if the file needs to be updated, false otherwise |
|
142 | - */ |
|
143 | - protected function set($key, $value) { |
|
144 | - if (!isset($this->cache[$key]) || $this->cache[$key] !== $value) { |
|
145 | - // Add change |
|
146 | - $this->cache[$key] = $value; |
|
147 | - return true; |
|
148 | - } |
|
136 | + /** |
|
137 | + * This function sets the value |
|
138 | + * |
|
139 | + * @param string $key key |
|
140 | + * @param mixed $value value |
|
141 | + * @return bool True if the file needs to be updated, false otherwise |
|
142 | + */ |
|
143 | + protected function set($key, $value) { |
|
144 | + if (!isset($this->cache[$key]) || $this->cache[$key] !== $value) { |
|
145 | + // Add change |
|
146 | + $this->cache[$key] = $value; |
|
147 | + return true; |
|
148 | + } |
|
149 | 149 | |
150 | - return false; |
|
151 | - } |
|
150 | + return false; |
|
151 | + } |
|
152 | 152 | |
153 | - /** |
|
154 | - * Removes a key from the config and removes it from config.php if required |
|
155 | - * @param string $key |
|
156 | - */ |
|
157 | - public function deleteKey($key) { |
|
158 | - if ($this->delete($key)) { |
|
159 | - // Write changes |
|
160 | - $this->writeData(); |
|
161 | - } |
|
162 | - } |
|
153 | + /** |
|
154 | + * Removes a key from the config and removes it from config.php if required |
|
155 | + * @param string $key |
|
156 | + */ |
|
157 | + public function deleteKey($key) { |
|
158 | + if ($this->delete($key)) { |
|
159 | + // Write changes |
|
160 | + $this->writeData(); |
|
161 | + } |
|
162 | + } |
|
163 | 163 | |
164 | - /** |
|
165 | - * This function removes a key from the config |
|
166 | - * |
|
167 | - * @param string $key |
|
168 | - * @return bool True if the file needs to be updated, false otherwise |
|
169 | - */ |
|
170 | - protected function delete($key) { |
|
171 | - if (isset($this->cache[$key])) { |
|
172 | - // Delete key from cache |
|
173 | - unset($this->cache[$key]); |
|
174 | - return true; |
|
175 | - } |
|
176 | - return false; |
|
177 | - } |
|
164 | + /** |
|
165 | + * This function removes a key from the config |
|
166 | + * |
|
167 | + * @param string $key |
|
168 | + * @return bool True if the file needs to be updated, false otherwise |
|
169 | + */ |
|
170 | + protected function delete($key) { |
|
171 | + if (isset($this->cache[$key])) { |
|
172 | + // Delete key from cache |
|
173 | + unset($this->cache[$key]); |
|
174 | + return true; |
|
175 | + } |
|
176 | + return false; |
|
177 | + } |
|
178 | 178 | |
179 | - /** |
|
180 | - * Loads the config file |
|
181 | - * |
|
182 | - * Reads the config file and saves it to the cache |
|
183 | - * |
|
184 | - * @throws \Exception If no lock could be acquired or the config file has not been found |
|
185 | - */ |
|
186 | - private function readData() { |
|
187 | - // Default config should always get loaded |
|
188 | - $configFiles = array($this->configFilePath); |
|
179 | + /** |
|
180 | + * Loads the config file |
|
181 | + * |
|
182 | + * Reads the config file and saves it to the cache |
|
183 | + * |
|
184 | + * @throws \Exception If no lock could be acquired or the config file has not been found |
|
185 | + */ |
|
186 | + private function readData() { |
|
187 | + // Default config should always get loaded |
|
188 | + $configFiles = array($this->configFilePath); |
|
189 | 189 | |
190 | - // Add all files in the config dir ending with the same file name |
|
191 | - $extra = glob($this->configDir.'*.'.$this->configFileName); |
|
192 | - if (is_array($extra)) { |
|
193 | - natsort($extra); |
|
194 | - $configFiles = array_merge($configFiles, $extra); |
|
195 | - } |
|
190 | + // Add all files in the config dir ending with the same file name |
|
191 | + $extra = glob($this->configDir.'*.'.$this->configFileName); |
|
192 | + if (is_array($extra)) { |
|
193 | + natsort($extra); |
|
194 | + $configFiles = array_merge($configFiles, $extra); |
|
195 | + } |
|
196 | 196 | |
197 | - // Include file and merge config |
|
198 | - foreach ($configFiles as $file) { |
|
199 | - $fileExistsAndIsReadable = file_exists($file) && is_readable($file); |
|
200 | - $filePointer = $fileExistsAndIsReadable ? fopen($file, 'r') : false; |
|
201 | - if($file === $this->configFilePath && |
|
202 | - $filePointer === false) { |
|
203 | - // Opening the main config might not be possible, e.g. if the wrong |
|
204 | - // permissions are set (likely on a new installation) |
|
205 | - continue; |
|
206 | - } |
|
197 | + // Include file and merge config |
|
198 | + foreach ($configFiles as $file) { |
|
199 | + $fileExistsAndIsReadable = file_exists($file) && is_readable($file); |
|
200 | + $filePointer = $fileExistsAndIsReadable ? fopen($file, 'r') : false; |
|
201 | + if($file === $this->configFilePath && |
|
202 | + $filePointer === false) { |
|
203 | + // Opening the main config might not be possible, e.g. if the wrong |
|
204 | + // permissions are set (likely on a new installation) |
|
205 | + continue; |
|
206 | + } |
|
207 | 207 | |
208 | - // Try to acquire a file lock |
|
209 | - if(!flock($filePointer, LOCK_SH)) { |
|
210 | - throw new \Exception(sprintf('Could not acquire a shared lock on the config file %s', $file)); |
|
211 | - } |
|
208 | + // Try to acquire a file lock |
|
209 | + if(!flock($filePointer, LOCK_SH)) { |
|
210 | + throw new \Exception(sprintf('Could not acquire a shared lock on the config file %s', $file)); |
|
211 | + } |
|
212 | 212 | |
213 | - unset($CONFIG); |
|
214 | - include $file; |
|
215 | - if(isset($CONFIG) && is_array($CONFIG)) { |
|
216 | - $this->cache = array_merge($this->cache, $CONFIG); |
|
217 | - } |
|
213 | + unset($CONFIG); |
|
214 | + include $file; |
|
215 | + if(isset($CONFIG) && is_array($CONFIG)) { |
|
216 | + $this->cache = array_merge($this->cache, $CONFIG); |
|
217 | + } |
|
218 | 218 | |
219 | - // Close the file pointer and release the lock |
|
220 | - flock($filePointer, LOCK_UN); |
|
221 | - fclose($filePointer); |
|
222 | - } |
|
223 | - } |
|
219 | + // Close the file pointer and release the lock |
|
220 | + flock($filePointer, LOCK_UN); |
|
221 | + fclose($filePointer); |
|
222 | + } |
|
223 | + } |
|
224 | 224 | |
225 | - /** |
|
226 | - * Writes the config file |
|
227 | - * |
|
228 | - * Saves the config to the config file. |
|
229 | - * |
|
230 | - * @throws HintException If the config file cannot be written to |
|
231 | - * @throws \Exception If no file lock can be acquired |
|
232 | - */ |
|
233 | - private function writeData() { |
|
234 | - // Create a php file ... |
|
235 | - $content = "<?php\n"; |
|
236 | - $content .= '$CONFIG = '; |
|
237 | - $content .= var_export($this->cache, true); |
|
238 | - $content .= ";\n"; |
|
225 | + /** |
|
226 | + * Writes the config file |
|
227 | + * |
|
228 | + * Saves the config to the config file. |
|
229 | + * |
|
230 | + * @throws HintException If the config file cannot be written to |
|
231 | + * @throws \Exception If no file lock can be acquired |
|
232 | + */ |
|
233 | + private function writeData() { |
|
234 | + // Create a php file ... |
|
235 | + $content = "<?php\n"; |
|
236 | + $content .= '$CONFIG = '; |
|
237 | + $content .= var_export($this->cache, true); |
|
238 | + $content .= ";\n"; |
|
239 | 239 | |
240 | - touch ($this->configFilePath); |
|
241 | - $filePointer = fopen($this->configFilePath, 'r+'); |
|
240 | + touch ($this->configFilePath); |
|
241 | + $filePointer = fopen($this->configFilePath, 'r+'); |
|
242 | 242 | |
243 | - // Prevent others not to read the config |
|
244 | - chmod($this->configFilePath, 0640); |
|
243 | + // Prevent others not to read the config |
|
244 | + chmod($this->configFilePath, 0640); |
|
245 | 245 | |
246 | - // File does not exist, this can happen when doing a fresh install |
|
247 | - if(!is_resource ($filePointer)) { |
|
248 | - // TODO fix this via DI once it is very clear that this doesn't cause side effects due to initialization order |
|
249 | - // currently this breaks app routes but also could have other side effects especially during setup and exception handling |
|
250 | - $url = \OC::$server->getURLGenerator()->linkToDocs('admin-dir_permissions'); |
|
251 | - throw new HintException( |
|
252 | - "Can't write into config directory!", |
|
253 | - 'This can usually be fixed by giving the webserver write access to the config directory. See ' . $url); |
|
254 | - } |
|
246 | + // File does not exist, this can happen when doing a fresh install |
|
247 | + if(!is_resource ($filePointer)) { |
|
248 | + // TODO fix this via DI once it is very clear that this doesn't cause side effects due to initialization order |
|
249 | + // currently this breaks app routes but also could have other side effects especially during setup and exception handling |
|
250 | + $url = \OC::$server->getURLGenerator()->linkToDocs('admin-dir_permissions'); |
|
251 | + throw new HintException( |
|
252 | + "Can't write into config directory!", |
|
253 | + 'This can usually be fixed by giving the webserver write access to the config directory. See ' . $url); |
|
254 | + } |
|
255 | 255 | |
256 | - // Try to acquire a file lock |
|
257 | - if(!flock($filePointer, LOCK_EX)) { |
|
258 | - throw new \Exception(sprintf('Could not acquire an exclusive lock on the config file %s', $this->configFilePath)); |
|
259 | - } |
|
256 | + // Try to acquire a file lock |
|
257 | + if(!flock($filePointer, LOCK_EX)) { |
|
258 | + throw new \Exception(sprintf('Could not acquire an exclusive lock on the config file %s', $this->configFilePath)); |
|
259 | + } |
|
260 | 260 | |
261 | - // Write the config and release the lock |
|
262 | - ftruncate ($filePointer, 0); |
|
263 | - fwrite($filePointer, $content); |
|
264 | - fflush($filePointer); |
|
265 | - flock($filePointer, LOCK_UN); |
|
266 | - fclose($filePointer); |
|
261 | + // Write the config and release the lock |
|
262 | + ftruncate ($filePointer, 0); |
|
263 | + fwrite($filePointer, $content); |
|
264 | + fflush($filePointer); |
|
265 | + flock($filePointer, LOCK_UN); |
|
266 | + fclose($filePointer); |
|
267 | 267 | |
268 | - if (function_exists('opcache_invalidate')) { |
|
269 | - @opcache_invalidate($this->configFilePath, true); |
|
270 | - } |
|
271 | - } |
|
268 | + if (function_exists('opcache_invalidate')) { |
|
269 | + @opcache_invalidate($this->configFilePath, true); |
|
270 | + } |
|
271 | + } |
|
272 | 272 | } |
273 | 273 |
@@ -25,36 +25,36 @@ |
||
25 | 25 | |
26 | 26 | class LanguageParseChecker { |
27 | 27 | |
28 | - /** |
|
29 | - * @param string $appId |
|
30 | - * @return array |
|
31 | - */ |
|
32 | - public function analyse($appId) { |
|
33 | - $appPath = \OC_App::getAppPath($appId); |
|
34 | - if ($appPath === false) { |
|
35 | - throw new \RuntimeException("No app with given id <$appId> known."); |
|
36 | - } |
|
37 | - |
|
38 | - if (!is_dir($appPath . '/l10n/')) { |
|
39 | - return []; |
|
40 | - } |
|
41 | - |
|
42 | - $errors = []; |
|
43 | - $directory = new \DirectoryIterator($appPath . '/l10n/'); |
|
44 | - |
|
45 | - foreach ($directory as $file) { |
|
46 | - if ($file->getExtension() !== 'json') { |
|
47 | - continue; |
|
48 | - } |
|
49 | - |
|
50 | - $content = file_get_contents($file->getPathname()); |
|
51 | - json_decode($content, true); |
|
52 | - |
|
53 | - if (json_last_error() !== JSON_ERROR_NONE) { |
|
54 | - $errors[] = 'Invalid language file found: l10n/' . $file->getFilename() . ': ' . json_last_error_msg(); |
|
55 | - } |
|
56 | - } |
|
57 | - |
|
58 | - return $errors; |
|
59 | - } |
|
28 | + /** |
|
29 | + * @param string $appId |
|
30 | + * @return array |
|
31 | + */ |
|
32 | + public function analyse($appId) { |
|
33 | + $appPath = \OC_App::getAppPath($appId); |
|
34 | + if ($appPath === false) { |
|
35 | + throw new \RuntimeException("No app with given id <$appId> known."); |
|
36 | + } |
|
37 | + |
|
38 | + if (!is_dir($appPath . '/l10n/')) { |
|
39 | + return []; |
|
40 | + } |
|
41 | + |
|
42 | + $errors = []; |
|
43 | + $directory = new \DirectoryIterator($appPath . '/l10n/'); |
|
44 | + |
|
45 | + foreach ($directory as $file) { |
|
46 | + if ($file->getExtension() !== 'json') { |
|
47 | + continue; |
|
48 | + } |
|
49 | + |
|
50 | + $content = file_get_contents($file->getPathname()); |
|
51 | + json_decode($content, true); |
|
52 | + |
|
53 | + if (json_last_error() !== JSON_ERROR_NONE) { |
|
54 | + $errors[] = 'Invalid language file found: l10n/' . $file->getFilename() . ': ' . json_last_error_msg(); |
|
55 | + } |
|
56 | + } |
|
57 | + |
|
58 | + return $errors; |
|
59 | + } |
|
60 | 60 | } |
@@ -35,12 +35,12 @@ discard block |
||
35 | 35 | throw new \RuntimeException("No app with given id <$appId> known."); |
36 | 36 | } |
37 | 37 | |
38 | - if (!is_dir($appPath . '/l10n/')) { |
|
38 | + if (!is_dir($appPath.'/l10n/')) { |
|
39 | 39 | return []; |
40 | 40 | } |
41 | 41 | |
42 | 42 | $errors = []; |
43 | - $directory = new \DirectoryIterator($appPath . '/l10n/'); |
|
43 | + $directory = new \DirectoryIterator($appPath.'/l10n/'); |
|
44 | 44 | |
45 | 45 | foreach ($directory as $file) { |
46 | 46 | if ($file->getExtension() !== 'json') { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | json_decode($content, true); |
52 | 52 | |
53 | 53 | if (json_last_error() !== JSON_ERROR_NONE) { |
54 | - $errors[] = 'Invalid language file found: l10n/' . $file->getFilename() . ': ' . json_last_error_msg(); |
|
54 | + $errors[] = 'Invalid language file found: l10n/'.$file->getFilename().': '.json_last_error_msg(); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 |
@@ -22,10 +22,10 @@ |
||
22 | 22 | $dispatcher = \OC::$server->getEventDispatcher(); |
23 | 23 | |
24 | 24 | $dispatcher->addListener('OC\AccountManager::userUpdated', function(\Symfony\Component\EventDispatcher\GenericEvent $event) { |
25 | - /** @var \OCP\IUser $user */ |
|
26 | - $user = $event->getSubject(); |
|
25 | + /** @var \OCP\IUser $user */ |
|
26 | + $user = $event->getSubject(); |
|
27 | 27 | |
28 | - /** @var \OCA\LookupServerConnector\UpdateLookupServer $updateLookupServer */ |
|
29 | - $updateLookupServer = \OC::$server->query(\OCA\LookupServerConnector\UpdateLookupServer::class); |
|
30 | - $updateLookupServer->userUpdated($user); |
|
28 | + /** @var \OCA\LookupServerConnector\UpdateLookupServer $updateLookupServer */ |
|
29 | + $updateLookupServer = \OC::$server->query(\OCA\LookupServerConnector\UpdateLookupServer::class); |
|
30 | + $updateLookupServer->userUpdated($user); |
|
31 | 31 | }); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $json = file_get_contents('php://stdin'); |
113 | 113 | } else { |
114 | 114 | if (!file_exists($path)) { |
115 | - $output->writeln('<error>File not found: ' . $path . '</error>'); |
|
115 | + $output->writeln('<error>File not found: '.$path.'</error>'); |
|
116 | 116 | return 1; |
117 | 117 | } |
118 | 118 | $json = file_get_contents($path); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $existingMount->getApplicableUsers() === $mount->getApplicableUsers() && |
165 | 165 | $existingMount->getBackendOptions() === $mount->getBackendOptions() |
166 | 166 | ) { |
167 | - $output->writeln("<error>Duplicate mount (" . $mount->getMountPoint() . ")</error>"); |
|
167 | + $output->writeln("<error>Duplicate mount (".$mount->getMountPoint().")</error>"); |
|
168 | 168 | return 1; |
169 | 169 | } |
170 | 170 | } |
@@ -39,187 +39,187 @@ |
||
39 | 39 | use Symfony\Component\Console\Output\OutputInterface; |
40 | 40 | |
41 | 41 | class Import extends Base { |
42 | - /** |
|
43 | - * @var GlobalStoragesService |
|
44 | - */ |
|
45 | - private $globalService; |
|
46 | - |
|
47 | - /** |
|
48 | - * @var UserStoragesService |
|
49 | - */ |
|
50 | - private $userService; |
|
51 | - |
|
52 | - /** |
|
53 | - * @var IUserSession |
|
54 | - */ |
|
55 | - private $userSession; |
|
56 | - |
|
57 | - /** |
|
58 | - * @var IUserManager |
|
59 | - */ |
|
60 | - private $userManager; |
|
61 | - |
|
62 | - /** @var ImportLegacyStoragesService */ |
|
63 | - private $importLegacyStorageService; |
|
64 | - |
|
65 | - /** @var BackendService */ |
|
66 | - private $backendService; |
|
67 | - |
|
68 | - function __construct(GlobalStoragesService $globalService, |
|
69 | - UserStoragesService $userService, |
|
70 | - IUserSession $userSession, |
|
71 | - IUserManager $userManager, |
|
72 | - ImportLegacyStoragesService $importLegacyStorageService, |
|
73 | - BackendService $backendService |
|
74 | - ) { |
|
75 | - parent::__construct(); |
|
76 | - $this->globalService = $globalService; |
|
77 | - $this->userService = $userService; |
|
78 | - $this->userSession = $userSession; |
|
79 | - $this->userManager = $userManager; |
|
80 | - $this->importLegacyStorageService = $importLegacyStorageService; |
|
81 | - $this->backendService = $backendService; |
|
82 | - } |
|
83 | - |
|
84 | - protected function configure() { |
|
85 | - $this |
|
86 | - ->setName('files_external:import') |
|
87 | - ->setDescription('Import mount configurations') |
|
88 | - ->addOption( |
|
89 | - 'user', |
|
90 | - '', |
|
91 | - InputOption::VALUE_OPTIONAL, |
|
92 | - 'user to add the mount configurations for, if not set the mount will be added as system mount' |
|
93 | - ) |
|
94 | - ->addArgument( |
|
95 | - 'path', |
|
96 | - InputArgument::REQUIRED, |
|
97 | - 'path to a json file containing the mounts to import, use "-" to read from stdin' |
|
98 | - ) |
|
99 | - ->addOption( |
|
100 | - 'dry', |
|
101 | - '', |
|
102 | - InputOption::VALUE_NONE, |
|
103 | - 'Don\'t save the imported mounts, only list the new mounts' |
|
104 | - ); |
|
105 | - parent::configure(); |
|
106 | - } |
|
107 | - |
|
108 | - protected function execute(InputInterface $input, OutputInterface $output) { |
|
109 | - $user = $input->getOption('user'); |
|
110 | - $path = $input->getArgument('path'); |
|
111 | - if ($path === '-') { |
|
112 | - $json = file_get_contents('php://stdin'); |
|
113 | - } else { |
|
114 | - if (!file_exists($path)) { |
|
115 | - $output->writeln('<error>File not found: ' . $path . '</error>'); |
|
116 | - return 1; |
|
117 | - } |
|
118 | - $json = file_get_contents($path); |
|
119 | - } |
|
120 | - if (!is_string($json) || strlen($json) < 2) { |
|
121 | - $output->writeln('<error>Error while reading json</error>'); |
|
122 | - return 1; |
|
123 | - } |
|
124 | - $data = json_decode($json, true); |
|
125 | - if (!is_array($data)) { |
|
126 | - $output->writeln('<error>Error while parsing json</error>'); |
|
127 | - return 1; |
|
128 | - } |
|
129 | - |
|
130 | - $isLegacy = isset($data['user']) || isset($data['group']); |
|
131 | - if ($isLegacy) { |
|
132 | - $this->importLegacyStorageService->setData($data); |
|
133 | - $mounts = $this->importLegacyStorageService->getAllStorages(); |
|
134 | - foreach ($mounts as $mount) { |
|
135 | - if ($mount->getBackendOption('password') === false) { |
|
136 | - $output->writeln('<error>Failed to decrypt password</error>'); |
|
137 | - return 1; |
|
138 | - } |
|
139 | - } |
|
140 | - } else { |
|
141 | - if (!isset($data[0])) { //normalize to an array of mounts |
|
142 | - $data = [$data]; |
|
143 | - } |
|
144 | - $mounts = array_map([$this, 'parseData'], $data); |
|
145 | - } |
|
146 | - |
|
147 | - if ($user) { |
|
148 | - // ensure applicables are correct for personal mounts |
|
149 | - foreach ($mounts as $mount) { |
|
150 | - $mount->setApplicableGroups([]); |
|
151 | - $mount->setApplicableUsers([$user]); |
|
152 | - } |
|
153 | - } |
|
154 | - |
|
155 | - $storageService = $this->getStorageService($user); |
|
156 | - |
|
157 | - $existingMounts = $storageService->getAllStorages(); |
|
158 | - |
|
159 | - foreach ($mounts as $mount) { |
|
160 | - foreach ($existingMounts as $existingMount) { |
|
161 | - if ( |
|
162 | - $existingMount->getMountPoint() === $mount->getMountPoint() && |
|
163 | - $existingMount->getApplicableGroups() === $mount->getApplicableGroups() && |
|
164 | - $existingMount->getApplicableUsers() === $mount->getApplicableUsers() && |
|
165 | - $existingMount->getBackendOptions() === $mount->getBackendOptions() |
|
166 | - ) { |
|
167 | - $output->writeln("<error>Duplicate mount (" . $mount->getMountPoint() . ")</error>"); |
|
168 | - return 1; |
|
169 | - } |
|
170 | - } |
|
171 | - } |
|
172 | - |
|
173 | - if ($input->getOption('dry')) { |
|
174 | - if (count($mounts) === 0) { |
|
175 | - $output->writeln('<error>No mounts to be imported</error>'); |
|
176 | - return 1; |
|
177 | - } |
|
178 | - $listCommand = new ListCommand($this->globalService, $this->userService, $this->userSession, $this->userManager); |
|
179 | - $listInput = new ArrayInput([], $listCommand->getDefinition()); |
|
180 | - $listInput->setOption('output', $input->getOption('output')); |
|
181 | - $listInput->setOption('show-password', true); |
|
182 | - $listCommand->listMounts($user, $mounts, $listInput, $output); |
|
183 | - } else { |
|
184 | - foreach ($mounts as $mount) { |
|
185 | - $storageService->addStorage($mount); |
|
186 | - } |
|
187 | - } |
|
188 | - return 0; |
|
189 | - } |
|
190 | - |
|
191 | - private function parseData(array $data) { |
|
192 | - $mount = new StorageConfig($data['mount_id']); |
|
193 | - $mount->setMountPoint($data['mount_point']); |
|
194 | - $mount->setBackend($this->getBackendByClass($data['storage'])); |
|
195 | - $authBackend = $this->backendService->getAuthMechanism($data['authentication_type']); |
|
196 | - $mount->setAuthMechanism($authBackend); |
|
197 | - $mount->setBackendOptions($data['configuration']); |
|
198 | - $mount->setMountOptions($data['options']); |
|
199 | - $mount->setApplicableUsers(isset($data['applicable_users']) ? $data['applicable_users'] : []); |
|
200 | - $mount->setApplicableGroups(isset($data['applicable_groups']) ? $data['applicable_groups'] : []); |
|
201 | - return $mount; |
|
202 | - } |
|
203 | - |
|
204 | - private function getBackendByClass($className) { |
|
205 | - $backends = $this->backendService->getBackends(); |
|
206 | - foreach ($backends as $backend) { |
|
207 | - if ($backend->getStorageClass() === $className) { |
|
208 | - return $backend; |
|
209 | - } |
|
210 | - } |
|
211 | - } |
|
212 | - |
|
213 | - protected function getStorageService($userId) { |
|
214 | - if (!empty($userId)) { |
|
215 | - $user = $this->userManager->get($userId); |
|
216 | - if (is_null($user)) { |
|
217 | - throw new NoUserException("user $userId not found"); |
|
218 | - } |
|
219 | - $this->userSession->setUser($user); |
|
220 | - return $this->userService; |
|
221 | - } else { |
|
222 | - return $this->globalService; |
|
223 | - } |
|
224 | - } |
|
42 | + /** |
|
43 | + * @var GlobalStoragesService |
|
44 | + */ |
|
45 | + private $globalService; |
|
46 | + |
|
47 | + /** |
|
48 | + * @var UserStoragesService |
|
49 | + */ |
|
50 | + private $userService; |
|
51 | + |
|
52 | + /** |
|
53 | + * @var IUserSession |
|
54 | + */ |
|
55 | + private $userSession; |
|
56 | + |
|
57 | + /** |
|
58 | + * @var IUserManager |
|
59 | + */ |
|
60 | + private $userManager; |
|
61 | + |
|
62 | + /** @var ImportLegacyStoragesService */ |
|
63 | + private $importLegacyStorageService; |
|
64 | + |
|
65 | + /** @var BackendService */ |
|
66 | + private $backendService; |
|
67 | + |
|
68 | + function __construct(GlobalStoragesService $globalService, |
|
69 | + UserStoragesService $userService, |
|
70 | + IUserSession $userSession, |
|
71 | + IUserManager $userManager, |
|
72 | + ImportLegacyStoragesService $importLegacyStorageService, |
|
73 | + BackendService $backendService |
|
74 | + ) { |
|
75 | + parent::__construct(); |
|
76 | + $this->globalService = $globalService; |
|
77 | + $this->userService = $userService; |
|
78 | + $this->userSession = $userSession; |
|
79 | + $this->userManager = $userManager; |
|
80 | + $this->importLegacyStorageService = $importLegacyStorageService; |
|
81 | + $this->backendService = $backendService; |
|
82 | + } |
|
83 | + |
|
84 | + protected function configure() { |
|
85 | + $this |
|
86 | + ->setName('files_external:import') |
|
87 | + ->setDescription('Import mount configurations') |
|
88 | + ->addOption( |
|
89 | + 'user', |
|
90 | + '', |
|
91 | + InputOption::VALUE_OPTIONAL, |
|
92 | + 'user to add the mount configurations for, if not set the mount will be added as system mount' |
|
93 | + ) |
|
94 | + ->addArgument( |
|
95 | + 'path', |
|
96 | + InputArgument::REQUIRED, |
|
97 | + 'path to a json file containing the mounts to import, use "-" to read from stdin' |
|
98 | + ) |
|
99 | + ->addOption( |
|
100 | + 'dry', |
|
101 | + '', |
|
102 | + InputOption::VALUE_NONE, |
|
103 | + 'Don\'t save the imported mounts, only list the new mounts' |
|
104 | + ); |
|
105 | + parent::configure(); |
|
106 | + } |
|
107 | + |
|
108 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
109 | + $user = $input->getOption('user'); |
|
110 | + $path = $input->getArgument('path'); |
|
111 | + if ($path === '-') { |
|
112 | + $json = file_get_contents('php://stdin'); |
|
113 | + } else { |
|
114 | + if (!file_exists($path)) { |
|
115 | + $output->writeln('<error>File not found: ' . $path . '</error>'); |
|
116 | + return 1; |
|
117 | + } |
|
118 | + $json = file_get_contents($path); |
|
119 | + } |
|
120 | + if (!is_string($json) || strlen($json) < 2) { |
|
121 | + $output->writeln('<error>Error while reading json</error>'); |
|
122 | + return 1; |
|
123 | + } |
|
124 | + $data = json_decode($json, true); |
|
125 | + if (!is_array($data)) { |
|
126 | + $output->writeln('<error>Error while parsing json</error>'); |
|
127 | + return 1; |
|
128 | + } |
|
129 | + |
|
130 | + $isLegacy = isset($data['user']) || isset($data['group']); |
|
131 | + if ($isLegacy) { |
|
132 | + $this->importLegacyStorageService->setData($data); |
|
133 | + $mounts = $this->importLegacyStorageService->getAllStorages(); |
|
134 | + foreach ($mounts as $mount) { |
|
135 | + if ($mount->getBackendOption('password') === false) { |
|
136 | + $output->writeln('<error>Failed to decrypt password</error>'); |
|
137 | + return 1; |
|
138 | + } |
|
139 | + } |
|
140 | + } else { |
|
141 | + if (!isset($data[0])) { //normalize to an array of mounts |
|
142 | + $data = [$data]; |
|
143 | + } |
|
144 | + $mounts = array_map([$this, 'parseData'], $data); |
|
145 | + } |
|
146 | + |
|
147 | + if ($user) { |
|
148 | + // ensure applicables are correct for personal mounts |
|
149 | + foreach ($mounts as $mount) { |
|
150 | + $mount->setApplicableGroups([]); |
|
151 | + $mount->setApplicableUsers([$user]); |
|
152 | + } |
|
153 | + } |
|
154 | + |
|
155 | + $storageService = $this->getStorageService($user); |
|
156 | + |
|
157 | + $existingMounts = $storageService->getAllStorages(); |
|
158 | + |
|
159 | + foreach ($mounts as $mount) { |
|
160 | + foreach ($existingMounts as $existingMount) { |
|
161 | + if ( |
|
162 | + $existingMount->getMountPoint() === $mount->getMountPoint() && |
|
163 | + $existingMount->getApplicableGroups() === $mount->getApplicableGroups() && |
|
164 | + $existingMount->getApplicableUsers() === $mount->getApplicableUsers() && |
|
165 | + $existingMount->getBackendOptions() === $mount->getBackendOptions() |
|
166 | + ) { |
|
167 | + $output->writeln("<error>Duplicate mount (" . $mount->getMountPoint() . ")</error>"); |
|
168 | + return 1; |
|
169 | + } |
|
170 | + } |
|
171 | + } |
|
172 | + |
|
173 | + if ($input->getOption('dry')) { |
|
174 | + if (count($mounts) === 0) { |
|
175 | + $output->writeln('<error>No mounts to be imported</error>'); |
|
176 | + return 1; |
|
177 | + } |
|
178 | + $listCommand = new ListCommand($this->globalService, $this->userService, $this->userSession, $this->userManager); |
|
179 | + $listInput = new ArrayInput([], $listCommand->getDefinition()); |
|
180 | + $listInput->setOption('output', $input->getOption('output')); |
|
181 | + $listInput->setOption('show-password', true); |
|
182 | + $listCommand->listMounts($user, $mounts, $listInput, $output); |
|
183 | + } else { |
|
184 | + foreach ($mounts as $mount) { |
|
185 | + $storageService->addStorage($mount); |
|
186 | + } |
|
187 | + } |
|
188 | + return 0; |
|
189 | + } |
|
190 | + |
|
191 | + private function parseData(array $data) { |
|
192 | + $mount = new StorageConfig($data['mount_id']); |
|
193 | + $mount->setMountPoint($data['mount_point']); |
|
194 | + $mount->setBackend($this->getBackendByClass($data['storage'])); |
|
195 | + $authBackend = $this->backendService->getAuthMechanism($data['authentication_type']); |
|
196 | + $mount->setAuthMechanism($authBackend); |
|
197 | + $mount->setBackendOptions($data['configuration']); |
|
198 | + $mount->setMountOptions($data['options']); |
|
199 | + $mount->setApplicableUsers(isset($data['applicable_users']) ? $data['applicable_users'] : []); |
|
200 | + $mount->setApplicableGroups(isset($data['applicable_groups']) ? $data['applicable_groups'] : []); |
|
201 | + return $mount; |
|
202 | + } |
|
203 | + |
|
204 | + private function getBackendByClass($className) { |
|
205 | + $backends = $this->backendService->getBackends(); |
|
206 | + foreach ($backends as $backend) { |
|
207 | + if ($backend->getStorageClass() === $className) { |
|
208 | + return $backend; |
|
209 | + } |
|
210 | + } |
|
211 | + } |
|
212 | + |
|
213 | + protected function getStorageService($userId) { |
|
214 | + if (!empty($userId)) { |
|
215 | + $user = $this->userManager->get($userId); |
|
216 | + if (is_null($user)) { |
|
217 | + throw new NoUserException("user $userId not found"); |
|
218 | + } |
|
219 | + $this->userSession->setUser($user); |
|
220 | + return $this->userService; |
|
221 | + } else { |
|
222 | + return $this->globalService; |
|
223 | + } |
|
224 | + } |
|
225 | 225 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $files_list = json_decode($files); |
38 | 38 | // in case we get only a single file |
39 | 39 | if (!is_array($files_list)) { |
40 | - $files_list = array($files); |
|
40 | + $files_list = array($files); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | * alphanumeric characters |
47 | 47 | */ |
48 | 48 | if(isset($_GET['downloadStartSecret']) |
49 | - && !isset($_GET['downloadStartSecret'][32]) |
|
50 | - && preg_match('!^[a-zA-Z0-9]+$!', $_GET['downloadStartSecret']) === 1) { |
|
51 | - setcookie('ocDownloadStarted', $_GET['downloadStartSecret'], time() + 20, '/'); |
|
49 | + && !isset($_GET['downloadStartSecret'][32]) |
|
50 | + && preg_match('!^[a-zA-Z0-9]+$!', $_GET['downloadStartSecret']) === 1) { |
|
51 | + setcookie('ocDownloadStarted', $_GET['downloadStartSecret'], time() + 20, '/'); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | $server_params = array( 'head' => \OC::$server->getRequest()->getMethod() === 'HEAD' ); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * Http range requests support |
58 | 58 | */ |
59 | 59 | if (isset($_SERVER['HTTP_RANGE'])) { |
60 | - $server_params['range'] = \OC::$server->getRequest()->getHeader('Range'); |
|
60 | + $server_params['range'] = \OC::$server->getRequest()->getHeader('Range'); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | OC_Files::get($dir, $files_list, $server_params); |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | OCP\User::checkLoggedIn(); |
32 | 32 | \OC::$server->getSession()->close(); |
33 | 33 | |
34 | -$files = isset($_GET['files']) ? (string)$_GET['files'] : ''; |
|
35 | -$dir = isset($_GET['dir']) ? (string)$_GET['dir'] : ''; |
|
34 | +$files = isset($_GET['files']) ? (string) $_GET['files'] : ''; |
|
35 | +$dir = isset($_GET['dir']) ? (string) $_GET['dir'] : ''; |
|
36 | 36 | |
37 | 37 | $files_list = json_decode($files); |
38 | 38 | // in case we get only a single file |
@@ -45,13 +45,13 @@ discard block |
||
45 | 45 | * the content must not be longer than 32 characters and must only contain |
46 | 46 | * alphanumeric characters |
47 | 47 | */ |
48 | -if(isset($_GET['downloadStartSecret']) |
|
48 | +if (isset($_GET['downloadStartSecret']) |
|
49 | 49 | && !isset($_GET['downloadStartSecret'][32]) |
50 | 50 | && preg_match('!^[a-zA-Z0-9]+$!', $_GET['downloadStartSecret']) === 1) { |
51 | 51 | setcookie('ocDownloadStarted', $_GET['downloadStartSecret'], time() + 20, '/'); |
52 | 52 | } |
53 | 53 | |
54 | -$server_params = array( 'head' => \OC::$server->getRequest()->getMethod() === 'HEAD' ); |
|
54 | +$server_params = array('head' => \OC::$server->getRequest()->getMethod() === 'HEAD'); |
|
55 | 55 | |
56 | 56 | /** |
57 | 57 | * Http range requests support |
@@ -68,7 +68,7 @@ |
||
68 | 68 | |
69 | 69 | $query = $this->connection->getQueryBuilder(); |
70 | 70 | $query->update('share') |
71 | - ->set('share_type', $query->createNamedParameter(Share::SHARE_TYPE_GUEST)) |
|
71 | + ->set('share_type', $query->createNamedParameter(Share::SHARE_TYPE_GUEST)) |
|
72 | 72 | ->where($query->expr()->eq('share_type', $query->createNamedParameter(Share::SHARE_TYPE_EMAIL))); |
73 | 73 | $query->execute(); |
74 | 74 | } |
@@ -36,47 +36,47 @@ |
||
36 | 36 | */ |
37 | 37 | class OwncloudGuestShareType implements IRepairStep { |
38 | 38 | |
39 | - /** @var IDBConnection */ |
|
40 | - private $connection; |
|
39 | + /** @var IDBConnection */ |
|
40 | + private $connection; |
|
41 | 41 | |
42 | - /** @var IConfig */ |
|
43 | - private $config; |
|
42 | + /** @var IConfig */ |
|
43 | + private $config; |
|
44 | 44 | |
45 | 45 | |
46 | - public function __construct(IDBConnection $connection, IConfig $config) { |
|
47 | - $this->connection = $connection; |
|
48 | - $this->config = $config; |
|
49 | - } |
|
46 | + public function __construct(IDBConnection $connection, IConfig $config) { |
|
47 | + $this->connection = $connection; |
|
48 | + $this->config = $config; |
|
49 | + } |
|
50 | 50 | |
51 | - /** |
|
52 | - * Returns the step's name |
|
53 | - * |
|
54 | - * @return string |
|
55 | - * @since 9.1.0 |
|
56 | - */ |
|
57 | - public function getName() { |
|
58 | - return 'Fix the share type of guest shares when migrating from ownCloud'; |
|
59 | - } |
|
51 | + /** |
|
52 | + * Returns the step's name |
|
53 | + * |
|
54 | + * @return string |
|
55 | + * @since 9.1.0 |
|
56 | + */ |
|
57 | + public function getName() { |
|
58 | + return 'Fix the share type of guest shares when migrating from ownCloud'; |
|
59 | + } |
|
60 | 60 | |
61 | - /** |
|
62 | - * @param IOutput $output |
|
63 | - */ |
|
64 | - public function run(IOutput $output) { |
|
65 | - if (!$this->shouldRun()) { |
|
66 | - return; |
|
67 | - } |
|
61 | + /** |
|
62 | + * @param IOutput $output |
|
63 | + */ |
|
64 | + public function run(IOutput $output) { |
|
65 | + if (!$this->shouldRun()) { |
|
66 | + return; |
|
67 | + } |
|
68 | 68 | |
69 | - $query = $this->connection->getQueryBuilder(); |
|
70 | - $query->update('share') |
|
71 | - ->set('share_type', $query->createNamedParameter(Share::SHARE_TYPE_GUEST)) |
|
72 | - ->where($query->expr()->eq('share_type', $query->createNamedParameter(Share::SHARE_TYPE_EMAIL))); |
|
73 | - $query->execute(); |
|
74 | - } |
|
69 | + $query = $this->connection->getQueryBuilder(); |
|
70 | + $query->update('share') |
|
71 | + ->set('share_type', $query->createNamedParameter(Share::SHARE_TYPE_GUEST)) |
|
72 | + ->where($query->expr()->eq('share_type', $query->createNamedParameter(Share::SHARE_TYPE_EMAIL))); |
|
73 | + $query->execute(); |
|
74 | + } |
|
75 | 75 | |
76 | - protected function shouldRun() { |
|
77 | - $appVersion = $this->config->getAppValue('files_sharing', 'installed_version', '0.0.0'); |
|
78 | - return $appVersion === '0.10.0' || |
|
79 | - $this->config->getAppValue('core', 'vendor', '') === 'owncloud'; |
|
80 | - } |
|
76 | + protected function shouldRun() { |
|
77 | + $appVersion = $this->config->getAppValue('files_sharing', 'installed_version', '0.0.0'); |
|
78 | + return $appVersion === '0.10.0' || |
|
79 | + $this->config->getAppValue('core', 'vendor', '') === 'owncloud'; |
|
80 | + } |
|
81 | 81 | |
82 | 82 | } |
@@ -36,62 +36,62 @@ |
||
36 | 36 | */ |
37 | 37 | class SetPasswordColumn implements IRepairStep { |
38 | 38 | |
39 | - /** @var IDBConnection */ |
|
40 | - private $connection; |
|
41 | - |
|
42 | - /** @var IConfig */ |
|
43 | - private $config; |
|
44 | - |
|
45 | - |
|
46 | - public function __construct(IDBConnection $connection, IConfig $config) { |
|
47 | - $this->connection = $connection; |
|
48 | - $this->config = $config; |
|
49 | - } |
|
50 | - |
|
51 | - /** |
|
52 | - * Returns the step's name |
|
53 | - * |
|
54 | - * @return string |
|
55 | - * @since 9.1.0 |
|
56 | - */ |
|
57 | - public function getName() { |
|
58 | - return 'Copy the share password into the dedicated column'; |
|
59 | - } |
|
60 | - |
|
61 | - /** |
|
62 | - * @param IOutput $output |
|
63 | - */ |
|
64 | - public function run(IOutput $output) { |
|
65 | - if (!$this->shouldRun()) { |
|
66 | - return; |
|
67 | - } |
|
68 | - |
|
69 | - $query = $this->connection->getQueryBuilder(); |
|
70 | - $query |
|
71 | - ->update('share') |
|
72 | - ->set('password', 'share_with') |
|
73 | - ->where($query->expr()->eq('share_type', $query->createNamedParameter(Share::SHARE_TYPE_LINK))) |
|
74 | - ->andWhere($query->expr()->isNotNull('share_with')); |
|
75 | - $result = $query->execute(); |
|
76 | - |
|
77 | - if ($result === 0) { |
|
78 | - // No link updated, no need to run the second query |
|
79 | - return; |
|
80 | - } |
|
81 | - |
|
82 | - $clearQuery = $this->connection->getQueryBuilder(); |
|
83 | - $clearQuery |
|
84 | - ->update('share') |
|
85 | - ->set('share_with', $clearQuery->createNamedParameter(null)) |
|
86 | - ->where($clearQuery->expr()->eq('share_type', $clearQuery->createNamedParameter(Share::SHARE_TYPE_LINK))); |
|
87 | - |
|
88 | - $clearQuery->execute(); |
|
89 | - |
|
90 | - } |
|
91 | - |
|
92 | - protected function shouldRun() { |
|
93 | - $appVersion = $this->config->getAppValue('files_sharing', 'installed_version', '0.0.0'); |
|
94 | - return version_compare($appVersion, '1.4.0', '<'); |
|
95 | - } |
|
39 | + /** @var IDBConnection */ |
|
40 | + private $connection; |
|
41 | + |
|
42 | + /** @var IConfig */ |
|
43 | + private $config; |
|
44 | + |
|
45 | + |
|
46 | + public function __construct(IDBConnection $connection, IConfig $config) { |
|
47 | + $this->connection = $connection; |
|
48 | + $this->config = $config; |
|
49 | + } |
|
50 | + |
|
51 | + /** |
|
52 | + * Returns the step's name |
|
53 | + * |
|
54 | + * @return string |
|
55 | + * @since 9.1.0 |
|
56 | + */ |
|
57 | + public function getName() { |
|
58 | + return 'Copy the share password into the dedicated column'; |
|
59 | + } |
|
60 | + |
|
61 | + /** |
|
62 | + * @param IOutput $output |
|
63 | + */ |
|
64 | + public function run(IOutput $output) { |
|
65 | + if (!$this->shouldRun()) { |
|
66 | + return; |
|
67 | + } |
|
68 | + |
|
69 | + $query = $this->connection->getQueryBuilder(); |
|
70 | + $query |
|
71 | + ->update('share') |
|
72 | + ->set('password', 'share_with') |
|
73 | + ->where($query->expr()->eq('share_type', $query->createNamedParameter(Share::SHARE_TYPE_LINK))) |
|
74 | + ->andWhere($query->expr()->isNotNull('share_with')); |
|
75 | + $result = $query->execute(); |
|
76 | + |
|
77 | + if ($result === 0) { |
|
78 | + // No link updated, no need to run the second query |
|
79 | + return; |
|
80 | + } |
|
81 | + |
|
82 | + $clearQuery = $this->connection->getQueryBuilder(); |
|
83 | + $clearQuery |
|
84 | + ->update('share') |
|
85 | + ->set('share_with', $clearQuery->createNamedParameter(null)) |
|
86 | + ->where($clearQuery->expr()->eq('share_type', $clearQuery->createNamedParameter(Share::SHARE_TYPE_LINK))); |
|
87 | + |
|
88 | + $clearQuery->execute(); |
|
89 | + |
|
90 | + } |
|
91 | + |
|
92 | + protected function shouldRun() { |
|
93 | + $appVersion = $this->config->getAppValue('files_sharing', 'installed_version', '0.0.0'); |
|
94 | + return version_compare($appVersion, '1.4.0', '<'); |
|
95 | + } |
|
96 | 96 | |
97 | 97 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * ubos-raspberry-pi.local and ubos-raspberry-pi-2.local |
68 | 68 | */ |
69 | 69 | 'trusted_domains' => |
70 | - array ( |
|
70 | + array( |
|
71 | 71 | 'demo.example.org', |
72 | 72 | 'otherdomain.example.org', |
73 | 73 | ), |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | * |
193 | 193 | * Defaults to ``60*60*24*15`` seconds (15 days) |
194 | 194 | */ |
195 | -'remember_login_cookie_lifetime' => 60*60*24*15, |
|
195 | +'remember_login_cookie_lifetime' => 60 * 60 * 24 * 15, |
|
196 | 196 | |
197 | 197 | /** |
198 | 198 | * The lifetime of a session after inactivity. |
@@ -1074,7 +1074,7 @@ discard block |
||
1074 | 1074 | * See https://redis.io/topics/cluster-spec for details about the Redis cluster |
1075 | 1075 | */ |
1076 | 1076 | 'redis.cluster' => [ |
1077 | - 'seeds' => [ // provide some/all of the cluster servers to bootstrap discovery, port required |
|
1077 | + 'seeds' => [// provide some/all of the cluster servers to bootstrap discovery, port required |
|
1078 | 1078 | 'localhost:7000', |
1079 | 1079 | 'localhost:7001' |
1080 | 1080 | ], |
@@ -1138,7 +1138,7 @@ discard block |
||
1138 | 1138 | * |
1139 | 1139 | * Defaults to ``60*60*24`` (1 day) |
1140 | 1140 | */ |
1141 | -'cache_chunk_gc_ttl' => 60*60*24, |
|
1141 | +'cache_chunk_gc_ttl' => 60 * 60 * 24, |
|
1142 | 1142 | |
1143 | 1143 | /** |
1144 | 1144 | * Using Object Store with Nextcloud |
@@ -1462,7 +1462,7 @@ discard block |
||
1462 | 1462 | * Defaults to ``60*60`` seconds (1 hour) or the php |
1463 | 1463 | * max_execution_time, whichever is higher. |
1464 | 1464 | */ |
1465 | -'filelocking.ttl' => 60*60, |
|
1465 | +'filelocking.ttl' => 60 * 60, |
|
1466 | 1466 | |
1467 | 1467 | /** |
1468 | 1468 | * Memory caching backend for file locking |
@@ -41,17 +41,17 @@ discard block |
||
41 | 41 | */ |
42 | 42 | 'instanceid' => '', |
43 | 43 | |
44 | - /** |
|
45 | - * The salt used to hash all passwords, auto-generated by the Nextcloud |
|
46 | - * installer. (There are also per-user salts.) If you lose this salt you lose |
|
47 | - * all your passwords. This example is for documentation only, and you should |
|
48 | - * never use it. |
|
49 | - * |
|
50 | - * @deprecated This salt is deprecated and only used for legacy-compatibility, |
|
51 | - * developers should *NOT* use this value for anything nowadays. |
|
52 | - * |
|
53 | - * 'passwordsalt' => 'd3c944a9af095aa08f', |
|
54 | - */ |
|
44 | + /** |
|
45 | + * The salt used to hash all passwords, auto-generated by the Nextcloud |
|
46 | + * installer. (There are also per-user salts.) If you lose this salt you lose |
|
47 | + * all your passwords. This example is for documentation only, and you should |
|
48 | + * never use it. |
|
49 | + * |
|
50 | + * @deprecated This salt is deprecated and only used for legacy-compatibility, |
|
51 | + * developers should *NOT* use this value for anything nowadays. |
|
52 | + * |
|
53 | + * 'passwordsalt' => 'd3c944a9af095aa08f', |
|
54 | + */ |
|
55 | 55 | 'passwordsalt' => '', |
56 | 56 | |
57 | 57 | /** |
@@ -67,10 +67,10 @@ discard block |
||
67 | 67 | * ubos-raspberry-pi.local and ubos-raspberry-pi-2.local |
68 | 68 | */ |
69 | 69 | 'trusted_domains' => |
70 | - array ( |
|
70 | + array ( |
|
71 | 71 | 'demo.example.org', |
72 | 72 | 'otherdomain.example.org', |
73 | - ), |
|
73 | + ), |
|
74 | 74 | |
75 | 75 | |
76 | 76 | /** |
@@ -678,10 +678,10 @@ discard block |
||
678 | 678 | * - www.edri.org |
679 | 679 | */ |
680 | 680 | 'connectivity_check_domains' => array( |
681 | - 'www.nextcloud.com', |
|
682 | - 'www.startpage.com', |
|
683 | - 'www.eff.org', |
|
684 | - 'www.edri.org' |
|
681 | + 'www.nextcloud.com', |
|
682 | + 'www.startpage.com', |
|
683 | + 'www.eff.org', |
|
684 | + 'www.edri.org' |
|
685 | 685 | ), |
686 | 686 | |
687 | 687 | /** |
@@ -797,9 +797,9 @@ discard block |
||
797 | 797 | * Defaults to an empty array. |
798 | 798 | */ |
799 | 799 | 'log.condition' => [ |
800 | - 'shared_secret' => '57b58edb6637fe3059b3595cf9c41b9', |
|
801 | - 'users' => ['sample-user'], |
|
802 | - 'apps' => ['files'], |
|
800 | + 'shared_secret' => '57b58edb6637fe3059b3595cf9c41b9', |
|
801 | + 'users' => ['sample-user'], |
|
802 | + 'apps' => ['files'], |
|
803 | 803 | ], |
804 | 804 | |
805 | 805 | /** |
@@ -853,18 +853,18 @@ discard block |
||
853 | 853 | * - iOS client app id: ``1125420102`` |
854 | 854 | */ |
855 | 855 | 'customclient_desktop' => |
856 | - 'https://nextcloud.com/install/#install-clients', |
|
856 | + 'https://nextcloud.com/install/#install-clients', |
|
857 | 857 | 'customclient_android' => |
858 | - 'https://play.google.com/store/apps/details?id=com.nextcloud.client', |
|
858 | + 'https://play.google.com/store/apps/details?id=com.nextcloud.client', |
|
859 | 859 | 'customclient_ios' => |
860 | - 'https://itunes.apple.com/us/app/nextcloud/id1125420102?mt=8', |
|
860 | + 'https://itunes.apple.com/us/app/nextcloud/id1125420102?mt=8', |
|
861 | 861 | 'customclient_ios_appid' => |
862 | - '1125420102', |
|
862 | + '1125420102', |
|
863 | 863 | /** |
864 | - * Apps |
|
865 | - * |
|
866 | - * Options for the Apps folder, Apps store, and App code checker. |
|
867 | - */ |
|
864 | + * Apps |
|
865 | + * |
|
866 | + * Options for the Apps folder, Apps store, and App code checker. |
|
867 | + */ |
|
868 | 868 | |
869 | 869 | /** |
870 | 870 | * When enabled, admins may install apps from the Nextcloud app store. |
@@ -882,11 +882,11 @@ discard block |
||
882 | 882 | * indicates if a Web server can write files to that folder. |
883 | 883 | */ |
884 | 884 | 'apps_paths' => array( |
885 | - array( |
|
886 | - 'path'=> '/var/www/nextcloud/apps', |
|
887 | - 'url' => '/apps', |
|
888 | - 'writable' => true, |
|
889 | - ), |
|
885 | + array( |
|
886 | + 'path'=> '/var/www/nextcloud/apps', |
|
887 | + 'url' => '/apps', |
|
888 | + 'writable' => true, |
|
889 | + ), |
|
890 | 890 | ), |
891 | 891 | |
892 | 892 | /** |
@@ -951,8 +951,8 @@ discard block |
||
951 | 951 | * Defaults to ``''`` (empty string) |
952 | 952 | */ |
953 | 953 | 'preview_office_cl_parameters' => |
954 | - ' --headless --nologo --nofirststartwizard --invisible --norestore '. |
|
955 | - '--convert-to png --outdir ', |
|
954 | + ' --headless --nologo --nofirststartwizard --invisible --norestore '. |
|
955 | + '--convert-to png --outdir ', |
|
956 | 956 | |
957 | 957 | /** |
958 | 958 | * Only register providers that have been explicitly enabled |
@@ -996,15 +996,15 @@ discard block |
||
996 | 996 | * - OC\Preview\XBitmap |
997 | 997 | */ |
998 | 998 | 'enabledPreviewProviders' => array( |
999 | - 'OC\Preview\PNG', |
|
1000 | - 'OC\Preview\JPEG', |
|
1001 | - 'OC\Preview\GIF', |
|
1002 | - 'OC\Preview\HEIC', |
|
1003 | - 'OC\Preview\BMP', |
|
1004 | - 'OC\Preview\XBitmap', |
|
1005 | - 'OC\Preview\MP3', |
|
1006 | - 'OC\Preview\TXT', |
|
1007 | - 'OC\Preview\MarkDown' |
|
999 | + 'OC\Preview\PNG', |
|
1000 | + 'OC\Preview\JPEG', |
|
1001 | + 'OC\Preview\GIF', |
|
1002 | + 'OC\Preview\HEIC', |
|
1003 | + 'OC\Preview\BMP', |
|
1004 | + 'OC\Preview\XBitmap', |
|
1005 | + 'OC\Preview\MP3', |
|
1006 | + 'OC\Preview\TXT', |
|
1007 | + 'OC\Preview\MarkDown' |
|
1008 | 1008 | ), |
1009 | 1009 | |
1010 | 1010 | /** |
@@ -1080,11 +1080,11 @@ discard block |
||
1080 | 1080 | |
1081 | 1081 | /** |
1082 | 1082 | * Extra SSL options to be used for configuration. |
1083 | - * |
|
1083 | + * |
|
1084 | 1084 | * Defaults to an empty array. |
1085 | 1085 | */ |
1086 | 1086 | 'openssl' => array( |
1087 | - 'config' => '/absolute/location/of/openssl.cnf', |
|
1087 | + 'config' => '/absolute/location/of/openssl.cnf', |
|
1088 | 1088 | ), |
1089 | 1089 | |
1090 | 1090 | /** |
@@ -1132,11 +1132,11 @@ discard block |
||
1132 | 1132 | * for more information. |
1133 | 1133 | */ |
1134 | 1134 | 'redis' => [ |
1135 | - 'host' => 'localhost', // can also be a unix domain socket: '/tmp/redis.sock' |
|
1136 | - 'port' => 6379, |
|
1137 | - 'timeout' => 0.0, |
|
1138 | - 'password' => '', // Optional, if not defined no password will be used. |
|
1139 | - 'dbindex' => 0, // Optional, if undefined SELECT will not run and will use Redis Server's default DB Index. |
|
1135 | + 'host' => 'localhost', // can also be a unix domain socket: '/tmp/redis.sock' |
|
1136 | + 'port' => 6379, |
|
1137 | + 'timeout' => 0.0, |
|
1138 | + 'password' => '', // Optional, if not defined no password will be used. |
|
1139 | + 'dbindex' => 0, // Optional, if undefined SELECT will not run and will use Redis Server's default DB Index. |
|
1140 | 1140 | ], |
1141 | 1141 | |
1142 | 1142 | /** |
@@ -1162,13 +1162,13 @@ discard block |
||
1162 | 1162 | * See https://redis.io/topics/cluster-spec for details about the Redis cluster |
1163 | 1163 | */ |
1164 | 1164 | 'redis.cluster' => [ |
1165 | - 'seeds' => [ // provide some/all of the cluster servers to bootstrap discovery, port required |
|
1166 | - 'localhost:7000', |
|
1167 | - 'localhost:7001' |
|
1168 | - ], |
|
1169 | - 'timeout' => 0.0, |
|
1170 | - 'read_timeout' => 0.0, |
|
1171 | - 'failover_mode' => \RedisCluster::FAILOVER_ERROR |
|
1165 | + 'seeds' => [ // provide some/all of the cluster servers to bootstrap discovery, port required |
|
1166 | + 'localhost:7000', |
|
1167 | + 'localhost:7001' |
|
1168 | + ], |
|
1169 | + 'timeout' => 0.0, |
|
1170 | + 'read_timeout' => 0.0, |
|
1171 | + 'failover_mode' => \RedisCluster::FAILOVER_ERROR |
|
1172 | 1172 | ], |
1173 | 1173 | |
1174 | 1174 | |
@@ -1176,35 +1176,35 @@ discard block |
||
1176 | 1176 | * Server details for one or more memcached servers to use for memory caching. |
1177 | 1177 | */ |
1178 | 1178 | 'memcached_servers' => array( |
1179 | - // hostname, port and optional weight. Also see: |
|
1180 | - // http://www.php.net/manual/en/memcached.addservers.php |
|
1181 | - // http://www.php.net/manual/en/memcached.addserver.php |
|
1182 | - array('localhost', 11211), |
|
1183 | - //array('other.host.local', 11211), |
|
1179 | + // hostname, port and optional weight. Also see: |
|
1180 | + // http://www.php.net/manual/en/memcached.addservers.php |
|
1181 | + // http://www.php.net/manual/en/memcached.addserver.php |
|
1182 | + array('localhost', 11211), |
|
1183 | + //array('other.host.local', 11211), |
|
1184 | 1184 | ), |
1185 | 1185 | |
1186 | 1186 | /** |
1187 | 1187 | * Connection options for memcached, see http://apprize.info/php/scaling/15.html |
1188 | 1188 | */ |
1189 | 1189 | 'memcached_options' => array( |
1190 | - // Set timeouts to 50ms |
|
1191 | - \Memcached::OPT_CONNECT_TIMEOUT => 50, |
|
1192 | - \Memcached::OPT_RETRY_TIMEOUT => 50, |
|
1193 | - \Memcached::OPT_SEND_TIMEOUT => 50, |
|
1194 | - \Memcached::OPT_RECV_TIMEOUT => 50, |
|
1195 | - \Memcached::OPT_POLL_TIMEOUT => 50, |
|
1190 | + // Set timeouts to 50ms |
|
1191 | + \Memcached::OPT_CONNECT_TIMEOUT => 50, |
|
1192 | + \Memcached::OPT_RETRY_TIMEOUT => 50, |
|
1193 | + \Memcached::OPT_SEND_TIMEOUT => 50, |
|
1194 | + \Memcached::OPT_RECV_TIMEOUT => 50, |
|
1195 | + \Memcached::OPT_POLL_TIMEOUT => 50, |
|
1196 | 1196 | |
1197 | - // Enable compression |
|
1198 | - \Memcached::OPT_COMPRESSION => true, |
|
1197 | + // Enable compression |
|
1198 | + \Memcached::OPT_COMPRESSION => true, |
|
1199 | 1199 | |
1200 | - // Turn on consistent hashing |
|
1201 | - \Memcached::OPT_LIBKETAMA_COMPATIBLE => true, |
|
1200 | + // Turn on consistent hashing |
|
1201 | + \Memcached::OPT_LIBKETAMA_COMPATIBLE => true, |
|
1202 | 1202 | |
1203 | - // Enable Binary Protocol |
|
1204 | - \Memcached::OPT_BINARY_PROTOCOL => true, |
|
1203 | + // Enable Binary Protocol |
|
1204 | + \Memcached::OPT_BINARY_PROTOCOL => true, |
|
1205 | 1205 | |
1206 | - // Binary serializer vill be enabled if the igbinary PECL module is available |
|
1207 | - //\Memcached::OPT_SERIALIZER => \Memcached::SERIALIZER_IGBINARY, |
|
1206 | + // Binary serializer vill be enabled if the igbinary PECL module is available |
|
1207 | + //\Memcached::OPT_SERIALIZER => \Memcached::SERIALIZER_IGBINARY, |
|
1208 | 1208 | ), |
1209 | 1209 | |
1210 | 1210 | |
@@ -1250,61 +1250,61 @@ discard block |
||
1250 | 1250 | * One way to test is applying for a trystack account at http://trystack.org/ |
1251 | 1251 | */ |
1252 | 1252 | 'objectstore' => [ |
1253 | - 'class' => 'OC\\Files\\ObjectStore\\Swift', |
|
1254 | - 'arguments' => [ |
|
1255 | - // trystack will use your facebook id as the user name |
|
1256 | - 'username' => 'facebook100000123456789', |
|
1257 | - // in the trystack dashboard go to user -> settings -> API Password to |
|
1258 | - // generate a password |
|
1259 | - 'password' => 'Secr3tPaSSWoRdt7', |
|
1260 | - // must already exist in the objectstore, name can be different |
|
1261 | - 'container' => 'nextcloud', |
|
1262 | - // prefix to prepend to the fileid, default is 'oid:urn:' |
|
1263 | - 'objectPrefix' => 'oid:urn:', |
|
1264 | - // create the container if it does not exist. default is false |
|
1265 | - 'autocreate' => true, |
|
1266 | - // required, dev-/trystack defaults to 'RegionOne' |
|
1267 | - 'region' => 'RegionOne', |
|
1268 | - // The Identity / Keystone endpoint |
|
1269 | - 'url' => 'http://8.21.28.222:5000/v2.0', |
|
1270 | - // required on dev-/trystack |
|
1271 | - 'tenantName' => 'facebook100000123456789', |
|
1272 | - // dev-/trystack uses swift by default, the lib defaults to 'cloudFiles' |
|
1273 | - // if omitted |
|
1274 | - 'serviceName' => 'swift', |
|
1275 | - // The Interface / url Type, optional |
|
1276 | - 'urlType' => 'internal' |
|
1277 | - ], |
|
1253 | + 'class' => 'OC\\Files\\ObjectStore\\Swift', |
|
1254 | + 'arguments' => [ |
|
1255 | + // trystack will use your facebook id as the user name |
|
1256 | + 'username' => 'facebook100000123456789', |
|
1257 | + // in the trystack dashboard go to user -> settings -> API Password to |
|
1258 | + // generate a password |
|
1259 | + 'password' => 'Secr3tPaSSWoRdt7', |
|
1260 | + // must already exist in the objectstore, name can be different |
|
1261 | + 'container' => 'nextcloud', |
|
1262 | + // prefix to prepend to the fileid, default is 'oid:urn:' |
|
1263 | + 'objectPrefix' => 'oid:urn:', |
|
1264 | + // create the container if it does not exist. default is false |
|
1265 | + 'autocreate' => true, |
|
1266 | + // required, dev-/trystack defaults to 'RegionOne' |
|
1267 | + 'region' => 'RegionOne', |
|
1268 | + // The Identity / Keystone endpoint |
|
1269 | + 'url' => 'http://8.21.28.222:5000/v2.0', |
|
1270 | + // required on dev-/trystack |
|
1271 | + 'tenantName' => 'facebook100000123456789', |
|
1272 | + // dev-/trystack uses swift by default, the lib defaults to 'cloudFiles' |
|
1273 | + // if omitted |
|
1274 | + 'serviceName' => 'swift', |
|
1275 | + // The Interface / url Type, optional |
|
1276 | + 'urlType' => 'internal' |
|
1277 | + ], |
|
1278 | 1278 | ], |
1279 | 1279 | |
1280 | 1280 | /** |
1281 | 1281 | * To use swift V3 |
1282 | 1282 | */ |
1283 | 1283 | 'objectstore' => [ |
1284 | - 'class' => 'OC\\Files\\ObjectStore\\Swift', |
|
1285 | - 'arguments' => [ |
|
1286 | - 'autocreate' => true, |
|
1287 | - 'user' => [ |
|
1288 | - 'name' => 'swift', |
|
1289 | - 'password' => 'swift', |
|
1290 | - 'domain' => [ |
|
1291 | - 'name' => 'default', |
|
1292 | - ], |
|
1293 | - ], |
|
1294 | - 'scope' => [ |
|
1295 | - 'project' => [ |
|
1296 | - 'name' => 'service', |
|
1297 | - 'domain' => [ |
|
1298 | - 'name' => 'default', |
|
1299 | - ], |
|
1300 | - ], |
|
1301 | - ], |
|
1302 | - 'tenantName' => 'service', |
|
1303 | - 'serviceName' => 'swift', |
|
1304 | - 'region' => 'regionOne', |
|
1305 | - 'url' => 'http://yourswifthost:5000/v3', |
|
1306 | - 'bucket' => 'nextcloud', |
|
1307 | - ], |
|
1284 | + 'class' => 'OC\\Files\\ObjectStore\\Swift', |
|
1285 | + 'arguments' => [ |
|
1286 | + 'autocreate' => true, |
|
1287 | + 'user' => [ |
|
1288 | + 'name' => 'swift', |
|
1289 | + 'password' => 'swift', |
|
1290 | + 'domain' => [ |
|
1291 | + 'name' => 'default', |
|
1292 | + ], |
|
1293 | + ], |
|
1294 | + 'scope' => [ |
|
1295 | + 'project' => [ |
|
1296 | + 'name' => 'service', |
|
1297 | + 'domain' => [ |
|
1298 | + 'name' => 'default', |
|
1299 | + ], |
|
1300 | + ], |
|
1301 | + ], |
|
1302 | + 'tenantName' => 'service', |
|
1303 | + 'serviceName' => 'swift', |
|
1304 | + 'region' => 'regionOne', |
|
1305 | + 'url' => 'http://yourswifthost:5000/v3', |
|
1306 | + 'bucket' => 'nextcloud', |
|
1307 | + ], |
|
1308 | 1308 | ], |
1309 | 1309 | |
1310 | 1310 | |
@@ -1344,8 +1344,8 @@ discard block |
||
1344 | 1344 | * encryption in MySQL or specify a custom wait timeout on a cheap hoster. |
1345 | 1345 | */ |
1346 | 1346 | 'dbdriveroptions' => array( |
1347 | - PDO::MYSQL_ATTR_SSL_CA => '/file/path/to/ca_cert.pem', |
|
1348 | - PDO::MYSQL_ATTR_INIT_COMMAND => 'SET wait_timeout = 28800' |
|
1347 | + PDO::MYSQL_ATTR_SSL_CA => '/file/path/to/ca_cert.pem', |
|
1348 | + PDO::MYSQL_ATTR_INIT_COMMAND => 'SET wait_timeout = 28800' |
|
1349 | 1349 | ), |
1350 | 1350 | |
1351 | 1351 | /** |
@@ -1402,10 +1402,10 @@ discard block |
||
1402 | 1402 | * - pgsql (PostgreSQL) |
1403 | 1403 | */ |
1404 | 1404 | 'supportedDatabases' => array( |
1405 | - 'sqlite', |
|
1406 | - 'mysql', |
|
1407 | - 'pgsql', |
|
1408 | - 'oci', |
|
1405 | + 'sqlite', |
|
1406 | + 'mysql', |
|
1407 | + 'pgsql', |
|
1408 | + 'oci', |
|
1409 | 1409 | ), |
1410 | 1410 | |
1411 | 1411 | /** |
@@ -1680,8 +1680,8 @@ discard block |
||
1680 | 1680 | * WARNING: only use this if you know what you are doing |
1681 | 1681 | */ |
1682 | 1682 | 'csrf.optout' => array( |
1683 | - '/^WebDAVFS/', // OS X Finder |
|
1684 | - '/^Microsoft-WebDAV-MiniRedir/', // Windows webdav drive |
|
1683 | + '/^WebDAVFS/', // OS X Finder |
|
1684 | + '/^Microsoft-WebDAV-MiniRedir/', // Windows webdav drive |
|
1685 | 1685 | ), |
1686 | 1686 | |
1687 | 1687 | /** |