This repository was archived by the owner on Jun 9, 2023. It is now read-only.
File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,12 @@ function drush_get_bootstrap_candidate_classnames() {
160
160
return $ candidates ;
161
161
}
162
162
163
+ /**
164
+ * Look up the best bootstrap class for the given location
165
+ * from the set of available candidates.
166
+ */
163
167
function drush_bootstrap_class_for_root ($ path ) {
168
+ drush_load_bootstrap_commandfile_at_path ($ path );
164
169
$ candidates = drush_get_bootstrap_candidates ();
165
170
foreach ($ candidates as $ candidate ) {
166
171
if ($ candidate ->valid_root ($ path )) {
@@ -170,6 +175,23 @@ function drush_bootstrap_class_for_root($path) {
170
175
return NULL ;
171
176
}
172
177
178
+ /**
179
+ * Check to see if there is a bootstrap class available
180
+ * at the specified location; if there is, load it.
181
+ */
182
+ function drush_load_bootstrap_commandfile_at_path ($ path ) {
183
+ static $ paths = array ();
184
+
185
+ if (!empty ($ path ) && (!array_key_exists ($ path , $ paths ))) {
186
+ $ paths [$ path ] = TRUE ;
187
+ // Check to see if we have any bootstrap classes in this location.
188
+ $ bootstrap_class_dir = $ path . '/drush/bootstrap ' ;
189
+ if (is_dir ($ bootstrap_class_dir )) {
190
+ _drush_add_commandfiles (array ($ bootstrap_class_dir ), DRUSH_BOOTSTRAP_DRUSH );
191
+ }
192
+ }
193
+ }
194
+
173
195
/**
174
196
* Select the bootstrap class to use. If this is called multiple
175
197
* times, the bootstrap class returned might change on subsequent
You can’t perform that action at this time.
0 commit comments