@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | protected function renderScript($appName, $scriptName) { |
110 | 110 | $content = ''; |
111 | 111 | $appPath = \OC_App::getAppPath($appName); |
112 | - $scriptPath = $appPath . '/' . $scriptName; |
|
112 | + $scriptPath = $appPath.'/'.$scriptName; |
|
113 | 113 | if (file_exists($scriptPath)) { |
114 | 114 | // TODO: sanitize path / script name ? |
115 | 115 | ob_start(); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | $this->eventDispatcher->dispatch('OCA\Files::loadAdditionalScripts'); |
227 | 227 | |
228 | 228 | $params = []; |
229 | - $params['usedSpacePercent'] = (int)$storageInfo['relative']; |
|
229 | + $params['usedSpacePercent'] = (int) $storageInfo['relative']; |
|
230 | 230 | $params['owner'] = $storageInfo['owner']; |
231 | 231 | $params['ownerDisplayName'] = $storageInfo['ownerDisplayName']; |
232 | 232 | $params['isPublic'] = false; |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | $params = []; |
267 | 267 | |
268 | 268 | if (empty($files) && $this->appManager->isEnabledForUser('files_trashbin')) { |
269 | - $baseFolder = $this->rootFolder->get($uid . '/files_trashbin/files/'); |
|
269 | + $baseFolder = $this->rootFolder->get($uid.'/files_trashbin/files/'); |
|
270 | 270 | $files = $baseFolder->getById($fileId); |
271 | 271 | $params['view'] = 'trashbin'; |
272 | 272 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | * @return DataResponse|FileDisplayResponse |
107 | 107 | */ |
108 | 108 | public function getThumbnail($x, $y, $file) { |
109 | - if($x < 1 || $y < 1) { |
|
109 | + if ($x < 1 || $y < 1) { |
|
110 | 110 | return new DataResponse(['message' => 'Requested size must be numeric and a positive value.'], Http::STATUS_BAD_REQUEST); |
111 | 111 | } |
112 | 112 | |
@@ -167,13 +167,13 @@ discard block |
||
167 | 167 | * @return array |
168 | 168 | */ |
169 | 169 | private function formatNodes(array $nodes) { |
170 | - return array_values(array_map(function (Node $node) { |
|
170 | + return array_values(array_map(function(Node $node) { |
|
171 | 171 | /** @var \OC\Files\Node\Node $shareTypes */ |
172 | 172 | $shareTypes = $this->getShareTypes($node); |
173 | 173 | $file = \OCA\Files\Helper::formatFileInfo($node->getFileInfo()); |
174 | 174 | $parts = explode('/', dirname($node->getPath()), 4); |
175 | 175 | if (isset($parts[3])) { |
176 | - $file['path'] = '/' . $parts[3]; |
|
176 | + $file['path'] = '/'.$parts[3]; |
|
177 | 177 | } else { |
178 | 178 | $file['path'] = '/'; |
179 | 179 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | use OCA\Files\Controller\ViewController; |
32 | 32 | |
33 | 33 | class Application extends App { |
34 | - public function __construct(array $urlParams=array()) { |
|
34 | + public function __construct(array $urlParams = array()) { |
|
35 | 35 | parent::__construct('files', $urlParams); |
36 | 36 | $container = $this->getContainer(); |
37 | 37 | $server = $container->getServer(); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | /** |
40 | 40 | * Controllers |
41 | 41 | */ |
42 | - $container->registerService('APIController', function (IContainer $c) use ($server) { |
|
42 | + $container->registerService('APIController', function(IContainer $c) use ($server) { |
|
43 | 43 | return new ApiController( |
44 | 44 | $c->query('AppName'), |
45 | 45 | $c->query('Request'), |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | ); |
53 | 53 | }); |
54 | 54 | |
55 | - $container->registerService('ViewController', function (IContainer $c) use ($server) { |
|
55 | + $container->registerService('ViewController', function(IContainer $c) use ($server) { |
|
56 | 56 | return new ViewController( |
57 | 57 | $c->query('AppName'), |
58 | 58 | $c->query('Request'), |
@@ -76,10 +76,10 @@ discard block |
||
76 | 76 | /** |
77 | 77 | * Services |
78 | 78 | */ |
79 | - $container->registerService('Tagger', function(IContainer $c) { |
|
79 | + $container->registerService('Tagger', function(IContainer $c) { |
|
80 | 80 | return $c->query('ServerContainer')->getTagManager()->load('files'); |
81 | 81 | }); |
82 | - $container->registerService('TagService', function(IContainer $c) { |
|
82 | + $container->registerService('TagService', function(IContainer $c) { |
|
83 | 83 | $homeFolder = $c->query('ServerContainer')->getUserFolder(); |
84 | 84 | return new TagService( |
85 | 85 | $c->query('ServerContainer')->getUserSession(), |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | 'uploadMaxFilesize' => $maxUploadFileSize, |
55 | 55 | 'maxHumanFilesize' => $maxHumanFileSize, |
56 | 56 | 'freeSpace' => $storageInfo['free'], |
57 | - 'usedSpacePercent' => (int)$storageInfo['relative'], |
|
57 | + 'usedSpacePercent' => (int) $storageInfo['relative'], |
|
58 | 58 | 'owner' => $storageInfo['owner'], |
59 | 59 | 'ownerDisplayName' => $storageInfo['ownerDisplayName'], |
60 | 60 | ]; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * @return string icon URL |
68 | 68 | */ |
69 | 69 | public static function determineIcon($file) { |
70 | - if($file['type'] === 'dir') { |
|
70 | + if ($file['type'] === 'dir') { |
|
71 | 71 | $icon = \OC::$server->getMimeTypeDetector()->mimeTypeIcon('dir'); |
72 | 72 | // TODO: move this part to the client side, using mountType |
73 | 73 | if ($file->isShared()) { |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | } elseif ($file->isMounted()) { |
76 | 76 | $icon = \OC::$server->getMimeTypeDetector()->mimeTypeIcon('dir-external'); |
77 | 77 | } |
78 | - }else{ |
|
78 | + } else { |
|
79 | 79 | $icon = \OC::$server->getMimeTypeDetector()->mimeTypeIcon($file->getMimetype()); |
80 | 80 | } |
81 | 81 | |
82 | - return substr($icon, 0, -3) . 'svg'; |
|
82 | + return substr($icon, 0, -3).'svg'; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -51,7 +51,7 @@ |
||
51 | 51 | */ |
52 | 52 | public function run($argument) { |
53 | 53 | $lockingProvider = \OC::$server->getLockingProvider(); |
54 | - if($lockingProvider instanceof DBLockingProvider) { |
|
54 | + if ($lockingProvider instanceof DBLockingProvider) { |
|
55 | 55 | $lockingProvider->cleanExpiredLocks(); |
56 | 56 | } |
57 | 57 | } |
@@ -80,12 +80,12 @@ |
||
80 | 80 | $deletedEntries = 0; |
81 | 81 | |
82 | 82 | $query = $this->connection->getQueryBuilder(); |
83 | - $query->select('t1.' . $idCol) |
|
83 | + $query->select('t1.'.$idCol) |
|
84 | 84 | ->from($table, 't1') |
85 | 85 | ->where($query->expr()->eq($typeCol, $query->expr()->literal('files'))) |
86 | 86 | ->andWhere($query->expr()->isNull('t2.fileid')) |
87 | - ->leftJoin('t1', 'filecache', 't2', $query->expr()->eq($query->expr()->castColumn('t1.' . $idCol, IQueryBuilder::PARAM_INT), 't2.fileid')) |
|
88 | - ->groupBy('t1.' . $idCol) |
|
87 | + ->leftJoin('t1', 'filecache', 't2', $query->expr()->eq($query->expr()->castColumn('t1.'.$idCol, IQueryBuilder::PARAM_INT), 't2.fileid')) |
|
88 | + ->groupBy('t1.'.$idCol) |
|
89 | 89 | ->setMaxResults(self::CHUNK_SIZE); |
90 | 90 | |
91 | 91 | $deleteQuery = $this->connection->getQueryBuilder(); |
@@ -55,7 +55,7 @@ |
||
55 | 55 | $maxUploadFilesize = Util::humanFileSize(min($upload_max_filesize, $post_max_size)); |
56 | 56 | |
57 | 57 | $parameters = [ |
58 | - 'uploadChangable' => (($htaccessWorking and $htaccessWritable) or $userIniWritable ), |
|
58 | + 'uploadChangable' => (($htaccessWorking and $htaccessWritable) or $userIniWritable), |
|
59 | 59 | 'uploadMaxFilesize' => $maxUploadFilesize, |
60 | 60 | // max possible makes only sense on a 32 bit system |
61 | 61 | 'displayMaxPossibleUploadSize' => PHP_INT_SIZE === 4, |
@@ -29,15 +29,15 @@ discard block |
||
29 | 29 | |
30 | 30 | $filename = $_GET["file"]; |
31 | 31 | |
32 | -if(!\OC\Files\Filesystem::file_exists($filename)) { |
|
32 | +if (!\OC\Files\Filesystem::file_exists($filename)) { |
|
33 | 33 | header("HTTP/1.0 404 Not Found"); |
34 | - $tmpl = new OCP\Template( '', '404', 'guest' ); |
|
34 | + $tmpl = new OCP\Template('', '404', 'guest'); |
|
35 | 35 | $tmpl->assign('file', $filename); |
36 | 36 | $tmpl->printPage(); |
37 | 37 | exit; |
38 | 38 | } |
39 | 39 | |
40 | -$ftype=\OC::$server->getMimeTypeDetector()->getSecureMimeType(\OC\Files\Filesystem::getMimeType( $filename )); |
|
40 | +$ftype = \OC::$server->getMimeTypeDetector()->getSecureMimeType(\OC\Files\Filesystem::getMimeType($filename)); |
|
41 | 41 | |
42 | 42 | header('Content-Type:'.$ftype); |
43 | 43 | OCP\Response::setContentDispositionHeader(basename($filename), 'attachment'); |
@@ -45,4 +45,4 @@ discard block |
||
45 | 45 | OCP\Response::setContentLengthHeader(\OC\Files\Filesystem::filesize($filename)); |
46 | 46 | |
47 | 47 | OC_Util::obEnd(); |
48 | -\OC\Files\Filesystem::readfile( $filename ); |
|
48 | +\OC\Files\Filesystem::readfile($filename); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $templateManager->registerTemplate('application/vnd.oasis.opendocument.text', 'core/templates/filetemplates/template.odt'); |
39 | 39 | $templateManager->registerTemplate('application/vnd.oasis.opendocument.spreadsheet', 'core/templates/filetemplates/template.ods'); |
40 | 40 | |
41 | -\OCA\Files\App::getNavigationManager()->add(function () use ($l) { |
|
41 | +\OCA\Files\App::getNavigationManager()->add(function() use ($l) { |
|
42 | 42 | return [ |
43 | 43 | 'id' => 'files', |
44 | 44 | 'appname' => 'files', |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | ]; |
49 | 49 | }); |
50 | 50 | |
51 | -\OCA\Files\App::getNavigationManager()->add(function () use ($l) { |
|
51 | +\OCA\Files\App::getNavigationManager()->add(function() use ($l) { |
|
52 | 52 | return [ |
53 | 53 | 'id' => 'recent', |
54 | 54 | 'appname' => 'files', |