2

Is it possible to confgirue installation profile so it can be installed via web UI as usual but without any interaction, just the progress bar?

  • How would you plan to enter db details, etc? Nice idea though. – AyeshK May 10 '14 at 23:36
5

You can Install Drupal using Drush without interacting WEB UI. You have to use following command

drush dl drupal-7.x --drupal-project-rename=D7
cd D7
drush site-install standard --account-name=admin --account-pass=admin --db-url=mysql://YourMySQLUser:YourMySQLPassword@localhost/YourMySQLDatabase

Ofcourse You have to install Drush if not already installed and change Mysql Database details in command as per details.

Choose installation profile that you want to install

site-install standard OR site-install minimal

  • Thanks, I know about this but I want to do it via web UI. – user21641 May 11 '14 at 12:57
1

Yes, definitely.

You'd end up coding an install profile (PHP) that directly answers all config questions (site name, db name, db user, db password, and so on). It's not hard, but there's already Drush that does this very well so you could consider triggering Drush in the background (using it's "site-install" command), then there'd be no progress bar from Drupal (but instead your own custom form/page with a progress indicator until the server [Drush] finishes preparing the new site/domain/folder.

Personally, I'd use Drush and hide it behind an authenticated form. But, if you can't use Drush for this, then look into generating your own settings.php file (with $config variables for everything needed - site name, URL, db name/user/pass, etc.)

  • Is it possible to get status of the installation from the Drush via javascript so I could display the progress bar in web UI? – user21641 May 11 '14 at 12:59
  • Drush is a cli tool, you won't get it talking to a JavaScript client without setting something pretty non-standard up. Invoking a system command from PHP also brings in a bunch of security concerns that will have to be dealt with. It's generally considered a less desirable approach – Clive May 11 '14 at 13:41
  • You'd probably want to build you're own shell script that triggers Drush, and provides some feedback for your web UI. This is not uncommon, and the point about PHP calling shell scripts directly is of concern but experienced developers would know queueing requests in the background that fire shell scripts (with little or no user input data used) is a viable option. In a way, none of this is entirely new, you just need to cobble a couple things together to make this proper and seamless. – Chris Charlton May 11 '14 at 20:40
0

Well, simplytest.me does something like that, but it also involves shell scripts and so on (you need to select a contrib module to skip the installer). simplytest.me is open source, so you can look at what it does.

It's not possible to do it without changing the installer I believe, although in Drupal 7, it used to be possible to pass the language and profile to it through the URL and if you had the database settings already in settings.php, it started the batch immediately, that no longer works in D8 but could possibly be restored.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy