src/FS/File/List/SectionReader.php
public static function load( $fileName )
	{
		if( !file_exists( $fileName ) )
			throw new Exception( 'File "'.$fileName.'" is not existing.' );

		$reader	= new FS_File_Reader( $fileName );
		$lines	= $reader->readArray();
		
		$list	= array();
		foreach( $lines as $line )
		{
			$line = trim( $line );
			if( !$line )
				continue;
			if( preg_match( self::$commentPattern, $line ) )
				continue;
					
			if( preg_match( self::$sectionPattern, $line ) )
			{
				$section = substr( $line, 1, -1 );
				if( !isset( $list[$section] ) )
					$list[$section]	= array();
			}
			else if( $section )
				$list[$section][]	= $line;
		}
		return $list;
	}
public static function load( $fileName )
	{
		if( !file_exists( $fileName ) )
			throw new Exception( 'File "'.$fileName.'" is not existing.' );

		$reader	= new FS_File_Reader( $fileName );
		$lines	= $reader->readArray();
		
		$list	= array();
		foreach( $lines as $line )
		{
			$line = trim( $line );
			if( !$line )
				continue;
			if( preg_match( self::$commentPattern, $line ) )
				continue;
					
			if( preg_match( self::$sectionPattern, $line ) )
			{
				$section = substr( $line, 1, -1 );
				if( !isset( $list[$section] ) )
					$list[$section]	= array();
			}
			else if( $section )
				$list[$section][]	= $line;
		}
		return $list;
	}
public static function load ( $ fileName ) { if ( ! file_exists ( $ fileName ) ) throw new Exception ( 'File "' . $ fileName . '" is not existing.' ) ; $ reader = new FS_File_Reader ( $ fileName ) ; $ lines = $ reader -> readArray ( ) ; $ list = array ( ) ; foreach ( $ lines as $ line ) { $ line = trim ( $ line ) ; if ( ! $ line ) continue ; if ( preg_match ( self :: $ commentPattern , $ line ) ) continue ; if ( preg_match ( self :: $ sectionPattern , $ line ) ) { $ section = substr ( $ line , 1 , - 1 ) ; if ( ! isset ( $ list [ $ section ] ) ) $ list [ $ section ] = array ( ) ; } else if ( $ section ) $ list [ $ section ] [ ] = $ line ; } return $ list ; }
Reads the List.
@access		public
@static
@param		string		$fileName		File Name of sectioned List
@return		array
Reads the List .