mirror of
https://github.com/php/php-src.git
synced 2026-03-27 01:32:22 +01:00
The $Id$ keywords were used in Subversion where they can be substituted with filename, last revision number change, last changed date, and last user who changed it. In Git this functionality is different and can be done with Git attribute ident. These need to be defined manually for each file in the .gitattributes file and are afterwards replaced with 40-character hexadecimal blob object name which is based only on the particular file contents. This patch simplifies handling of $Id$ keywords by removing them since they are not used anymore.
57 lines
1.1 KiB
PHP
57 lines
1.1 KiB
PHP
--TEST--
|
|
XMLReader: libxml2 XML Reader, setRelaxNGSchema
|
|
--SKIPIF--
|
|
<?php if (!extension_loaded("xmlreader")) print "skip"; ?>
|
|
--FILE--
|
|
<?php
|
|
|
|
$xmlstring = '<TEI.2>hello</TEI.2>';
|
|
$relaxngfile = dirname(__FILE__) . '/relaxNG.rng';
|
|
$file = dirname(__FILE__) . '/_007.xml';
|
|
file_put_contents($file, $xmlstring);
|
|
|
|
$reader = new XMLReader();
|
|
$reader->open($file);
|
|
|
|
if ($reader->setRelaxNGSchema($relaxngfile)) {
|
|
while ($reader->read());
|
|
}
|
|
if ($reader->isValid()) {
|
|
print "file relaxNG: ok\n";
|
|
} else {
|
|
print "file relaxNG: failed\n";
|
|
}
|
|
$reader->close();
|
|
unlink($file);
|
|
|
|
|
|
$reader = new XMLReader();
|
|
$reader->XML($xmlstring);
|
|
|
|
if ($reader->setRelaxNGSchema($relaxngfile)) {
|
|
while ($reader->read());
|
|
}
|
|
if ($reader->isValid()) {
|
|
print "string relaxNG: ok\n";
|
|
} else {
|
|
print "string relaxNG: failed\n";
|
|
}
|
|
|
|
$reader->close();
|
|
|
|
$reader = new XMLReader();
|
|
$reader->XML($xmlstring);
|
|
|
|
if ($reader->setRelaxNGSchema('')) {
|
|
echo 'failed';
|
|
}
|
|
$reader->close();
|
|
?>
|
|
===DONE===
|
|
--EXPECTF--
|
|
file relaxNG: ok
|
|
string relaxNG: ok
|
|
|
|
Warning: XMLReader::setRelaxNGSchema(): Schema data source is required in %s on line %d
|
|
===DONE===
|