Method: Typo3Helper.make_set_localconf_database_settings_command

Defined in:
lib/capistrano/typo3/typo3_helper.rb

.make_set_localconf_database_settings_command(db, user, password, host = 'localhost') ⇒ Object

replaces database settings in the localconf file



194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/capistrano/typo3/typo3_helper.rb', line 194

def self.make_set_localconf_database_settings_command(db,user,password,host='localhost')
    cmd1 = "php -r \'define(\"TYPO3_MODE\", \"BE\");" \
      "$arr = include \"#{fetch(:typo3_v6_local_conf_path)}\"; " \
      "echo \"<?php\\n\";" \
      "echo \"return \";" \
      "$arr[\"DB\"][\"username\"]=\"#{user}\"; " \
      "$arr[\"DB\"][\"database\"]=\"#{db}\";" \
      "$arr[\"DB\"][\"password\"]=\"#{password}\";" \
      "$arr[\"DB\"][\"host\"]=\"#{host}\";" \
      "var_export($arr);" \
      "echo \";\\n?>\";\'" \
      "> #{fetch(:typo3_v6_local_conf_path)}.tmp"
    cmd1
end