summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/smb.php
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2012-11-30 16:27:11 +0100
committerJörn Friedrich Dreyer <jfd@butonic.de>2012-11-30 16:27:11 +0100
commit92df70b6e5c4cba373cf0b24af02c328881cdd2d (patch)
treecaa914884d58cb9118330c3823c4525c7dfd65cf /apps/files_external/lib/smb.php
parentdf21ebeaf73bed10e972af6ef09f2bfb0df68e1c (diff)
downloadnextcloud-server-92df70b6e5c4cba373cf0b24af02c328881cdd2d.tar.gz
nextcloud-server-92df70b6e5c4cba373cf0b24af02c328881cdd2d.zip
fix checkstyle for files_external app, add whitespace for readability
Diffstat (limited to 'apps/files_external/lib/smb.php')
-rw-r--r--apps/files_external/lib/smb.php30
1 files changed, 16 insertions, 14 deletions
diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php
index 802d80d8d1f..071a9cd5f95 100644
--- a/apps/files_external/lib/smb.php
+++ b/apps/files_external/lib/smb.php
@@ -21,45 +21,46 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
$this->password=$params['password'];
$this->share=$params['share'];
$this->root=isset($params['root'])?$params['root']:'/';
- if(!$this->root || $this->root[0]!='/') {
+ if ( ! $this->root || $this->root[0]!='/') {
$this->root='/'.$this->root;
}
- if(substr($this->root, -1, 1)!='/') {
+ if (substr($this->root, -1, 1)!='/') {
$this->root.='/';
}
- if(!$this->share || $this->share[0]!='/') {
+ if ( ! $this->share || $this->share[0]!='/') {
$this->share='/'.$this->share;
}
- if(substr($this->share, -1, 1)=='/') {
+ if (substr($this->share, -1, 1)=='/') {
$this->share=substr($this->share, 0, -1);
}
//create the root folder if necesary
- if(!$this->is_dir('')) {
+ if ( ! $this->is_dir('')) {
$this->mkdir('');
}
}
public function constructUrl($path) {
- if(substr($path, -1)=='/') {
+ if (substr($path, -1)=='/') {
$path=substr($path, 0, -1);
}
return 'smb://'.$this->user.':'.$this->password.'@'.$this->host.$this->share.$this->root.$path;
}
public function stat($path) {
- if(!$path and $this->root=='/') {//mtime doesn't work for shares
+ if ( ! $path and $this->root=='/') {//mtime doesn't work for shares
$mtime=$this->shareMTime();
$stat=stat($this->constructUrl($path));
$stat['mtime']=$mtime;
return $stat;
- }else{
+ } else {
return stat($this->constructUrl($path));
}
}
public function filetype($path) {
- return (bool)@$this->opendir($path) ? 'dir' : 'file';//using opendir causes the same amount of requests and caches the content of the folder in one go
+ // using opendir causes the same amount of requests and caches the content of the folder in one go
+ return (bool)@$this->opendir($path) ? 'dir' : 'file';
}
/**
@@ -68,10 +69,11 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
* @return bool
*/
public function hasUpdated($path, $time) {
- if(!$path and $this->root=='/') {
- //mtime doesn't work for shares, but giving the nature of the backend, doing a full update is still just fast enough
+ if ( ! $path and $this->root=='/') {
+ // mtime doesn't work for shares, but giving the nature of the backend,
+ // doing a full update is still just fast enough
return true;
- }else{
+ } else {
$actualTime=$this->filemtime($path);
return $actualTime>$time;
}
@@ -84,9 +86,9 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
$dh=$this->opendir('');
$lastCtime=0;
while($file=readdir($dh)) {
- if($file!='.' and $file!='..') {
+ if ($file!='.' and $file!='..') {
$ctime=$this->filemtime($file);
- if($ctime>$lastCtime) {
+ if ($ctime>$lastCtime) {
$lastCtime=$ctime;
}
}