Skip to content

PHP binary with arguments #46

@plandolt

Description

@plandolt

On the Task composer:install_executable which executes

task :install_executable do
    on release_roles(fetch(:composer_roles)) do
      within shared_path do
        unless test "[", "-e", "composer.phar", "]"
          composer_version = fetch(:composer_version, nil)
          composer_version_option = composer_version ? "-- --version=#{composer_version}" : ""
          execute :curl, "-s", fetch(:composer_download_url), "|", :php, composer_version_option
        end
      end
    end
  end

I need to change the php binary including its arguments.

The default commend which is being executed looks like this:
curl -s https://getcomposer.org/installer | php

What I need is:
curl -s https://getcomposer.org/installer | php56 -d allow_url_fopen=On

What I already know does not work:

  • Can't use the command_map because only the first argument of a execute statement gets resolved with the command_map
  • Can't use the workaround with fetch(:default_env).merge!(PATH: '$PATH:/usr/bin/php56 -d allow_url_fopen=On')

The only viable solution I see is the change the lib code :php to fetch(:php) (or similar) to be able to define the php binary (with its argument) with set :php, 'php -d allow_url_fopen=On'. Is this true or am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions