src/Tolkien/BuildPost.php
public function find_all_files($dir) 
	{
		$root = array_reverse(scandir($dir));
		if(count($root) == 0) return;
		
		foreach($root as $value)
		{
			if($value === '.' || $value === '..')
			{
				continue;
			}
			if(is_file("$dir/$value"))
			{
				$result[] = "$dir/$value";
				$this->posts[] = $this->read( "$dir/$value", $value );
				continue;
			}
			foreach($this->find_all_files("$dir/$value") as $value)
			{
				$result[] = $value;
			}
		}
		return $result;
	}
public function find_all_files($dir) 
	{
		$root = array_reverse(scandir($dir));
		if(count($root) == 0) return;
		
		foreach($root as $value)
		{
			if($value === '.' || $value === '..')
			{
				continue;
			}
			if(is_file("$dir/$value"))
			{
				$result[] = "$dir/$value";
				$this->posts[] = $this->read( "$dir/$value", $value );
				continue;
			}
			foreach($this->find_all_files("$dir/$value") as $value)
			{
				$result[] = $value;
			}
		}
		return $result;
	}
public function find_all_files ( $ dir ) { $ root = array_reverse ( scandir ( $ dir ) ) ; if ( count ( $ root ) == 0 ) return ; foreach ( $ root as $ value ) { if ( $ value === '.' || $ value === '..' ) { continue ; } if ( is_file ( "$dir/$value" ) ) { $ result [ ] = "$dir/$value" ; $ this -> posts [ ] = $ this -> read ( "$dir/$value" , $ value ) ; continue ; } foreach ( $ this -> find_all_files ( "$dir/$value" ) as $ value ) { $ result [ ] = $ value ; } } return $ result ; }
Find All file on asset dir and create array of Model\Post

@param string $dir
@return recursive
Find All file on asset dir and create array of Model \ Post