phive
phive copied to clipboard
Symlink gets overwritten when PHAR is installed twice from different sources
trafficstars
$ phive install phpab
(...)
Linking phpab-1.20.0.phar to /Users/sebastian/projects/php/phive/tools/phpab
leads to the following phive.xml:
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpab" version="*" installed="1.20.0" location="./tools/phpab"/>
</phive>
Installing phpab from GitHub afterwards:
$ phive install theseer/autoload
(...)
Linking phpab-1.22.0.phar to /Users/sebastian/projects/php/phive/tools/phpab
now the original phpab symlink has been overwritten, and phive.xml contains both entries:
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpab" version="*" installed="1.20.0" location="./tools/phpab"/>
<phar name="theseer/autoload" version="*" installed="1.22.0" location="./tools/phpab"/>
</phive>
Plan of attack (not complete):
- refactor
phive.xml:- add "method" attribute to phar nodes ("github", "alias", "url")
- add child node to phar nodes containing source information for the method (alias name, repository url, ...)
- phar name will be determined by the resolver, alias is only used in source information
Be careful with that. Subnodes in XML should not depend on the value of an attribute in the parent node.
Blocked by #109