phive icon indicating copy to clipboard operation
phive copied to clipboard

Introduce global configuration

Open sebastianheuer opened this issue 8 years ago • 4 comments

Users should be able to change Phive's default (currently hardcoded) configuration for all new projects. The most relevant setting currently is the default tools directory. It should be possible to run phive config --global set toolsDirectory fooor something similar.

sebastianheuer avatar Jul 04 '16 09:07 sebastianheuer

I am in need of this feature too. It would be convenient to be able to set this via environment variable. This way, it would be perfectly usable in Docker Images.

sgohl avatar May 08 '19 10:05 sgohl

@port22 I see this issue still open, but global install is already possible:

For example to install PHPLOC in /usr/local/bin/phploc:

sudo phive install -g phploc --trust-gpg-keys 4AA394086372C20A

If what you want is a custom directory inside your project I suggest you to use <configuration> tag inside your phive.xml/phars.xml. For example, do the following if you want to install your phar files in bin directory (as suggested by pds/skeleton):

<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
 <configuration>
    <targetDirectory>bin</targetDirectory>
  </configuration>
  <phar name="phploc" version="^7.0.1" installed="7.0.1" location="./bin/phploc" copy="false"/>
</phive>

Please note that phar's location also changed: location="./bin/phploc".

jawira avatar Aug 18 '20 21:08 jawira

@port22 Important: if you are using Phive to build Docker images use --copy option!

jawira avatar Aug 18 '20 21:08 jawira

I am guessing this issue is open because

It should be possible to run phive config --global set toolsDirectory foo or something similar.

Where 'something similar' probably isn't meant to be 'open file, look for key-attribute, change value, save & close file, run install command'.

imme-emosol avatar Aug 20 '20 15:08 imme-emosol