Closed (fixed)
Project:
Drush
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
24 Oct 2009 at 10:57 UTC
Updated:
21 Jun 2011 at 20:21 UTC
I'm really unclear about the $type and $key parameters for drush_include_engine():
* @param $type
* The type of engine.
* @param $engine
* The key for the engine to be included.
I'm trying to use this with module_builder, in a similar way to drush's pm system.
From my reading of the code, $engine is the base part of the filename to use -- ENGINE_5 / ENGINE_6 are the files that are looked for. This could do to be more clearly explained.
In which case, what does $type do?
Certainly in this particular type of usage (as opposed to stuff like curl/wget which I've not looked into), I can quite merrily pass a random string as $type and it still works.
Comments
Comment #1
joachim commentedReading some more it seems I can just use drush_include().
In which case, I'm unsure why pm doesn't just do this for its includes.
Comment #2
kotnik commentedCurrent documentation for drush_include_engine is (in includes/drush.inc:172):
Include the engine code for a specific named engine of a certain type.
If the engine type has implemented hook_drush_engine_$type the path to the engine specified in the array will be used.
If you don't need to present any user options for selecting the engine (which is common if the selection is implied by the running environment) and you don't need to allow other modules to define their own engines you can simply pass the $path to the directory where the engines are, and the appropriate one will be included.
Unlike drush_include this function will set errors if the requested engine cannot be found.
I really don't see anything confusing here, and I think we should close this old issue, since it has obviously been fixed.
Comment #3
greg.1.anderson commentedLooks fixed to me.