Class: ShopifyCLI::PHPDeps

Inherits:
Object
  • Object
show all
Includes:
SmartProperties
Defined in:
lib/shopify_cli/php_deps.rb

Overview

ShopifyCLI::PHPDeps ensures that all PHP dependencies are installed for projects.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.install(ctx, verbose = false) ⇒ Object

Proxy to instance method ShopifyCLI::PHPDeps.new.install.

#### Parameters

  • ‘ctx`: running context from your command

  • ‘verbose`: whether to run the installation tools in verbose mode

#### Example

ShopifyCLI::PHPDeps.install(ctx)


23
24
25
# File 'lib/shopify_cli/php_deps.rb', line 23

def self.install(ctx, verbose = false)
  new(ctx: ctx).install(verbose)
end

Instance Method Details

#install(verbose = false) ⇒ Object

Installs all of a project’s PHP dependencies using Composer.

#### Parameters

  • ‘verbose`: whether to run the installation tools in verbose mode

#### Example

# context is the running context for the command
ShopifyCLI::PHPDeps.new(context).install(true)


38
39
40
41
42
43
44
45
46
# File 'lib/shopify_cli/php_deps.rb', line 38

def install(verbose = false)
  title = ctx.message("core.php_deps.installing")
  success = ctx.message("core.php_deps.installed")
  failure = ctx.message("core.php_deps.error.install_error")

  CLI::UI::Frame.open(title, success_text: success, failure_text: failure) do
    composer(verbose)
  end
end