Improvements to code formatting & indentation

This commit is contained in:
Sam Tuke 2013-05-09 18:16:59 +02:00
parent 3003dd46d1
commit 92e28839ff
1 changed files with 122 additions and 117 deletions

View File

@ -305,7 +305,6 @@ class Util {
* @brief Find all files and their encryption status within a directory
* @param string $directory The path of the parent directory to search
* @return mixed false if 0 found, array on success. Keys: name, path
* @note $directory needs to be a path relative to OC data dir. e.g.
* /admin/files NOT /backup OR /home/www/oc/data/admin/files
*/
@ -468,7 +467,8 @@ class Util {
* @return bool
*/
public function getFileSize($path) {
public function getFileSize( $path ) {
$result = 0;
// Disable encryption proxy to prevent recursive calls
@ -513,23 +513,26 @@ class Util {
return $result;
}
/**
* @brief fix the file size of the encrypted file
*
* @param $path absolute path
* @return true / false if file is encrypted
*/
public function fixFileSize($path) {
public function fixFileSize( $path ) {
$result = false;
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
$realSize = $this->getFileSize($path);
if($realSize > 0) {
$cached = $this->view->getFileInfo($path);
$realSize = $this->getFileSize( $path );
if ( $realSize > 0 ) {
$cached = $this->view->getFileInfo( $path );
$cached['encrypted'] = 1;
// set the size
@ -539,6 +542,7 @@ class Util {
$this->view->putFileInfo( $path, $cached );
$result = true;
}
\OC_FileProxy::$enabled = $proxyStatus;
@ -640,7 +644,7 @@ class Util {
stream_copy_to_stream( $plainHandle1, $plainHandle2 );
// Close access to original file
// $this->view->fclose( $plainHandle1 ); // not implemented in view{}
// $this->view->fclose( $plainHandle1 ); // not implemented in view{}
// Delete original plain file so we can rename enc file later
$this->view->unlink( $rawPath );
@ -1180,7 +1184,7 @@ class Util {
* @param int $Id of a share
* @return owner
*/
public function getOwnerFromSharedFile($id) {
public function getOwnerFromSharedFile( $id ) {
$query = \OC_DB::prepare( 'SELECT `parent`, `uid_owner` FROM `*PREFIX*share` WHERE `id` = ?', 1 );
$source = $query->execute( array( $id ) )->fetchRow();
@ -1214,6 +1218,7 @@ class Util {
}
return $fileOwner;
}
}