src/FS/File/Log/JSON/Reader.php
public static function read( $fileName, $reverse = FALSE, $limit = 0 )
	{
		$data	= array();
		if( !file_exists( $fileName ) )
			throw new Exception( 'Log File "'.$fileName.'" is not existing.' );
		$lines		= file( $fileName );
		foreach( $lines as $line )
		{
			$line	= trim( $line );
			if( !$line )
				continue;
			$data[]	= json_decode( $line, TRUE );
		}
		if( $reverse )
			$data	= array_reverse( $data );
		if( $limit )
			$data	= array_slice( $data, 0, $limit );
		return $data;
	}
public static function read( $fileName, $reverse = FALSE, $limit = 0 )
	{
		$data	= array();
		if( !file_exists( $fileName ) )
			throw new Exception( 'Log File "'.$fileName.'" is not existing.' );
		$lines		= file( $fileName );
		foreach( $lines as $line )
		{
			$line	= trim( $line );
			if( !$line )
				continue;
			$data[]	= json_decode( $line, TRUE );
		}
		if( $reverse )
			$data	= array_reverse( $data );
		if( $limit )
			$data	= array_slice( $data, 0, $limit );
		return $data;
	}
public static function read ( $ fileName , $ reverse = FALSE , $ limit = 0 ) { $ data = array ( ) ; if ( ! file_exists ( $ fileName ) ) throw new Exception ( 'Log File "' . $ fileName . '" is not existing.' ) ; $ lines = file ( $ fileName ) ; foreach ( $ lines as $ line ) { $ line = trim ( $ line ) ; if ( ! $ line ) continue ; $ data [ ] = json_decode ( $ line , TRUE ) ; } if ( $ reverse ) $ data = array_reverse ( $ data ) ; if ( $ limit ) $ data = array_slice ( $ data , 0 , $ limit ) ; return $ data ; }
Reads and returns List of parsed Lines statically.
@access		public
@static
@param		string		$fileName		File Name of Log File
@param		bool		$reverse		Flag: revert List
@param		int			$limit			Optional: limit List
@return		array
Reads and returns List of parsed Lines statically .