}
$dh = $this->opendir($path);
- while ($file = readdir($dh)) {
+ while (($file = readdir($dh)) !== false) {
if ($file === '.' || $file === '..') {
continue;
}
}
$dh = $this->opendir($path1);
- while ($file = readdir($dh)) {
+ while (($file = readdir($dh)) !== false) {
if ($file === '.' || $file === '..') {
continue;
}
public function rmdir($path) {
if (trim($path, '/') === '') {
$dir = $this->opendir($path);
- while ($file = readdir($dir)) {
+ while (($file = readdir($dh)) !== false) {
if (!\OC\Files\Filesystem::isIgnoredDir($file)) {
if (!$this->unlink($path.'/'.$file)) {
return false;
private function collectionMTime($path) {
$dh = $this->opendir($path);
$lastCTime = $this->filemtime($path);
- while ($file = readdir($dh)) {
+ while (($file = readdir($dh)) !== false) {
if ($file != '.' and $file != '..') {
$time = $this->filemtime($file);
if ($time > $lastCTime) {
private function shareMTime() {
$dh=$this->opendir('');
$lastCtime=0;
- while($file=readdir($dh)) {
+ while (($file = readdir($dh)) !== false) {
if ($file!='.' and $file!='..') {
$ctime=$this->filemtime($file);
if ($ctime>$lastCtime) {
$dirlisting = true;
$dirContent = $view->opendir($dir);
$i = 0;
- while($entryName = readdir($dirContent)) {
+ while(($entryName = readdir($dirContent)) !== false) {
if (!\OC\Files\Filesystem::isIgnoredDir($entryName)) {
$pos = strpos($dir.'/', '/', 1);
$tmp = substr($dir, 0, $pos);
}
$dh = opendir( $apps_dir['path'] );
- while( $file = readdir( $dh ) ) {
+ while (($file = readdir($dh)) !== false) {
if ($file[0] != '.' and is_file($apps_dir['path'].'/'.$file.'/appinfo/app.php')) {
function addRecursive($path, $source) {
if($dh=opendir($source)) {
$this->addFolder($path);
- while($file=readdir($dh)) {
+ while (($file = readdir($dh)) !== false) {
if($file=='.' or $file=='..') {
continue;
}
$storage = $this->getStorage();
if($storage and $storage->is_dir('/')) {
$dh=$storage->opendir('/');
- while($file=readdir($dh)) {
+ while (($file = readdir($dh)) !== false) {
if($file!='.' and $file!='..' and ($prefix==='' || strpos($file, $prefix) === 0)) {
$storage->unlink('/'.$file);
}
if($storage and $storage->is_dir('/')) {
$now = time();
$dh=$storage->opendir('/');
- while($file=readdir($dh)) {
+ while (($file = readdir($dh)) !== false) {
if($file!='.' and $file!='..') {
$mtime = $storage->filemtime('/'.$file);
if ($mtime < $now) {
$prefix = $this->fixKey($prefix);
if($cache_dir and is_dir($cache_dir)) {
$dh=opendir($cache_dir);
- while($file=readdir($dh)) {
+ while (($file = readdir($dh)) !== false) {
if($file!='.' and $file!='..' and ($prefix==='' || strpos($file, $prefix) === 0)) {
unlink($cache_dir.$file);
}
$cache_dir = self::getCacheDir();
if($cache_dir and is_dir($cache_dir)) {
$dh=opendir($cache_dir);
- while($file=readdir($dh)) {
+ while (($file = readdir($dh)) !== false) {
if($file!='.' and $file!='..') {
$mtime = filemtime($cache_dir.$file);
if ($mtime < $now) {
} else {
Filesystem::mkdir($destination);
$dh = Filesystem::opendir($source);
- while ($subnode = readdir($dh)) {
+ while (($subnode = readdir($dh)) !== false) {
if ($subnode == '.' || $subnode == '..') continue;
$this->copy($source . '/' . $subnode, $destination . '/' . $subnode);
$newChildren = array();
if ($this->storage->is_dir($path) && ($dh = $this->storage->opendir($path))) {
\OC_DB::beginTransaction();
- while ($file = readdir($dh)) {
+ while (($file = readdir($dh)) !== false) {
$child = ($path) ? $path . '/' . $file : $file;
if (!Filesystem::isIgnoredDir($file)) {
$newChildren[] = $file;
return false;
} else {
$directoryHandle = $this->opendir($directory);
- while ($contents = readdir($directoryHandle)) {
+ while (($contents = readdir($directoryHandle)) !== false) {
if (!\OC\Files\Filesystem::isIgnoredDir($contents)) {
$path = $directory . '/' . $contents;
if ($this->is_dir($path)) {
private function addLocalFolder($path, $target) {
if ($dh = $this->opendir($path)) {
- while ($file = readdir($dh)) {
+ while (($file = readdir($dh)) !== false) {
if ($file !== '.' and $file !== '..') {
if ($this->is_dir($path . '/' . $file)) {
mkdir($target . '/' . $file);
$files = array();
$dh = $this->opendir($dir);
if ($dh) {
- while ($item = readdir($dh)) {
+ while (($item = readdir($dh)) !== false) {
if ($item == '.' || $item == '..') continue;
if (strstr(strtolower($item), strtolower($query)) !== false) {
$files[] = $dir . '/' . $item;
} else {
if ($this->is_dir($path1) && ($dh = $this->opendir($path1))) {
$result = $this->mkdir($path2);
- while ($file = readdir($dh)) {
+ while (($file = readdir($dh)) !== false) {
if (!Filesystem::isIgnoredDir($file)) {
$result = $this->copy($path1 . '/' . $file, $path2 . '/' . $file);
}
if(!is_file($extractDir.'/appinfo/info.xml')) {
//try to find it in a subdir
$dh=opendir($extractDir);
- while($folder=readdir($dh)) {
+ while (($folder = readdir($dh)) !== false) {
if($folder[0]!='.' and is_dir($extractDir.'/'.$folder)) {
if(is_file($extractDir.'/'.$folder.'/appinfo/info.xml')) {
$extractDir.='/'.$folder;