public static function files($path, $filter = '.', $recurse = false, $full = false, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'),
		$excludefilter = array('^\..*', '.*~'))
	{
		// Check to make sure the path valid and clean
		$path = Path::clean($path);

		// Is the path a folder?
		if (!is_dir($path))
		{
			Log::add(sprintf('%1$s: Path is not a folder. Path: %2$s', __METHOD__, $path), Log::WARNING, 'jerror');

			return false;
		}

		// Compute the excludefilter string
		if (count($excludefilter))
		{
			$excludefilter_string = '/(' . implode('|', $excludefilter) . ')/';
		}
		else
		{
			$excludefilter_string = '';
		}

		// Get the files
		$arr = self::_items($path, $filter, $recurse, $full, $exclude, $excludefilter_string, true);

		// Sort the files
		asort($arr);

		return array_values($arr);
	}
public static function files($path, $filter = '.', $recurse = false, $full = false, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'),
		$excludefilter = array('^\..*', '.*~'))
	{
		// Check to make sure the path valid and clean
		$path = Path::clean($path);

		// Is the path a folder?
		if (!is_dir($path))
		{
			Log::add(sprintf('%1$s: Path is not a folder. Path: %2$s', __METHOD__, $path), Log::WARNING, 'jerror');

			return false;
		}

		// Compute the excludefilter string
		if (count($excludefilter))
		{
			$excludefilter_string = '/(' . implode('|', $excludefilter) . ')/';
		}
		else
		{
			$excludefilter_string = '';
		}

		// Get the files
		$arr = self::_items($path, $filter, $recurse, $full, $exclude, $excludefilter_string, true);

		// Sort the files
		asort($arr);

		return array_values($arr);
	}
public static function files ( $ path , $ filter = '.' , $ recurse = false , $ full = false , $ exclude = array ( '.svn' , 'CVS' , '.DS_Store' , '__MACOSX' ) , $ excludefilter = array ( '^\..*' , '.*~' ) ) { // Check to make sure the path valid and clean $ path = Path :: clean ( $ path ) ; // Is the path a folder? if ( ! is_dir ( $ path ) ) { Log :: add ( sprintf ( '%1$s: Path is not a folder. Path: %2$s' , __METHOD__ , $ path ) , Log :: WARNING , 'jerror' ) ; return false ; } // Compute the excludefilter string if ( count ( $ excludefilter ) ) { $ excludefilter_string = '/(' . implode ( '|' , $ excludefilter ) . ')/' ; } else { $ excludefilter_string = '' ; } // Get the files $ arr = self :: _items ( $ path , $ filter , $ recurse , $ full , $ exclude , $ excludefilter_string , true ) ; // Sort the files asort ( $ arr ) ; return array_values ( $ arr ) ; }
Utility function to read the files in a folder.

@param   string   $path           The path of the folder to read.
@param   string   $filter         A filter for file names.
@param   mixed    $recurse        True to recursively search into sub-folders, or an integer to specify the maximum depth.
@param   boolean  $full           True to return the full path to the file.
@param   array    $exclude        Array with names of files which should not be shown in the result.
@param   array    $excludefilter  Array of filter to exclude

@return  array  Files in the given folder.

@since   1.0
Utility function to read the files in a folder .