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 Attribute Summary

Attributes inherited from Instances::Base

#application, #suffix

Attributes included from Instances::Base::Dockerizable

#docker_image_options

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, #initialize, #to_s

Methods included from Instances::Entries

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

Methods included from Instances::Base::Dockerizable

#docker_container_exist?, #docker_container_name

Constructor Details

This class inherits a constructor from Avm::Instances::Base

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