ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# D.5 DirSet A DirSet is a group of directories. These directories can be found in a directory tree starting in a base directory and are matched by patterns taken from a number of [PatternSets](apds06.html "D.6 PatternSet") and [Selectors](apg.html "Appendix G. Core selectors"). [PatternSets](apds06.html "D.6 PatternSet") can be specified as nested `<patternset>` elements. In addition, DirSet holds an implicit [PatternSet](apds06.html "D.6 PatternSet") and supports the nested `<include>`, `<includesfile>`, `<exclude>` and `<excludesfile>` elements of `<patternset>` directly, as well as `<patternset>`'s attributes. [Selectors](apg.html "Appendix G. Core selectors") are available as nested elements within the DirSet. If any of the selectors within the DirSet do not select the directory, it is not considered part of the DirSet. This makes a DirSet equivalent to an <and> selector container. Table D.4:聽 Attributes for the `<dirset>` tag NameTypeDescriptionDefaultRequired`dir``String`The root of the directory tree of this DirSet.n/aYes`casesensitive``Boolean`Specifies whether case-sensitivity should be applied (`true|yes|on` or `false|no|off`).`true`No`expandsymboliclinks``Boolean`Whether to expand/dereference (follow) symbolic links - set to 'true' to emulate old Phing behavior.`false`No`includes``String`A comma- or space-separated list of patterns of directories that must be included; all directories are included when omitted.n/aNo`includesfile``String`The name of a file; each line of this file is taken to be an include pattern. Note: if the file is empty and there are no other patterns defined for the fileset, all directories will be included.n/aNo`excludes``String`A comma- or space-separated list of patterns of directories that must be excluded; no directories are excluded when omitted.n/aNo`excludesfile``String`The name of a file; each line of this file is taken to be an exclude pattern.n/aNo D.5.1 Using wildcards - `test*.xml` will include `test_42.xml`, but it will not include `test/some.xml`. - `test**.xml` fits to `test_42.xml` as well as to `test/bla.xml`, for example. - `**/*.ent.xml` fits to all files that end with `ent.xml` in all subdirectories of the directory specified with the `dir` attribute of the `<fileset>` tag. However, it will not include any files that are directly in the base directory of the file set. D.5.2 Usage Examples ``` <fileset dir="/etc" > <include name="httpd/**" /> <include name="php.ini" /> </fileset> <fileset dir="/etc" > <patternset> <include name="**/*.php"/> <exclude name="**/*Test*"/> </patternset> </fileset> ``` This will include the apache configuration and PHP configuration file from `/etc`. D.5.3 Nested tags The tags that are supported by `Fileset` are: - `include` - `exclude` - `patternset` - any of the [selectors](apg.html "Appendix G. Core selectors") The `<include>` and the `<exclude>` tags must have a `name` attribute that contains the pattern to include/exclude. D.5.4 Related types - [pearpackagefileset](apds08.html "D.8 PearPackageFileSet")