@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function check() { |
57 | 57 | // Look up the cache - it is invalidated all 30 minutes |
58 | - if (((int)$this->config->getAppValue('core', 'lastupdatedat') + 1800) > time()) { |
|
58 | + if (((int) $this->config->getAppValue('core', 'lastupdatedat') + 1800) > time()) { |
|
59 | 59 | return json_decode($this->config->getAppValue('core', 'lastupdateResult'), true); |
60 | 60 | } |
61 | 61 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $versionString = implode('x', $version); |
80 | 80 | |
81 | 81 | //fetch xml data from updater |
82 | - $url = $updaterUrl . '?version=' . $versionString; |
|
82 | + $url = $updaterUrl.'?version='.$versionString; |
|
83 | 83 | |
84 | 84 | $tmp = []; |
85 | 85 | try { |
@@ -93,11 +93,11 @@ discard block |
||
93 | 93 | $data = @simplexml_load_string($xml); |
94 | 94 | libxml_disable_entity_loader($loadEntities); |
95 | 95 | if ($data !== false) { |
96 | - $tmp['version'] = (string)$data->version; |
|
97 | - $tmp['versionstring'] = (string)$data->versionstring; |
|
98 | - $tmp['url'] = (string)$data->url; |
|
99 | - $tmp['web'] = (string)$data->web; |
|
100 | - $tmp['autoupdater'] = (string)$data->autoupdater; |
|
96 | + $tmp['version'] = (string) $data->version; |
|
97 | + $tmp['versionstring'] = (string) $data->versionstring; |
|
98 | + $tmp['url'] = (string) $data->url; |
|
99 | + $tmp['web'] = (string) $data->web; |
|
100 | + $tmp['autoupdater'] = (string) $data->autoupdater; |
|
101 | 101 | } else { |
102 | 102 | libxml_clear_errors(); |
103 | 103 | } |
@@ -33,10 +33,10 @@ |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | public function setupDatabase($username) { |
36 | - $datadir = $this->config->getValue('datadirectory', \OC::$SERVERROOT . '/data'); |
|
36 | + $datadir = $this->config->getValue('datadirectory', \OC::$SERVERROOT.'/data'); |
|
37 | 37 | |
38 | 38 | //delete the old sqlite database first, might cause infinte loops otherwise |
39 | - if(file_exists("$datadir/owncloud.db")) { |
|
39 | + if (file_exists("$datadir/owncloud.db")) { |
|
40 | 40 | unlink("$datadir/owncloud.db"); |
41 | 41 | } |
42 | 42 | //in case of sqlite, we can always fill the database |
@@ -57,9 +57,9 @@ |
||
57 | 57 | * @return false |
58 | 58 | */ |
59 | 59 | function httpGet(RequestInterface $request, ResponseInterface $response) { |
60 | - $string = 'This is the WebDAV interface. It can only be accessed by ' . |
|
60 | + $string = 'This is the WebDAV interface. It can only be accessed by '. |
|
61 | 61 | 'WebDAV clients such as the Nextcloud desktop sync client.'; |
62 | - $stream = fopen('php://memory','r+'); |
|
62 | + $stream = fopen('php://memory', 'r+'); |
|
63 | 63 | fwrite($stream, $string); |
64 | 64 | rewind($stream); |
65 | 65 |
@@ -10,12 +10,12 @@ discard block |
||
10 | 10 | <input type='hidden' id='hasOracle' value='<?php p($_['hasOracle']) ?>'> |
11 | 11 | <form action="index.php" method="post"> |
12 | 12 | <input type="hidden" name="install" value="true"> |
13 | - <?php if(count($_['errors']) > 0): ?> |
|
13 | + <?php if (count($_['errors']) > 0): ?> |
|
14 | 14 | <fieldset class="warning"> |
15 | - <legend><strong><?php p($l->t('Error'));?></strong></legend> |
|
16 | - <?php foreach($_['errors'] as $err): ?> |
|
15 | + <legend><strong><?php p($l->t('Error')); ?></strong></legend> |
|
16 | + <?php foreach ($_['errors'] as $err): ?> |
|
17 | 17 | <p> |
18 | - <?php if(is_array($err)):?> |
|
18 | + <?php if (is_array($err)):?> |
|
19 | 19 | <?php print_unescaped($err['error']); ?> |
20 | 20 | <span class='hint'><?php print_unescaped($err['hint']); ?></span> |
21 | 21 | <?php else: ?> |
@@ -25,10 +25,10 @@ discard block |
||
25 | 25 | <?php endforeach; ?> |
26 | 26 | </fieldset> |
27 | 27 | <?php endif; ?> |
28 | - <?php if(!$_['htaccessWorking']): ?> |
|
28 | + <?php if (!$_['htaccessWorking']): ?> |
|
29 | 29 | <fieldset class="warning"> |
30 | - <legend><strong><?php p($l->t('Security warning'));?></strong></legend> |
|
31 | - <p><?php p($l->t('Your data directory and files are probably accessible from the internet because the .htaccess file does not work.'));?><br> |
|
30 | + <legend><strong><?php p($l->t('Security warning')); ?></strong></legend> |
|
31 | + <p><?php p($l->t('Your data directory and files are probably accessible from the internet because the .htaccess file does not work.')); ?><br> |
|
32 | 32 | <?php print_unescaped($l->t( |
33 | 33 | 'For information how to properly configure your server, please see the <a href="%s" target="_blank" rel="noreferrer">documentation</a>.', |
34 | 34 | link_to_docs('admin-install') |
@@ -36,35 +36,35 @@ discard block |
||
36 | 36 | </fieldset> |
37 | 37 | <?php endif; ?> |
38 | 38 | <fieldset id="adminaccount"> |
39 | - <legend><?php print_unescaped($l->t( 'Create an <strong>admin account</strong>' )); ?></legend> |
|
39 | + <legend><?php print_unescaped($l->t('Create an <strong>admin account</strong>')); ?></legend> |
|
40 | 40 | <p class="grouptop"> |
41 | 41 | <input type="text" name="adminlogin" id="adminlogin" |
42 | - placeholder="<?php p($l->t( 'Username' )); ?>" |
|
42 | + placeholder="<?php p($l->t('Username')); ?>" |
|
43 | 43 | value="<?php p($_['adminlogin']); ?>" |
44 | 44 | autocomplete="off" autocapitalize="none" autocorrect="off" autofocus required> |
45 | - <label for="adminlogin" class="infield"><?php p($l->t( 'Username' )); ?></label> |
|
45 | + <label for="adminlogin" class="infield"><?php p($l->t('Username')); ?></label> |
|
46 | 46 | </p> |
47 | 47 | <p class="groupbottom"> |
48 | 48 | <input type="password" name="adminpass" data-typetoggle="#show" id="adminpass" |
49 | - placeholder="<?php p($l->t( 'Password' )); ?>" |
|
49 | + placeholder="<?php p($l->t('Password')); ?>" |
|
50 | 50 | value="<?php p($_['adminpass']); ?>" |
51 | 51 | autocomplete="off" autocapitalize="none" autocorrect="off" required> |
52 | - <label for="adminpass" class="infield"><?php p($l->t( 'Password' )); ?></label> |
|
52 | + <label for="adminpass" class="infield"><?php p($l->t('Password')); ?></label> |
|
53 | 53 | <input type="checkbox" id="show" name="show"> |
54 | 54 | <label for="show"></label> |
55 | 55 | </p> |
56 | 56 | </fieldset> |
57 | 57 | |
58 | - <?php if(!$_['directoryIsSet'] OR !$_['dbIsSet'] OR count($_['errors']) > 0): ?> |
|
58 | + <?php if (!$_['directoryIsSet'] OR !$_['dbIsSet'] OR count($_['errors']) > 0): ?> |
|
59 | 59 | <fieldset id="advancedHeader"> |
60 | - <legend><a id="showAdvanced"><?php p($l->t( 'Storage & database' )); ?> <img src="<?php print_unescaped(image_path('', 'actions/caret.svg')); ?>" /></a></legend> |
|
60 | + <legend><a id="showAdvanced"><?php p($l->t('Storage & database')); ?> <img src="<?php print_unescaped(image_path('', 'actions/caret.svg')); ?>" /></a></legend> |
|
61 | 61 | </fieldset> |
62 | 62 | <?php endif; ?> |
63 | 63 | |
64 | - <?php if(!$_['directoryIsSet'] OR count($_['errors']) > 0): ?> |
|
64 | + <?php if (!$_['directoryIsSet'] OR count($_['errors']) > 0): ?> |
|
65 | 65 | <fieldset id="datadirField"> |
66 | 66 | <div id="datadirContent"> |
67 | - <label for="directory"><?php p($l->t( 'Data folder' )); ?></label> |
|
67 | + <label for="directory"><?php p($l->t('Data folder')); ?></label> |
|
68 | 68 | <input type="text" name="directory" id="directory" |
69 | 69 | placeholder="<?php p(OC::$SERVERROOT.'/data'); ?>" |
70 | 70 | value="<?php p($_['directory']); ?>" |
@@ -73,19 +73,19 @@ discard block |
||
73 | 73 | </fieldset> |
74 | 74 | <?php endif; ?> |
75 | 75 | |
76 | - <?php if(!$_['dbIsSet'] OR count($_['errors']) > 0): ?> |
|
76 | + <?php if (!$_['dbIsSet'] OR count($_['errors']) > 0): ?> |
|
77 | 77 | <fieldset id='databaseBackend'> |
78 | - <?php if($_['hasMySQL'] or $_['hasPostgreSQL'] or $_['hasOracle']) |
|
79 | - $hasOtherDB = true; else $hasOtherDB =false; //other than SQLite ?> |
|
80 | - <legend><?php p($l->t( 'Configure the database' )); ?></legend> |
|
78 | + <?php if ($_['hasMySQL'] or $_['hasPostgreSQL'] or $_['hasOracle']) |
|
79 | + $hasOtherDB = true; else $hasOtherDB = false; //other than SQLite ?> |
|
80 | + <legend><?php p($l->t('Configure the database')); ?></legend> |
|
81 | 81 | <div id="selectDbType"> |
82 | - <?php foreach($_['databases'] as $type => $label): ?> |
|
83 | - <?php if(count($_['databases']) === 1): ?> |
|
82 | + <?php foreach ($_['databases'] as $type => $label): ?> |
|
83 | + <?php if (count($_['databases']) === 1): ?> |
|
84 | 84 | <p class="info"> |
85 | - <?php p($l->t( 'Only %s is available.', array($label) )); ?> |
|
86 | - <?php p($l->t( 'Install and activate additional PHP modules to choose other database types.' )); ?><br> |
|
85 | + <?php p($l->t('Only %s is available.', array($label))); ?> |
|
86 | + <?php p($l->t('Install and activate additional PHP modules to choose other database types.')); ?><br> |
|
87 | 87 | <a href="<?php print_unescaped(link_to_docs('admin-source_install')); ?>" target="_blank" rel="noreferrer"> |
88 | - <?php p($l->t( 'For more details check out the documentation.' )); ?> ↗</a> |
|
88 | + <?php p($l->t('For more details check out the documentation.')); ?> ↗</a> |
|
89 | 89 | </p> |
90 | 90 | <input type="hidden" id="dbtype" name="dbtype" value="<?php p($type) ?>"> |
91 | 91 | <?php else: ?> |
@@ -97,75 +97,75 @@ discard block |
||
97 | 97 | </div> |
98 | 98 | </fieldset> |
99 | 99 | |
100 | - <?php if($hasOtherDB): ?> |
|
100 | + <?php if ($hasOtherDB): ?> |
|
101 | 101 | <fieldset id='databaseField'> |
102 | 102 | <div id="use_other_db"> |
103 | 103 | <p class="grouptop"> |
104 | - <label for="dbuser" class="infield"><?php p($l->t( 'Database user' )); ?></label> |
|
104 | + <label for="dbuser" class="infield"><?php p($l->t('Database user')); ?></label> |
|
105 | 105 | <input type="text" name="dbuser" id="dbuser" |
106 | - placeholder="<?php p($l->t( 'Database user' )); ?>" |
|
106 | + placeholder="<?php p($l->t('Database user')); ?>" |
|
107 | 107 | value="<?php p($_['dbuser']); ?>" |
108 | 108 | autocomplete="off" autocapitalize="none" autocorrect="off"> |
109 | 109 | </p> |
110 | 110 | <p class="groupmiddle"> |
111 | 111 | <input type="password" name="dbpass" id="dbpass" data-typetoggle="#dbpassword-toggle" |
112 | - placeholder="<?php p($l->t( 'Database password' )); ?>" |
|
112 | + placeholder="<?php p($l->t('Database password')); ?>" |
|
113 | 113 | value="<?php p($_['dbpass']); ?>" |
114 | 114 | autocomplete="off" autocapitalize="none" autocorrect="off"> |
115 | - <label for="dbpass" class="infield"><?php p($l->t( 'Database password' )); ?></label> |
|
115 | + <label for="dbpass" class="infield"><?php p($l->t('Database password')); ?></label> |
|
116 | 116 | <input type="checkbox" id="dbpassword-toggle" name="dbpassword-toggle"> |
117 | 117 | <label for="dbpassword-toggle"></label> |
118 | 118 | </p> |
119 | 119 | <p class="groupmiddle"> |
120 | - <label for="dbname" class="infield"><?php p($l->t( 'Database name' )); ?></label> |
|
120 | + <label for="dbname" class="infield"><?php p($l->t('Database name')); ?></label> |
|
121 | 121 | <input type="text" name="dbname" id="dbname" |
122 | - placeholder="<?php p($l->t( 'Database name' )); ?>" |
|
122 | + placeholder="<?php p($l->t('Database name')); ?>" |
|
123 | 123 | value="<?php p($_['dbname']); ?>" |
124 | 124 | autocomplete="off" autocapitalize="none" autocorrect="off" |
125 | 125 | pattern="[0-9a-zA-Z$_-]+"> |
126 | 126 | </p> |
127 | - <?php if($_['hasOracle']): ?> |
|
127 | + <?php if ($_['hasOracle']): ?> |
|
128 | 128 | <div id="use_oracle_db"> |
129 | 129 | <p class="groupmiddle"> |
130 | - <label for="dbtablespace" class="infield"><?php p($l->t( 'Database tablespace' )); ?></label> |
|
130 | + <label for="dbtablespace" class="infield"><?php p($l->t('Database tablespace')); ?></label> |
|
131 | 131 | <input type="text" name="dbtablespace" id="dbtablespace" |
132 | - placeholder="<?php p($l->t( 'Database tablespace' )); ?>" |
|
132 | + placeholder="<?php p($l->t('Database tablespace')); ?>" |
|
133 | 133 | value="<?php p($_['dbtablespace']); ?>" |
134 | 134 | autocomplete="off" autocapitalize="none" autocorrect="off"> |
135 | 135 | </p> |
136 | 136 | </div> |
137 | 137 | <?php endif; ?> |
138 | 138 | <p class="groupbottom"> |
139 | - <label for="dbhost" class="infield"><?php p($l->t( 'Database host' )); ?></label> |
|
139 | + <label for="dbhost" class="infield"><?php p($l->t('Database host')); ?></label> |
|
140 | 140 | <input type="text" name="dbhost" id="dbhost" |
141 | - placeholder="<?php p($l->t( 'Database host' )); ?>" |
|
141 | + placeholder="<?php p($l->t('Database host')); ?>" |
|
142 | 142 | value="<?php p($_['dbhost']); ?>" |
143 | 143 | autocomplete="off" autocapitalize="none" autocorrect="off"> |
144 | 144 | </p> |
145 | 145 | <p class="info"> |
146 | - <?php p($l->t( 'Please specify the port number along with the host name (e.g., localhost:5432).' )); ?> |
|
146 | + <?php p($l->t('Please specify the port number along with the host name (e.g., localhost:5432).')); ?> |
|
147 | 147 | </p> |
148 | 148 | </div> |
149 | 149 | </fieldset> |
150 | 150 | <?php endif; ?> |
151 | 151 | <?php endif; ?> |
152 | 152 | |
153 | - <?php if(!$_['dbIsSet'] OR count($_['errors']) > 0): ?> |
|
153 | + <?php if (!$_['dbIsSet'] OR count($_['errors']) > 0): ?> |
|
154 | 154 | <fieldset id="sqliteInformation" class="warning"> |
155 | - <legend><?php p($l->t('Performance warning'));?></legend> |
|
156 | - <p><?php p($l->t('SQLite will be used as database.'));?></p> |
|
157 | - <p><?php p($l->t('For larger installations we recommend to choose a different database backend.'));?></p> |
|
155 | + <legend><?php p($l->t('Performance warning')); ?></legend> |
|
156 | + <p><?php p($l->t('SQLite will be used as database.')); ?></p> |
|
157 | + <p><?php p($l->t('For larger installations we recommend to choose a different database backend.')); ?></p> |
|
158 | 158 | <p><?php p($l->t('Especially when using the desktop client for file syncing the use of SQLite is discouraged.')); ?></p> |
159 | 159 | </fieldset> |
160 | 160 | <?php endif ?> |
161 | 161 | |
162 | 162 | <div class="icon-loading-dark float-spinner"> </div> |
163 | 163 | |
164 | - <div class="buttons"><input type="submit" class="primary" value="<?php p($l->t( 'Finish setup' )); ?>" data-finishing="<?php p($l->t( 'Finishing …' )); ?>"></div> |
|
164 | + <div class="buttons"><input type="submit" class="primary" value="<?php p($l->t('Finish setup')); ?>" data-finishing="<?php p($l->t('Finishing …')); ?>"></div> |
|
165 | 165 | |
166 | 166 | <p class="info"> |
167 | 167 | <span class="icon-info-white"></span> |
168 | - <?php p($l->t('Need help?'));?> |
|
169 | - <a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-install')); ?>"><?php p($l->t('See the documentation'));?> ↗</a> |
|
168 | + <?php p($l->t('Need help?')); ?> |
|
169 | + <a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-install')); ?>"><?php p($l->t('See the documentation')); ?> ↗</a> |
|
170 | 170 | </p> |
171 | 171 | </form> |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | public function getPreview(File $file, $width = -1, $height = -1, $crop = false, $mode = IPreview::MODE_FILL, $mimeType = null) { |
89 | 89 | $this->eventDispatcher->dispatch( |
90 | 90 | IPreview::EVENT, |
91 | - new GenericEvent($file,[ |
|
91 | + new GenericEvent($file, [ |
|
92 | 92 | 'width' => $width, |
93 | 93 | 'height' => $height, |
94 | 94 | 'crop' => $crop, |
@@ -155,8 +155,8 @@ discard block |
||
155 | 155 | continue; |
156 | 156 | } |
157 | 157 | |
158 | - $maxWidth = (int)$this->config->getSystemValue('preview_max_x', 2048); |
|
159 | - $maxHeight = (int)$this->config->getSystemValue('preview_max_y', 2048); |
|
158 | + $maxWidth = (int) $this->config->getSystemValue('preview_max_x', 2048); |
|
159 | + $maxHeight = (int) $this->config->getSystemValue('preview_max_y', 2048); |
|
160 | 160 | |
161 | 161 | $preview = $this->helper->getThumbnail($provider, $file, $maxWidth, $maxHeight); |
162 | 162 | |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | continue; |
165 | 165 | } |
166 | 166 | |
167 | - $path = (string)$preview->width() . '-' . (string)$preview->height() . '-max.png'; |
|
167 | + $path = (string) $preview->width().'-'.(string) $preview->height().'-max.png'; |
|
168 | 168 | try { |
169 | 169 | $file = $previewFolder->newFile($path); |
170 | 170 | $file->putContent($preview->data()); |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | */ |
186 | 186 | private function getPreviewSize(ISimpleFile $file) { |
187 | 187 | $size = explode('-', $file->getName()); |
188 | - return [(int)$size[0], (int)$size[1]]; |
|
188 | + return [(int) $size[0], (int) $size[1]]; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | /** |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * @return string |
196 | 196 | */ |
197 | 197 | private function generatePath($width, $height, $crop) { |
198 | - $path = (string)$width . '-' . (string)$height; |
|
198 | + $path = (string) $width.'-'.(string) $height; |
|
199 | 199 | if ($crop) { |
200 | 200 | $path .= '-crop'; |
201 | 201 | } |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | $height /= $ratio; |
287 | 287 | } |
288 | 288 | |
289 | - return [(int)round($width), (int)round($height)]; |
|
289 | + return [(int) round($width), (int) round($height)]; |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | /** |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $tables = $this->getAllNonUTF8BinTables($this->connection); |
77 | 77 | foreach ($tables as $table) { |
78 | 78 | $output->info("Change row format for $table ..."); |
79 | - $query = $this->connection->prepare('ALTER TABLE `' . $table . '` ROW_FORMAT = DYNAMIC;'); |
|
79 | + $query = $this->connection->prepare('ALTER TABLE `'.$table.'` ROW_FORMAT = DYNAMIC;'); |
|
80 | 80 | try { |
81 | 81 | $query->execute(); |
82 | 82 | } catch (DriverException $e) { |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | $output->info("Change collation for $table ..."); |
91 | 91 | if ($characterSet === 'utf8mb4') { |
92 | 92 | // need to set row compression first |
93 | - $query = $this->connection->prepare('ALTER TABLE `' . $table . '` ROW_FORMAT=COMPRESSED;'); |
|
93 | + $query = $this->connection->prepare('ALTER TABLE `'.$table.'` ROW_FORMAT=COMPRESSED;'); |
|
94 | 94 | $query->execute(); |
95 | 95 | } |
96 | - $query = $this->connection->prepare('ALTER TABLE `' . $table . '` CONVERT TO CHARACTER SET ' . $characterSet . ' COLLATE ' . $characterSet . '_bin;'); |
|
96 | + $query = $this->connection->prepare('ALTER TABLE `'.$table.'` CONVERT TO CHARACTER SET '.$characterSet.' COLLATE '.$characterSet.'_bin;'); |
|
97 | 97 | try { |
98 | 98 | $query->execute(); |
99 | 99 | } catch (DriverException $e) { |
@@ -119,10 +119,10 @@ discard block |
||
119 | 119 | |
120 | 120 | // fetch tables by columns |
121 | 121 | $statement = $connection->executeQuery( |
122 | - "SELECT DISTINCT(TABLE_NAME) AS `table`" . |
|
123 | - " FROM INFORMATION_SCHEMA . COLUMNS" . |
|
124 | - " WHERE TABLE_SCHEMA = ?" . |
|
125 | - " AND (COLLATION_NAME <> '" . $characterSet . "_bin' OR CHARACTER_SET_NAME <> '" . $characterSet . "')" . |
|
122 | + "SELECT DISTINCT(TABLE_NAME) AS `table`". |
|
123 | + " FROM INFORMATION_SCHEMA . COLUMNS". |
|
124 | + " WHERE TABLE_SCHEMA = ?". |
|
125 | + " AND (COLLATION_NAME <> '".$characterSet."_bin' OR CHARACTER_SET_NAME <> '".$characterSet."')". |
|
126 | 126 | " AND TABLE_NAME LIKE \"*PREFIX*%\"", |
127 | 127 | array($dbName) |
128 | 128 | ); |
@@ -134,10 +134,10 @@ discard block |
||
134 | 134 | |
135 | 135 | // fetch tables by collation |
136 | 136 | $statement = $connection->executeQuery( |
137 | - "SELECT DISTINCT(TABLE_NAME) AS `table`" . |
|
138 | - " FROM INFORMATION_SCHEMA . TABLES" . |
|
139 | - " WHERE TABLE_SCHEMA = ?" . |
|
140 | - " AND TABLE_COLLATION <> '" . $characterSet . "_bin'" . |
|
137 | + "SELECT DISTINCT(TABLE_NAME) AS `table`". |
|
138 | + " FROM INFORMATION_SCHEMA . TABLES". |
|
139 | + " WHERE TABLE_SCHEMA = ?". |
|
140 | + " AND TABLE_COLLATION <> '".$characterSet."_bin'". |
|
141 | 141 | " AND TABLE_NAME LIKE \"*PREFIX*%\"", |
142 | 142 | [$dbName] |
143 | 143 | ); |
@@ -253,10 +253,10 @@ discard block |
||
253 | 253 | */ |
254 | 254 | public function invalidateOldTokens() { |
255 | 255 | $olderThan = $this->time->getTime() - (int) $this->config->getSystemValue('session_lifetime', 60 * 60 * 24); |
256 | - $this->logger->debug('Invalidating session tokens older than ' . date('c', $olderThan), ['app' => 'cron']); |
|
256 | + $this->logger->debug('Invalidating session tokens older than '.date('c', $olderThan), ['app' => 'cron']); |
|
257 | 257 | $this->mapper->invalidateOld($olderThan, IToken::DO_NOT_REMEMBER); |
258 | 258 | $rememberThreshold = $this->time->getTime() - (int) $this->config->getSystemValue('remember_login_cookie_lifetime', 60 * 60 * 24 * 15); |
259 | - $this->logger->debug('Invalidating remembered session tokens older than ' . date('c', $rememberThreshold), ['app' => 'cron']); |
|
259 | + $this->logger->debug('Invalidating remembered session tokens older than '.date('c', $rememberThreshold), ['app' => 'cron']); |
|
260 | 260 | $this->mapper->invalidateOld($rememberThreshold, IToken::REMEMBER); |
261 | 261 | } |
262 | 262 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | */ |
267 | 267 | private function hashToken($token) { |
268 | 268 | $secret = $this->config->getSystemValue('secret'); |
269 | - return hash('sha512', $token . $secret); |
|
269 | + return hash('sha512', $token.$secret); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | /** |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | */ |
281 | 281 | private function encryptPassword($password, $token) { |
282 | 282 | $secret = $this->config->getSystemValue('secret'); |
283 | - return $this->crypto->encrypt($password, $token . $secret); |
|
283 | + return $this->crypto->encrypt($password, $token.$secret); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | /** |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | private function decryptPassword($password, $token) { |
297 | 297 | $secret = $this->config->getSystemValue('secret'); |
298 | 298 | try { |
299 | - return $this->crypto->decrypt($password, $token . $secret); |
|
299 | + return $this->crypto->decrypt($password, $token.$secret); |
|
300 | 300 | } catch (Exception $ex) { |
301 | 301 | // Delete the invalid token |
302 | 302 | $this->invalidateToken($token); |
@@ -106,11 +106,11 @@ discard block |
||
106 | 106 | $values = $this->appConfig->getValues(false, 'enabled'); |
107 | 107 | |
108 | 108 | $alwaysEnabledApps = $this->getAlwaysEnabledApps(); |
109 | - foreach($alwaysEnabledApps as $appId) { |
|
109 | + foreach ($alwaysEnabledApps as $appId) { |
|
110 | 110 | $values[$appId] = 'yes'; |
111 | 111 | } |
112 | 112 | |
113 | - $this->installedAppsCache = array_filter($values, function ($value) { |
|
113 | + $this->installedAppsCache = array_filter($values, function($value) { |
|
114 | 114 | return $value !== 'no'; |
115 | 115 | }); |
116 | 116 | ksort($this->installedAppsCache); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function getEnabledAppsForUser(IUser $user) { |
137 | 137 | $apps = $this->getInstalledAppsValues(); |
138 | - $appsForUser = array_filter($apps, function ($enabled) use ($user) { |
|
138 | + $appsForUser = array_filter($apps, function($enabled) use ($user) { |
|
139 | 139 | return $this->checkAppForUser($enabled, $user); |
140 | 140 | }); |
141 | 141 | return array_keys($appsForUser); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } elseif ($user === null) { |
175 | 175 | return false; |
176 | 176 | } else { |
177 | - if(empty($enabled)){ |
|
177 | + if (empty($enabled)) { |
|
178 | 178 | return false; |
179 | 179 | } |
180 | 180 | |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | if (!is_array($groupIds)) { |
184 | 184 | $jsonError = json_last_error(); |
185 | - \OC::$server->getLogger()->warning('AppManger::checkAppForUser - can\'t decode group IDs: ' . print_r($enabled, true) . ' - json error code: ' . $jsonError, ['app' => 'lib']); |
|
185 | + \OC::$server->getLogger()->warning('AppManger::checkAppForUser - can\'t decode group IDs: '.print_r($enabled, true).' - json error code: '.$jsonError, ['app' => 'lib']); |
|
186 | 186 | return false; |
187 | 187 | } |
188 | 188 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | } |
257 | 257 | } |
258 | 258 | |
259 | - $groupIds = array_map(function ($group) { |
|
259 | + $groupIds = array_map(function($group) { |
|
260 | 260 | /** @var \OCP\IGroup $group */ |
261 | 261 | return $group->getGID(); |
262 | 262 | }, $groups); |
@@ -295,8 +295,8 @@ discard block |
||
295 | 295 | */ |
296 | 296 | public function getAppPath($appId) { |
297 | 297 | $appPath = \OC_App::getAppPath($appId); |
298 | - if($appPath === false) { |
|
299 | - throw new AppPathNotFoundException('Could not find path for ' . $appId); |
|
298 | + if ($appPath === false) { |
|
299 | + throw new AppPathNotFoundException('Could not find path for '.$appId); |
|
300 | 300 | } |
301 | 301 | return $appPath; |
302 | 302 | } |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | |
390 | 390 | private function loadShippedJson() { |
391 | 391 | if ($this->shippedApps === null) { |
392 | - $shippedJson = \OC::$SERVERROOT . '/core/shipped.json'; |
|
392 | + $shippedJson = \OC::$SERVERROOT.'/core/shipped.json'; |
|
393 | 393 | if (!file_exists($shippedJson)) { |
394 | 394 | throw new \Exception("File not found: $shippedJson"); |
395 | 395 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $shares = array_merge($shares, $this->shareManager->getSharedWith($user->getUID(), \OCP\Share::SHARE_TYPE_CIRCLE, null, -1)); |
75 | 75 | |
76 | 76 | // filter out excluded shares and group shares that includes self |
77 | - $shares = array_filter($shares, function (\OCP\Share\IShare $share) use ($user) { |
|
77 | + $shares = array_filter($shares, function(\OCP\Share\IShare $share) use ($user) { |
|
78 | 78 | return $share->getPermissions() > 0 && $share->getShareOwner() !== $user->getUID(); |
79 | 79 | }); |
80 | 80 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | // null groups which usually appear with group backend |
187 | 187 | // caching inconsistencies |
188 | 188 | $this->logger->debug( |
189 | - 'Could not adjust share target for share ' . $share->getId() . ' to make it consistent: ' . $e->getMessage(), |
|
189 | + 'Could not adjust share target for share '.$share->getId().' to make it consistent: '.$e->getMessage(), |
|
190 | 190 | ['app' => 'files_sharing'] |
191 | 191 | ); |
192 | 192 | } |