mirror of
https://github.com/php/php-src.git
synced 2026-04-17 04:51:03 +02: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.
45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
--TEST--
|
|
XMLWriter: PI, Comment, CDATA
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded("xmlwriter")) die("skip");
|
|
if (!function_exists("xmlwriter_start_comment")) die("skip: libxml2 2.6.7+ required");
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
/*
|
|
Libxml 2.6.24 and up adds a new line after a processing instruction (PI)
|
|
*/
|
|
$xw = xmlwriter_open_memory();
|
|
xmlwriter_set_indent($xw, TRUE);
|
|
xmlwriter_start_document($xw, NULL, "UTF-8");
|
|
xmlwriter_start_element($xw, 'root');
|
|
xmlwriter_write_attribute($xw, 'id', 'elem1');
|
|
xmlwriter_start_element($xw, 'elem1');
|
|
xmlwriter_write_attribute($xw, 'attr1', 'first');
|
|
xmlwriter_write_comment($xw, 'start PI');
|
|
xmlwriter_start_element($xw, 'pi');
|
|
xmlwriter_write_pi($xw, 'php', 'echo "hello world"; ');
|
|
xmlwriter_end_element($xw);
|
|
xmlwriter_start_element($xw, 'cdata');
|
|
xmlwriter_start_cdata($xw);
|
|
xmlwriter_text($xw, '<>&"');
|
|
xmlwriter_end_cdata($xw);
|
|
xmlwriter_end_element($xw);
|
|
xmlwriter_end_element($xw);
|
|
xmlwriter_end_element($xw);
|
|
xmlwriter_end_document($xw);
|
|
// Force to write and empty the buffer
|
|
$output = xmlwriter_flush($xw, true);
|
|
print $output;
|
|
?>
|
|
--EXPECTF--
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<root id="elem1">
|
|
<elem1 attr1="first">
|
|
<!--start PI-->
|
|
<pi><?php echo "hello world"; ?>%w</pi>
|
|
<cdata><![CDATA[<>&"]]></cdata>
|
|
</elem1>
|
|
</root>
|