src/Net/FTP/Reader.php
public function getList( $path = "", $recursive = FALSE )
	{
		$this->connection->checkConnection();
		$parsed	= array();
		if( !$path )
			$path	= $this->getPath();
		$list	= ftp_rawlist( $this->connection->getResource(), $path );
		if( is_array( $list ) )
		{
			foreach( $list as $current )
			{
				$data	= $this->parseListEntry( $current );
				if( count( $data ) )
				{
					$parsed[]	= $data;
					if( $recursive && $data['isdir'] && $data['name'] != "." && $data['name'] != ".." )
					{
						$nested	= $this->getList( $path."/".$data['name'], TRUE );
						foreach( $nested as $entry )
						{
							$entry['name']	= $data['name']."/".$entry['name'];
							$parsed[]	= $entry;
						}
					}
				}
			}
		}
		return $parsed;
	}
public function getList( $path = "", $recursive = FALSE )
	{
		$this->connection->checkConnection();
		$parsed	= array();
		if( !$path )
			$path	= $this->getPath();
		$list	= ftp_rawlist( $this->connection->getResource(), $path );
		if( is_array( $list ) )
		{
			foreach( $list as $current )
			{
				$data	= $this->parseListEntry( $current );
				if( count( $data ) )
				{
					$parsed[]	= $data;
					if( $recursive && $data['isdir'] && $data['name'] != "." && $data['name'] != ".." )
					{
						$nested	= $this->getList( $path."/".$data['name'], TRUE );
						foreach( $nested as $entry )
						{
							$entry['name']	= $data['name']."/".$entry['name'];
							$parsed[]	= $entry;
						}
					}
				}
			}
		}
		return $parsed;
	}
public function getList ( $ path = "" , $ recursive = FALSE ) { $ this -> connection -> checkConnection ( ) ; $ parsed = array ( ) ; if ( ! $ path ) $ path = $ this -> getPath ( ) ; $ list = ftp_rawlist ( $ this -> connection -> getResource ( ) , $ path ) ; if ( is_array ( $ list ) ) { foreach ( $ list as $ current ) { $ data = $ this -> parseListEntry ( $ current ) ; if ( count ( $ data ) ) { $ parsed [ ] = $ data ; if ( $ recursive && $ data [ 'isdir' ] && $ data [ 'name' ] != "." && $ data [ 'name' ] != ".." ) { $ nested = $ this -> getList ( $ path . "/" . $ data [ 'name' ] , TRUE ) ; foreach ( $ nested as $ entry ) { $ entry [ 'name' ] = $ data [ 'name' ] . "/" . $ entry [ 'name' ] ; $ parsed [ ] = $ entry ; } } } } } return $ parsed ; }
Returns a List of all Folders an Files of a Path on FTP Server.
@access		public
@param		string		$path			Path
@param		bool		$recursive		Scan Folders recursive (default: FALSE)
@return		array
Returns a List of all Folders an Files of a Path on FTP Server .