@@ -83,12 +83,18 @@ public static function loadFilters($instance) {
83
83
$ finder ->sortByName ();
84
84
foreach ($ finder as $ file ) {
85
85
86
- include ($ file ->getPathname ());
87
-
88
- // $filter should be defined in the included file
89
- if (isset ($ filter )) {
90
- $ instance ->addFilter ($ filter );
91
- unset($ filter );
86
+ // see if the file should be ignored or not
87
+ $ baseName = $ file ->getBasename ();
88
+ if ($ baseName [0 ] != "_ " ) {
89
+
90
+ include ($ file ->getPathname ());
91
+
92
+ // $filter should be defined in the included file
93
+ if (isset ($ filter )) {
94
+ $ instance ->addFilter ($ filter );
95
+ unset($ filter );
96
+ }
97
+
92
98
}
93
99
94
100
}
@@ -124,12 +130,18 @@ public static function loadFunctions($instance) {
124
130
$ finder ->sortByName ();
125
131
foreach ($ finder as $ file ) {
126
132
127
- include ($ file ->getPathname ());
128
-
129
- // $function should be defined in the included file
130
- if (isset ($ function )) {
131
- $ instance ->addFunction ($ function );
132
- unset($ function );
133
+ // see if the file should be ignored or not
134
+ $ baseName = $ file ->getBasename ();
135
+ if ($ baseName [0 ] != "_ " ) {
136
+
137
+ include ($ file ->getPathname ());
138
+
139
+ // $function should be defined in the included file
140
+ if (isset ($ function )) {
141
+ $ instance ->addFunction ($ function );
142
+ unset($ function );
143
+ }
144
+
133
145
}
134
146
135
147
}
@@ -164,7 +176,16 @@ public static function loadMacros($instance) {
164
176
$ finder ->files ()->name ("*. " .$ macroExt )->in ($ macroDir );
165
177
$ finder ->sortByName ();
166
178
foreach ($ finder as $ file ) {
167
- $ instance ->addGlobal ($ file ->getBasename (". " .$ macroExt ), $ instance ->loadTemplate ($ file ->getBasename ()));
179
+
180
+ // see if the file should be ignored
181
+ $ baseName = $ file ->getBasename ();
182
+ if ($ baseName [0 ] != "_ " ) {
183
+
184
+ // add the macro to the global context
185
+ $ instance ->addGlobal ($ file ->getBasename (". " .$ macroExt ), $ instance ->loadTemplate ($ baseName ));
186
+
187
+ }
188
+
168
189
}
169
190
170
191
} else {
@@ -197,9 +218,19 @@ public static function loadTags($instance) {
197
218
$ finder ->files ()->name ("*\. " .$ tagExt )->in ($ tagDir );
198
219
$ finder ->sortByName ();
199
220
foreach ($ finder as $ file ) {
200
- include ($ file ->getPathname ());
201
- $ className = "Project_ " .$ file ->getBasename (". " .$ tagExt )."_TokenParser " ;
202
- $ instance ->addTokenParser (new $ className ());
221
+
222
+ // see if the file should be ignored or not
223
+ $ baseName = $ file ->getBasename ();
224
+ if ($ baseName [0 ] != "_ " ) {
225
+
226
+ include ($ file ->getPathname ());
227
+
228
+ // Project_{filenameBase}_TokenParser should be defined in the include
229
+ $ className = "Project_ " .$ file ->getBasename (". " .$ tagExt )."_TokenParser " ;
230
+ $ instance ->addTokenParser (new $ className ());
231
+
232
+ }
233
+
203
234
}
204
235
205
236
} else {
@@ -233,12 +264,18 @@ public static function loadTests($instance) {
233
264
$ finder ->sortByName ();
234
265
foreach ($ finder as $ file ) {
235
266
236
- include ($ file ->getPathname ());
237
-
238
- // $test should be defined in the included file
239
- if (isset ($ test )) {
240
- $ instance ->addTest ($ test );
241
- unset($ test );
267
+ // see if the file should be ignored or not
268
+ $ baseName = $ file ->getBasename ();
269
+ if ($ baseName [0 ] != "_ " ) {
270
+
271
+ include ($ file ->getPathname ());
272
+
273
+ // $test should be defined in the included file
274
+ if (isset ($ test )) {
275
+ $ instance ->addTest ($ test );
276
+ unset($ test );
277
+ }
278
+
242
279
}
243
280
244
281
}
0 commit comments