app/Crispus/Filesystem.php
public function getFiles($sDirectory, $sExt = '')
	{
	    $aFiles = array();
	    
	    if(!is_dir($sDirectory)){
			return null;
		}
	    
	    foreach(new \DirectoryIterator($sDirectory) as $oFileInfo){
	        if($oFileInfo->isFile()){
	            if(empty($sExt) || $sExt == $oFileInfo->getExtension()){
	                $aFiles[] = $oFileInfo->getPathname();
	            }
	        }	            
	    }
	    
	    return $aFiles;
	}
public function getFiles($sDirectory, $sExt = '')
	{
	    $aFiles = array();
	    
	    if(!is_dir($sDirectory)){
			return null;
		}
	    
	    foreach(new \DirectoryIterator($sDirectory) as $oFileInfo){
	        if($oFileInfo->isFile()){
	            if(empty($sExt) || $sExt == $oFileInfo->getExtension()){
	                $aFiles[] = $oFileInfo->getPathname();
	            }
	        }	            
	    }
	    
	    return $aFiles;
	}
public function getFiles ( $ sDirectory , $ sExt = '' ) { $ aFiles = array ( ) ; if ( ! is_dir ( $ sDirectory ) ) { return null ; } foreach ( new \ DirectoryIterator ( $ sDirectory ) as $ oFileInfo ) { if ( $ oFileInfo -> isFile ( ) ) { if ( empty ( $ sExt ) || $ sExt == $ oFileInfo -> getExtension ( ) ) { $ aFiles [ ] = $ oFileInfo -> getPathname ( ) ; } } } return $ aFiles ; }
Helper function to get all files in a directory

@param string $sDirectory start directory
@param string $sExt optional limit to file extensions
@return array the matched files
Helper function to get all files in a directory