diff options
Diffstat (limited to 'lib/files')
-rw-r--r-- | lib/files/cache/cache.php | 12 | ||||
-rw-r--r-- | lib/files/cache/permissions.php | 9 | ||||
-rw-r--r-- | lib/files/cache/upgrade.php | 3 | ||||
-rw-r--r-- | lib/files/filesystem.php | 7 | ||||
-rw-r--r-- | lib/files/storage/common.php | 3 | ||||
-rw-r--r-- | lib/files/storage/local.php | 4 | ||||
-rw-r--r-- | lib/files/storage/mappedlocal.php | 4 | ||||
-rw-r--r-- | lib/files/view.php | 16 |
8 files changed, 40 insertions, 18 deletions
diff --git a/lib/files/cache/cache.php b/lib/files/cache/cache.php index 38b35c69def..5feed37ae48 100644 --- a/lib/files/cache/cache.php +++ b/lib/files/cache/cache.php @@ -198,7 +198,8 @@ class Cache { $params[] = $this->numericId; $valuesPlaceholder = array_fill(0, count($queryParts), '?'); - $query = \OC_DB::prepare('INSERT INTO `*PREFIX*filecache`(' . implode(', ', $queryParts) . ') VALUES(' . implode(', ', $valuesPlaceholder) . ')'); + $query = \OC_DB::prepare('INSERT INTO `*PREFIX*filecache`(' . implode(', ', $queryParts) . ')' + .' VALUES(' . implode(', ', $valuesPlaceholder) . ')'); $query->execute($params); return (int)\OC_DB::insertid('*PREFIX*filecache'); @@ -215,7 +216,8 @@ class Cache { list($queryParts, $params) = $this->buildParts($data); $params[] = $id; - $query = \OC_DB::prepare('UPDATE `*PREFIX*filecache` SET ' . implode(' = ?, ', $queryParts) . '=? WHERE fileid = ?'); + $query = \OC_DB::prepare('UPDATE `*PREFIX*filecache` SET ' . implode(' = ?, ', $queryParts) . '=?' + .' WHERE fileid = ?'); $query->execute($params); } @@ -332,7 +334,8 @@ class Cache { $query->execute(array($targetPath, md5($targetPath), $child['fileid'])); } - $query = \OC_DB::prepare('UPDATE `*PREFIX*filecache` SET `path` = ?, `path_hash` = ?, `parent` =? WHERE `fileid` = ?'); + $query = \OC_DB::prepare('UPDATE `*PREFIX*filecache` SET `path` = ?, `path_hash` = ?, `parent` =?' + .' WHERE `fileid` = ?'); $query->execute(array($target, md5($target), $newParentId, $sourceId)); } @@ -492,7 +495,8 @@ class Cache { * @return string|bool the path of the folder or false when no folder matched */ public function getIncomplete() { - $query = \OC_DB::prepare('SELECT `path` FROM `*PREFIX*filecache` WHERE `storage` = ? AND `size` = -1 ORDER BY `fileid` DESC LIMIT 1'); + $query = \OC_DB::prepare('SELECT `path` FROM `*PREFIX*filecache`' + .' WHERE `storage` = ? AND `size` = -1 ORDER BY `fileid` DESC LIMIT 1'); $query->execute(array($this->numericId)); if ($row = $query->fetchRow()) { return $row['path']; diff --git a/lib/files/cache/permissions.php b/lib/files/cache/permissions.php index e24c05b10a3..e1735831b94 100644 --- a/lib/files/cache/permissions.php +++ b/lib/files/cache/permissions.php @@ -51,9 +51,11 @@ class Permissions { */ public function set($fileId, $user, $permissions) { if (self::get($fileId, $user) !== -1) { - $query = \OC_DB::prepare('UPDATE `*PREFIX*permissions` SET `permissions` = ? WHERE `user` = ? AND `fileid` = ?'); + $query = \OC_DB::prepare('UPDATE `*PREFIX*permissions` SET `permissions` = ?' + .' WHERE `user` = ? AND `fileid` = ?'); } else { - $query = \OC_DB::prepare('INSERT INTO `*PREFIX*permissions`(`permissions`, `user`, `fileid`) VALUES(?, ?,? )'); + $query = \OC_DB::prepare('INSERT INTO `*PREFIX*permissions`(`permissions`, `user`, `fileid`)' + .' VALUES(?, ?,? )'); } $query->execute(array($permissions, $user, $fileId)); } @@ -73,7 +75,8 @@ class Permissions { $params[] = $user; $inPart = implode(', ', array_fill(0, count($fileIds), '?')); - $query = \OC_DB::prepare('SELECT `fileid`, `permissions` FROM `*PREFIX*permissions` WHERE `fileid` IN (' . $inPart . ') AND `user` = ?'); + $query = \OC_DB::prepare('SELECT `fileid`, `permissions` FROM `*PREFIX*permissions`' + .' WHERE `fileid` IN (' . $inPart . ') AND `user` = ?'); $result = $query->execute($params); $filePermissions = array(); while ($row = $result->fetchRow()) { diff --git a/lib/files/cache/upgrade.php b/lib/files/cache/upgrade.php index eb8c7297c3e..1fe4c584686 100644 --- a/lib/files/cache/upgrade.php +++ b/lib/files/cache/upgrade.php @@ -69,7 +69,8 @@ class Upgrade { ( `fileid`, `storage`, `path`, `path_hash`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted` ) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); - $insertQuery->execute(array($data['id'], $data['storage'], $data['path'], $data['path_hash'], $data['parent'], $data['name'], + $insertQuery->execute(array($data['id'], $data['storage'], + $data['path'], $data['path_hash'], $data['parent'], $data['name'], $data['mimetype'], $data['mimepart'], $data['size'], $data['mtime'], $data['encrypted'])); } } diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php index a0c3c4b9b75..f4530868077 100644 --- a/lib/files/filesystem.php +++ b/lib/files/filesystem.php @@ -135,7 +135,9 @@ class Filesystem { /** * get the mountpoint of the storage object for a path - ( note: because a storage is not always mounted inside the fakeroot, the returned mountpoint is relative to the absolute root of the filesystem and doesn't take the chroot into account + * ( note: because a storage is not always mounted inside the fakeroot, the + * returned mountpoint is relative to the absolute root of the filesystem + * and doesn't take the chroot into account ) * * @param string $path * @return string @@ -318,7 +320,8 @@ class Filesystem { /** * return the path to a local version of the file - * we need this because we can't know if a file is stored local or not from outside the filestorage and for some purposes a local file is needed + * we need this because we can't know if a file is stored local or not from + * outside the filestorage and for some purposes a local file is needed * * @param string $path * @return string diff --git a/lib/files/storage/common.php b/lib/files/storage/common.php index b4c33c69f6b..4cdabf1c8a6 100644 --- a/lib/files/storage/common.php +++ b/lib/files/storage/common.php @@ -113,7 +113,8 @@ abstract class Common implements \OC\Files\Storage\Storage { public function deleteAll( $directory, $empty = false ) { $directory = trim($directory, '/'); - if ( !$this->file_exists( \OCP\USER::getUser() . '/' . $directory ) || !$this->is_dir( \OCP\USER::getUser() . '/' . $directory ) ) { + if ( !$this->file_exists( \OCP\USER::getUser() . '/' . $directory ) + || !$this->is_dir( \OCP\USER::getUser() . '/' . $directory ) ) { return false; } elseif( !$this->isReadable( \OCP\USER::getUser() . '/' . $directory ) ) { return false; diff --git a/lib/files/storage/local.php b/lib/files/storage/local.php index 4099f860d7b..da6597c8057 100644 --- a/lib/files/storage/local.php +++ b/lib/files/storage/local.php @@ -205,7 +205,9 @@ class Local extends \OC\Files\Storage\Common{ return (float)exec('stat -c %s ' . escapeshellarg($fullPath)); } } else { - \OC_Log::write('core', 'Unable to determine file size of "'.$fullPath.'". Unknown OS: '.$name, \OC_Log::ERROR); + \OC_Log::write('core', + 'Unable to determine file size of "'.$fullPath.'". Unknown OS: '.$name, + \OC_Log::ERROR); } return 0; diff --git a/lib/files/storage/mappedlocal.php b/lib/files/storage/mappedlocal.php index f2af5bfe357..e707f71d71c 100644 --- a/lib/files/storage/mappedlocal.php +++ b/lib/files/storage/mappedlocal.php @@ -248,7 +248,9 @@ class MappedLocal extends \OC\Files\Storage\Common{ return (float)exec('stat -c %s ' . escapeshellarg($fullPath)); } } else { - \OC_Log::write('core', 'Unable to determine file size of "'.$fullPath.'". Unknown OS: '.$name, \OC_Log::ERROR); + \OC_Log::write('core', + 'Unable to determine file size of "'.$fullPath.'". Unknown OS: '.$name, + \OC_Log::ERROR); } return 0; diff --git a/lib/files/view.php b/lib/files/view.php index 1a234228eab..9ac08c98082 100644 --- a/lib/files/view.php +++ b/lib/files/view.php @@ -92,7 +92,9 @@ class View { /** * get the mountpoint of the storage object for a path - ( note: because a storage is not always mounted inside the fakeroot, the returned mountpoint is relative to the absolute root of the filesystem and doesn't take the chroot into account + * ( note: because a storage is not always mounted inside the fakeroot, the + * returned mountpoint is relative to the absolute root of the filesystem + * and doesn't take the chroot into account ) * * @param string $path * @return string @@ -113,7 +115,8 @@ class View { /** * return the path to a local version of the file - * we need this because we can't know if a file is stored local or not from outside the filestorage and for some purposes a local file is needed + * we need this because we can't know if a file is stored local or not from + * outside the filestorage and for some purposes a local file is needed * * @param string $path * @return string @@ -252,7 +255,8 @@ class View { public function file_put_contents($path, $data) { if (is_resource($data)) { //not having to deal with streams in file_put_contents makes life easier $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path)); - if (\OC_FileProxy::runPreProxies('file_put_contents', $absolutePath, $data) && Filesystem::isValidPath($path)) { + if (\OC_FileProxy::runPreProxies('file_put_contents', $absolutePath, $data) + && Filesystem::isValidPath($path)) { $path = $this->getRelativePath($absolutePath); $exists = $this->file_exists($path); $run = true; @@ -324,7 +328,8 @@ class View { $postFix2 = (substr($path2, -1, 1) === '/') ? '/' : ''; $absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($path1)); $absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($path2)); - if (\OC_FileProxy::runPreProxies('rename', $absolutePath1, $absolutePath2) and Filesystem::isValidPath($path2)) { + if (\OC_FileProxy::runPreProxies('rename', $absolutePath1, $absolutePath2) + and Filesystem::isValidPath($path2)) { $path1 = $this->getRelativePath($absolutePath1); $path2 = $this->getRelativePath($absolutePath2); @@ -776,7 +781,8 @@ class View { $rootEntry = $subCache->get(''); if ($rootEntry) { $relativePath = trim(substr($mountPoint, $dirLength), '/'); - if ($pos = strpos($relativePath, '/')) { //mountpoint inside subfolder add size to the correct folder + if ($pos = strpos($relativePath, '/')) { + //mountpoint inside subfolder add size to the correct folder $entryName = substr($relativePath, 0, $pos); foreach ($files as &$entry) { if ($entry['name'] === $entryName) { |