original_string: public static function getAllFilesAndFoldersInPath(array $fileArr, $path, $extList = '', $regDirs = FALSE, $recursivityLevels = 99, $excludePattern = '') {
  		if ($regDirs) {
  			$fileArr[] = $path;
  		}
  		$fileArr = array_merge($fileArr, self::getFilesInDir($path, $extList, 1, 1, $excludePattern));
  
  		$dirs = self::get_dirs($path);
  		if (is_array($dirs) && $recursivityLevels > 0) {
  			foreach ($dirs as $subdirs) {
  				if ((string) $subdirs != '' && (!strlen($excludePattern) || !preg_match('/^' . $excludePattern . '$/', $subdirs))) {
  					$fileArr = self::getAllFilesAndFoldersInPath($fileArr, $path . $subdirs . '/', $extList, $regDirs, $recursivityLevels - 1, $excludePattern);
  				}
  			}
  		}
  		return $fileArr;
  	}
code: public static function getAllFilesAndFoldersInPath(array $fileArr, $path, $extList = '', $regDirs = FALSE, $recursivityLevels = 99, $excludePattern = '') {
  		if ($regDirs) {
  			$fileArr[] = $path;
  		}
  		$fileArr = array_merge($fileArr, self::getFilesInDir($path, $extList, 1, 1, $excludePattern));
  
  		$dirs = self::get_dirs($path);
  		if (is_array($dirs) && $recursivityLevels > 0) {
  			foreach ($dirs as $subdirs) {
  				if ((string) $subdirs != '' && (!strlen($excludePattern) || !preg_match('/^' . $excludePattern . '$/', $subdirs))) {
  					$fileArr = self::getAllFilesAndFoldersInPath($fileArr, $path . $subdirs . '/', $extList, $regDirs, $recursivityLevels - 1, $excludePattern);
  				}
  			}
  		}
  		return $fileArr;
  	}
code_tokens: public static function getAllFilesAndFoldersInPath ( array $ fileArr , $ path , $ extList = '' , $ regDirs = FALSE , $ recursivityLevels = 99 , $ excludePattern = '' ) { if ( $ regDirs ) { $ fileArr [ ] = $ path ; } $ fileArr = array_merge ( $ fileArr , self :: getFilesInDir ( $ path , $ extList , 1 , 1 , $ excludePattern ) ) ; $ dirs = self :: get_dirs ( $ path ) ; if ( is_array ( $ dirs ) && $ recursivityLevels > 0 ) { foreach ( $ dirs as $ subdirs ) { if ( ( string ) $ subdirs != '' && ( ! strlen ( $ excludePattern ) || ! preg_match ( '/^' . $ excludePattern . '$/' , $ subdirs ) ) ) { $ fileArr = self :: getAllFilesAndFoldersInPath ( $ fileArr , $ path . $ subdirs . '/' , $ extList , $ regDirs , $ recursivityLevels - 1 , $ excludePattern ) ; } } } return $ fileArr ; }
docstring: Recursively gather all files and folders of a path.
  
  @param array $fileArr Empty input array (will have files added to it)
  @param string $path The path to read recursively from (absolute) (include trailing slash!)
  @param string $extList Comma list of file extensions: Only files with extensions in this list (if applicable) will be selected.
  @param boolean $regDirs If set, directories are also included in output.
  @param integer $recursivityLevels The number of levels to dig down...
  @param string $excludePattern regex pattern of files/directories to exclude
  @return array An array with the found files/directories.
docstring_tokens: Recursively gather all files and folders of a path .