PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 3.1.0
Defender Security – Malware Scanner, Login Security & Firewall v3.1.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / vendor / thecodingmachine / safe / generated / xml.php

xml.php in Defender Security – Malware Scanner, Login Security & Firewall 3.1.0, at vendor/thecodingmachine/safe/generated/xml.php

96 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Safe;
4
5 use Safe\Exceptions\XmlException;
6
7 /**
8 * xml_parser_create_ns creates a new XML parser
9 * with XML namespace support and returns a resource handle referencing
10 * it to be used by the other XML functions.
11 *
12 * @param string $encoding The input encoding is automatically detected, so that the
13 * encoding parameter specifies only the output
14 * encoding. In PHP 5.0.0 and 5.0.1, the default output charset is
15 * ISO-8859-1, while in PHP 5.0.2 and upper is UTF-8. The supported
16 * encodings are ISO-8859-1, UTF-8 and
17 * US-ASCII.
18 * @param string $separator With a namespace aware parser tag parameters passed to the various
19 * handler functions will consist of namespace and tag name separated by
20 * the string specified in separator.
21 * @return resource Returns a resource handle for the new XML parser.
22 * @throws XmlException
23 *
24 */
25 function xml_parser_create_ns(string $encoding = null, string $separator = ":")
26 {
27 error_clear_last();
28 if ($separator !== ":") {
29 $result = \xml_parser_create_ns($encoding, $separator);
30 } elseif ($encoding !== null) {
31 $result = \xml_parser_create_ns($encoding);
32 } else {
33 $result = \xml_parser_create_ns();
34 }
35 if ($result === false) {
36 throw XmlException::createFromPhpError();
37 }
38 return $result;
39 }
40
41
42 /**
43 * xml_parser_create creates a new XML parser
44 * and returns a resource handle referencing it to be used by the
45 * other XML functions.
46 *
47 * @param string $encoding The optional encoding specifies the character
48 * encoding for the input/output in PHP 4. Starting from PHP 5, the input
49 * encoding is automatically detected, so that the
50 * encoding parameter specifies only the output
51 * encoding. In PHP 4, the default output encoding is the same as the
52 * input charset. If empty string is passed, the parser attempts to identify
53 * which encoding the document is encoded in by looking at the heading 3 or
54 * 4 bytes. In PHP 5.0.0 and 5.0.1, the default output charset is
55 * ISO-8859-1, while in PHP 5.0.2 and upper is UTF-8. The supported
56 * encodings are ISO-8859-1, UTF-8 and
57 * US-ASCII.
58 * @return resource Returns a resource handle for the new XML parser.
59 * @throws XmlException
60 *
61 */
62 function xml_parser_create(string $encoding = null)
63 {
64 error_clear_last();
65 if ($encoding !== null) {
66 $result = \xml_parser_create($encoding);
67 } else {
68 $result = \xml_parser_create();
69 }
70 if ($result === false) {
71 throw XmlException::createFromPhpError();
72 }
73 return $result;
74 }
75
76
77 /**
78 * This function allows to use parser inside
79 * object. All callback functions could be set with
80 * xml_set_element_handler etc and assumed to be
81 * methods of object.
82 *
83 * @param resource $parser A reference to the XML parser to use inside the object.
84 * @param object $object The object where to use the XML parser.
85 * @throws XmlException
86 *
87 */
88 function xml_set_object($parser, object &$object): void
89 {
90 error_clear_last();
91 $result = \xml_set_object($parser, $object);
92 if ($result === false) {
93 throw XmlException::createFromPhpError();
94 }
95 }
96