lib/fal/dropbox.php
public function listDir($dir='/', $filter=NULL, $hidden=false, $rev=NUll, $type='sandbox')
	{
		$result = $this->metadata($dir, true, false, $hidden, $rev, $type);
		$return = array();
		foreach ($result['contents'] as $item) {
			$exp = explode('/', $item['path']);
			$ext = explode('.', $name = end($exp));
			if (!$filter || preg_match($filter, $name))
				$return[$name] = array(
					'path' => $item['path'],
					'filename' => $name,
					'extension' => (count($ext) > 1) ? array_pop($ext) : null,
					'basename' => implode('.', $ext),
					'mtime'=>strtotime($item['modified']),
					'size' => $item['bytes'],
					'type' => $item['is_dir'] ? 'dir' : 'file',
				);
		}
		return $return;
	}
public function listDir($dir='/', $filter=NULL, $hidden=false, $rev=NUll, $type='sandbox')
	{
		$result = $this->metadata($dir, true, false, $hidden, $rev, $type);
		$return = array();
		foreach ($result['contents'] as $item) {
			$exp = explode('/', $item['path']);
			$ext = explode('.', $name = end($exp));
			if (!$filter || preg_match($filter, $name))
				$return[$name] = array(
					'path' => $item['path'],
					'filename' => $name,
					'extension' => (count($ext) > 1) ? array_pop($ext) : null,
					'basename' => implode('.', $ext),
					'mtime'=>strtotime($item['modified']),
					'size' => $item['bytes'],
					'type' => $item['is_dir'] ? 'dir' : 'file',
				);
		}
		return $return;
	}
public function listDir ( $ dir = '/' , $ filter = NULL , $ hidden = false , $ rev = NUll , $ type = 'sandbox' ) { $ result = $ this -> metadata ( $ dir , true , false , $ hidden , $ rev , $ type ) ; $ return = array ( ) ; foreach ( $ result [ 'contents' ] as $ item ) { $ exp = explode ( '/' , $ item [ 'path' ] ) ; $ ext = explode ( '.' , $ name = end ( $ exp ) ) ; if ( ! $ filter || preg_match ( $ filter , $ name ) ) $ return [ $ name ] = array ( 'path' => $ item [ 'path' ] , 'filename' => $ name , 'extension' => ( count ( $ ext ) > 1 ) ? array_pop ( $ ext ) : null , 'basename' => implode ( '.' , $ ext ) , 'mtime' => strtotime ( $ item [ 'modified' ] ) , 'size' => $ item [ 'bytes' ] , 'type' => $ item [ 'is_dir' ] ? 'dir' : 'file' , ) ; } return $ return ; }
list directory contents
@param string $dir
@param string $filter
@param bool   $hidden
@param null   $rev
@param string $type
@return bool|mixed
list directory contents