Sha256: 994ef8b1d67170fd7fa3f6416c16f2ee5aed5514dd050a7216ef9127ee154ac0

Contents?: true

Size: 740 Bytes

Versions: 51

Compression:

Stored size: 740 Bytes

Contents

# frozen_string_literal: true

require 'avm/instances/entry_keys'
require 'avm/stereotypes/eac_webapp_base0/instance'

module Avm
  module Stereotypes
    module EacWordpressBase0
      class Instance < ::Avm::Stereotypes::EacWebappBase0::Instance
        FILES_UNITS = { uploads: 'wp-content/uploads', themes: 'wp-content/themes' }.freeze

        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
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
avm-tools-0.68.0 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.67.0 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.66.0 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.65.0 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.64.2 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.64.1 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.64.0 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.63.0 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.62.4 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.62.3 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.62.2 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.62.1 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.62.0 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.61.0 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.60.0 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.59.0 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.58.1 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.58.0 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.57.0 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.56.0 lib/avm/stereotypes/eac_wordpress_base0/instance.rb