Instead of having a bunch of drush commandfiles that simply respond to the command being called directly, we need to re-factor the commandfiles into general services.
Hence, instead of provision/web_server/provision_apache.drush.inc , we will have provision/http/http.drush.inc.
This file will contain a "Service class", which contains the methods that will need to be implemented to operate it. In the example of the http service, it will contain methods such as $http->create_virtual_host() , $http->reload_configs().
Inside the http commandfile directory, we will have a sub directory for each implementation of these classes , such as :
provision/http/apache/apache.service.inc - Which will contain a subclass of the main service class, ie: an actual implementation.
When we invoke the backend, we will use a command line option such as "--http-service-type=apache" , to decide which of the implementations to make use of.
Inside the provision/http directory, we will still have the "verify.provision.inc" , "install.provision.inc" conditional includes, which will react to the commands at the right intervals, but instead of calling provision_apache directly, we will be passing calls to the service class instance.
There should also be a 'null' implementation, when a specific service should not be used.
Comments
Comment #1
adrian commentedthis is practically done in the dev-services branch, except for the service-type switch, which is in the dev-envobject branch.
Comment #2
adrian commentedThis is done.