Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create phive.xml #332

Closed
glensc opened this issue Dec 1, 2021 · 7 comments
Closed

How to create phive.xml #332

glensc opened this issue Dec 1, 2021 · 7 comments

Comments

@glensc
Copy link

glensc commented Dec 1, 2021

https://phar.io/ has an example:

# Install all phar files declared in phive.xml
phive install

but the same page has no info how to create phive.xml or what's it's format

not even this project readme has anything:

@theseer
Copy link
Member

theseer commented Dec 1, 2021

The file is auto-generated when phive is regularly used to install things.
Granted, the format should be documented, thus: #306

Otherwise, duplicate of #306

@theseer theseer closed this as completed Dec 1, 2021
@glensc
Copy link
Author

glensc commented Dec 1, 2021

For me phive-0.15.0 generated .phive/phars.xml, not phive.xml.

➔ phive install composer
Phive 0.15.0 - Copyright (C) 2015-2021 by Arne Blankerts, Sebastian Heuer and Contributors
Linking /Users/glen/.phive/phars/composer-2.1.14.phar to /private/tmp/phive/tools/composer

➔ find
.
./tools
./tools/composer
./.phive
./.phive/phars.xml
➔

aside, what is the meaning of "regularly used to install things"? if I invoke phive 10 times it will start creating a different file? 😕

@theseer
Copy link
Member

theseer commented Dec 1, 2021

The .phive/phars.xml is the new and alternative location used by default in case no traditional phive.xml was found. It's technically a combination of composer.json and composer.lock.

Given that phive will manage that file for you, there should be no reason to manually create this file (== regular use).

@glensc
Copy link
Author

glensc commented Dec 1, 2021

Does not seem correct.

From my local test, it's exactly the opposite:

  • by default phive uses .phive/phars.xml

Try yourself running phive install composer in an empty directory.

After I mv .phive/phars.xml phive.xml phive starts to manage phive.xml

@theseer
Copy link
Member

theseer commented Dec 1, 2021

That's exactly what I wrote?

@glensc
Copy link
Author

glensc commented Dec 1, 2021

You wrote 1:

The file is auto-generated when phive is regularly used to install things.

You wrote 2:

Given that phive will manage that file for you, there should be no reason to manually create this file (== regular use).

@theseer
Copy link
Member

theseer commented Dec 1, 2021

You lost me.

I'll try again:

  • Phive stores its state in either .phive/phars.xml (newer versions) or phive.xml (older versions)
  • If neither file exists, the newer versions of phive will create .phive/phars.xml automagically upon first use of phive install <whatever>, older versions may still create the old phive.xml. Their content is currently identical.
  • If a phive.xml exists, it will be used - even by newer versions of phive - and kept up to date.
  • A command exists to migrate the old to the new location, if a user is interested
  • We are not aware of any reason to manually create either file
  • There may be of course be edge cases where editing the state file may come in handy, so we indeed should document it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants