2

I would like to add lines to my settings.php during my custom installation. I'm using some $conf['...'] to match external content to my drupal and i would like not to do this by modifying directly the file. During my custom install i want to use the external content to have a fully operational website after running my script.

Do you have an idea how i can do this ?

Thanks.

  • "I would like to add lines to my settings.php during my custom installation...i would like not to do this by modifying directly the file" You have an irreconcilable contradiction there. The only way to add lines to a file is by modifying it. – Clive Apr 23 '15 at 13:38
  • Thanks for your answer. I thought it would be possible in a task with something like 'install_settings'. Currently i'm copying the default.settings to a default, i append what i want with an echo and then run the site-install. It's not the best but it's the only way i found. – azeazeaze Apr 23 '15 at 13:48
2

Checkout this post about Collecting and writing configuration settings to setting.php from an install profile.

It describes how a custom task (via hook_install_tasks_alter()) was injected into the installation profile to display a custom form and, upon submission, how drupal_rewrite_settings() can be used to inject the custom settings into settings.php.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.