private static function listFilesInDirectory($dir, $omitSymlinks, $prefix = '')
	{
		if (!is_dir($dir)) {
			return false;
		}
		$excludes = array(".","..");
		$result = array();
		$files = scandir($dir);
		if(!$files) {
			return array();
		}
		foreach($files as $file) {
			if(!in_array($file, $excludes)) {
				$path = $dir.DIRECTORY_SEPARATOR.$file;
				if(is_link($path)) {
					if($omitSymlinks) {
						continue;
					} else {
						$result[] = $prefix.$file;
					}
				} else if(is_dir($path)) {
					$result[] = $prefix.$file.DIRECTORY_SEPARATOR;
					$subs = elFinderVolumeFTP::listFilesInDirectory($path, $omitSymlinks, $prefix.$file.DIRECTORY_SEPARATOR);
					if($subs) {
						$result = array_merge($result, $subs);
					}
					
				} else {
					$result[] = $prefix.$file;
				}
			}
		}
		return $result;
	}
private static function listFilesInDirectory($dir, $omitSymlinks, $prefix = '')
	{
		if (!is_dir($dir)) {
			return false;
		}
		$excludes = array(".","..");
		$result = array();
		$files = scandir($dir);
		if(!$files) {
			return array();
		}
		foreach($files as $file) {
			if(!in_array($file, $excludes)) {
				$path = $dir.DIRECTORY_SEPARATOR.$file;
				if(is_link($path)) {
					if($omitSymlinks) {
						continue;
					} else {
						$result[] = $prefix.$file;
					}
				} else if(is_dir($path)) {
					$result[] = $prefix.$file.DIRECTORY_SEPARATOR;
					$subs = elFinderVolumeFTP::listFilesInDirectory($path, $omitSymlinks, $prefix.$file.DIRECTORY_SEPARATOR);
					if($subs) {
						$result = array_merge($result, $subs);
					}
					
				} else {
					$result[] = $prefix.$file;
				}
			}
		}
		return $result;
	}
private static function listFilesInDirectory ( $ dir , $ omitSymlinks , $ prefix = '' ) { if ( ! is_dir ( $ dir ) ) { return false ; } $ excludes = array ( "." , ".." ) ; $ result = array ( ) ; $ files = scandir ( $ dir ) ; if ( ! $ files ) { return array ( ) ; } foreach ( $ files as $ file ) { if ( ! in_array ( $ file , $ excludes ) ) { $ path = $ dir . DIRECTORY_SEPARATOR . $ file ; if ( is_link ( $ path ) ) { if ( $ omitSymlinks ) { continue ; } else { $ result [ ] = $ prefix . $ file ; } } else if ( is_dir ( $ path ) ) { $ result [ ] = $ prefix . $ file . DIRECTORY_SEPARATOR ; $ subs = elFinderVolumeFTP :: listFilesInDirectory ( $ path , $ omitSymlinks , $ prefix . $ file . DIRECTORY_SEPARATOR ) ; if ( $ subs ) { $ result = array_merge ( $ result , $ subs ) ; } } else { $ result [ ] = $ prefix . $ file ; } } } return $ result ; }
Returns array of strings containing all files and folders in the specified local directory.
@param $dir
@param string $prefix
@internal param string $path path to directory to scan.
@return array array of files and folders names relative to the $path
or an empty array if the directory $path is empty,
<br />
false if $path is not a directory or does not exist.
Returns array of strings containing all files and folders in the specified local directory .