src/FS/File/TodoLister.php
public function scan( $path )
	{
		$this->numberFound		= 0;
		$this->numberScanned	= 0;
		$this->numberTodos		= 0;
		$this->numberLines		= 0;
		$this->list				= array();
		$extensions		= $this->getExtensionPattern(); 
		$pattern		= $this->getExtendedPattern();
		$iterator		= $this->getIndexIterator( $path, $extensions );
		try{
			foreach( $iterator as $entry )
			{
				$this->numberScanned++;
				$content	= file_get_contents( $entry->getPathname() );
				$lines		= explode( "\n", $content );
				$i			= 0;
				$list		= array();
				foreach( $lines as $line )
				{
					$this->numberLines++;
					$i++;
					if( !preg_match( $pattern, $line ) )
						continue;
					$this->numberTodos++;
					$list[$i]	= $line;#trim( $line );
				}
				if( !$list )
					continue;
				$this->numberFound++;
				$this->list[$entry->getPathname()]	= array(
					'fileName'	=> $entry->getFilename(),
					'lines'		=> $list,
				);
			}
		}
		catch( UnexpectedValueException $e ){
		}
		catch( Exception $e ){
			throw new RuntimeException( $e->getMessage(), $e->getCode(), $es );
		}
	}
public function scan( $path )
	{
		$this->numberFound		= 0;
		$this->numberScanned	= 0;
		$this->numberTodos		= 0;
		$this->numberLines		= 0;
		$this->list				= array();
		$extensions		= $this->getExtensionPattern(); 
		$pattern		= $this->getExtendedPattern();
		$iterator		= $this->getIndexIterator( $path, $extensions );
		try{
			foreach( $iterator as $entry )
			{
				$this->numberScanned++;
				$content	= file_get_contents( $entry->getPathname() );
				$lines		= explode( "\n", $content );
				$i			= 0;
				$list		= array();
				foreach( $lines as $line )
				{
					$this->numberLines++;
					$i++;
					if( !preg_match( $pattern, $line ) )
						continue;
					$this->numberTodos++;
					$list[$i]	= $line;#trim( $line );
				}
				if( !$list )
					continue;
				$this->numberFound++;
				$this->list[$entry->getPathname()]	= array(
					'fileName'	=> $entry->getFilename(),
					'lines'		=> $list,
				);
			}
		}
		catch( UnexpectedValueException $e ){
		}
		catch( Exception $e ){
			throw new RuntimeException( $e->getMessage(), $e->getCode(), $es );
		}
	}
public function scan ( $ path ) { $ this -> numberFound = 0 ; $ this -> numberScanned = 0 ; $ this -> numberTodos = 0 ; $ this -> numberLines = 0 ; $ this -> list = array ( ) ; $ extensions = $ this -> getExtensionPattern ( ) ; $ pattern = $ this -> getExtendedPattern ( ) ; $ iterator = $ this -> getIndexIterator ( $ path , $ extensions ) ; try { foreach ( $ iterator as $ entry ) { $ this -> numberScanned ++ ; $ content = file_get_contents ( $ entry -> getPathname ( ) ) ; $ lines = explode ( "\n" , $ content ) ; $ i = 0 ; $ list = array ( ) ; foreach ( $ lines as $ line ) { $ this -> numberLines ++ ; $ i ++ ; if ( ! preg_match ( $ pattern , $ line ) ) continue ; $ this -> numberTodos ++ ; $ list [ $ i ] = $ line ; #trim( $line ); } if ( ! $ list ) continue ; $ this -> numberFound ++ ; $ this -> list [ $ entry -> getPathname ( ) ] = array ( 'fileName' => $ entry -> getFilename ( ) , 'lines' => $ list , ) ; } } catch ( UnexpectedValueException $ e ) { } catch ( Exception $ e ) { throw new RuntimeException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ es ) ; } }
Scans a Path for Files with Pattern.
@access		public
@return		int
Scans a Path for Files with Pattern .