Relaxing package.xml v2 XSD
| From: | Philippe Jausions | Date: | Thu, 01 May 2008 16:09:55 +0000 |
| Subject: | Relaxing package.xml v2 XSD | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-49950@lists.php.net to get a copy of this message | ||
Hi,
The current XSD for package.xml version 2
(http://pear.php.net/dtd/package-2.0.xsd), doesn't allow simple nested
folder structures without files in them. So the following doesn't pass
XML Schema validation (barring typos):
<contents>
<dir name="/">
<dir name="docs">
<dir name="examples">
<file name="example1.php" role="doc" />
</dir>
</dir>
</dir>
</contents>
For documentation that is not a huge issue to move the content up one
level, but it makes things more difficult for packages that are
extensions to existing packages. For instance:
<contents>
<dir name="/">
<dir name="HTML">
<dir name="QuickForm">
<dir name="Rule">
<file name="MyRule.php" type="php" />
</dir>
</dir>
</dir>
</dir>
</contents>
The reason of the above layout is to easily add the base dir of the
package into the include_path without having to package it first, then
install and generally going through hops, so a simple "reguire_once
'HTML/QuickForm/Rule/MyRule.php';" actually finds the file. That greatly
speeds up development.
According to the XSD the XML snippet above would have to be written (or
something of that sort):
<contents>
<dir name="/" baseinstall="HTML/QuickForm/Rule">
<file name="MyRule.php" type="php" />
</dir>
</contents>
To be clear, this is to speed up prototyping, coding, testing and
maintaining the package. The less time we have to juggle local and
install destination, the better. Especially when it comes to complex
packages. It makes it easier to prototype, then package the files.
Anyone has any suggestions to remedy this trouble?
Would it be huge deal breaker to anyone to allow <dir> to not contain
files, but just sub-<dir>?
Thanks,
-Philippe