Class: Avm::EacWordpressBase0::Instance

Inherits:
Avm::EacWebappBase0::Instance show all
Defined in:
lib/avm/eac_wordpress_base0/instance.rb

Constant Summary collapse

FILES_UNITS =
{ uploads: 'wp-content/uploads', themes: 'wp-content/themes' }.freeze

Constants inherited from Instances::Base

Instances::Base::ID_PATTERN

Instance Method Summary collapse

Methods inherited from Avm::EacWebappBase0::Instance

#data_dump, #data_dump_runner_class, #data_package, #run_subcommand, #stereotype_name

Methods included from Postgresql::InstanceWith

#pg

Methods inherited from Instances::Base

by_id, #host_env_uncached, #id, #to_s

Methods included from Instances::Entries

#entry, #full_entry_path, #inherited_entry_value, #other_entry_value, #path_prefix, #read_entry, #read_entry_optional

Instance Method Details

#database_unitObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/avm/eac_wordpress_base0/instance.rb', line 11

def database_unit
  web_url = read_entry(::Avm::Instances::EntryKeys::WEB_URL)
  super.after_load do
    info 'Fixing web addresses...'
    run_sql(<<~SQL)
      update wp_options
      set option_value = '#{web_url}'
      where option_name in ('siteurl', 'home')
    SQL
  end
end