PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, August 31, 2022

[FIXED] How to strip down paths in package.xml via file-tag?

 August 31, 2022     pear, php     No comments   

Issue

Im trying to simplify my package.xml file, because it contains many of this

<phprelease>
    <filelist>
        <install as="path/to/my/Class.php" name="classes/path/to/my/Class.php" />
        <!-- Many more of this -->
    </filelist>
</phprelease>

According the Manual, it should be possible, to strip relative paths by using the baseinstalldir-attribute, but its either (a kind of) ignored, or leads to curious pathnames. For example

<dir name="/">
  <dir name="classes">
    <file baseinstalldir="/path/to/my" name="path/to/my/Class.php" role="php" />
  </dir>
</dir>

installs the file into path/to/my/classes/path/to/my/Class.php, that is obvious crap.

Does anyone knows a solution to strip one folder from the path, that does not require a big bunch of install-as-elements?

Update:

It seems, that the pear packager rewrites package.xml, before it puts it into the package. One of the steps it performs is, that it flattens the contents-section.

<dir name="/">
  <dir name="classes">
    <file baseinstalldir="/path/to/my" name="path/to/my/Class.php" role="php" />
  </dir>
</dir>

becomes

<dir name="/">
  <file baseinstalldir="/path/to/my" name="classses/path/to/my/Class.php" role="php" />
</dir>

The installer resolve this to path/to/my/classes/path/to/my/Class.php of course...


Solution

PEAR does not support what you want (that is, package.xml v2.0).

Pyrus supports package.xml v2.1 which behaves exactly as you expect it.



Answered By - cweiske
Answer Checked By - Mildred Charles (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing