In a installation profile, how do I fill values for Set up database step programmatically and hide it so user doesn't need to fill the form?
How to do the above action for the Select language step?
|
In a installation profile, how do I fill values for Set up database step programmatically and hide it so user doesn't need to fill the form? How to do the above action for the Select language step? |
||||
|
|
|
You wanted an example -- which is basically showing you how to do it. From the docs I supplied and the help others that gave you cookie crumbs provided should have lead you towards a solution, Other than saying "show me" all the code. A working profile example is in this GIST, you make a Be sure to change the $databases['default']['default'] in line 47 of .profile to the existing database credentials that will work in your environment. Look for my comments in the code to change the db credentials and db password (line 125 of .profile). |
|||
|
|
Database credentials are set in settings.php. So you'd provide a settings.php with your distribution, or you'd write out the db array to the settings.php at some point during installation. You could do this in an installation profile, with Same caveats as tenken... I haven't done this. |
|||||||||||
|
|
Fair warning I haven' done this before (but I have made install profiles and used them via Drush Make). So I was interested in how you might try to do this ... I found this documentation page, How To Write a Drupal 7 Installation Profile I assume you are using the 'Miminal' or 'Standard' defaults in your profile to save you some headache, or else you'd know the answer to your own question in building a complete profile from scratch ... I think you need to do 2 things: (1) If you're using the minimal or standard defaults you can use hook_install_tasks_alter() to change the visibility of the database Step to hidden. If your defining your own install tasks via hook_install_tasks() in yourprofile.profile (2) You need to provide the database parameters. You can do that probably most straight-forwardly via hook_form_alter() as described in the documentation page linked above. You may also be able to muck with the values in $install_state for hook_install_tasks as described in install_state_defaults() I suggest you read up on all these hook functions and the documentation page above. good luck. |
|||
|