--FILE--
<?php
$dom = new domdocument;
-$dom->load(dirname(__FILE__)."/xinclude.xml");
+
+$data = file_get_contents(dirname(__FILE__)."/xinclude.xml");
+$data = str_replace('compress.zlib://ext/dom/tests/','compress.zlib://'.dirname(__FILE__).'/', $data);
+
+$dom->loadXML($data);
+
$dom->xinclude();
print $dom->saveXML()."\n";
foreach ($dom->documentElement->childNodes as $node) {
print $node->nodeName."\n";
}
-
---EXPECT--
+?>
+--EXPECTF--
<?xml version="1.0"?>
<foo xmlns:xi="http://www.w3.org/2001/XInclude">
- <book xml:base="compress.zlib://ext/dom/tests/book.xml">
+ <book xml:base="compress.zlib://%sext/dom/tests/book.xml">
<title>The Grapes of Wrath</title>
<author>John Steinbeck</author>
- </book><book xml:base="compress.zlib://ext/dom/tests/book.xml">
+ </book><book xml:base="compress.zlib://%sext/dom/tests/book.xml">
<title>The Pearl</title>
<author>John Steinbeck</author>
</book>
--FILE--
<?php
+$pfx = str_repeat('../', substr_count($_SERVER['PHP_SELF'], '../'));
+
// Relative path
-$fp = fopen("compress.zlib://ext/xsl/tests/xslt.xsl.gz", "rb");
+$fp = fopen("compress.zlib://{$pfx}ext/xsl/tests/xslt.xsl.gz", "rb");
fclose($fp);
// Absolute path