Exceptions
6 days ago
apache.php
6 days ago
apcu.php
6 days ago
array.php
6 days ago
bzip2.php
6 days ago
calendar.php
6 days ago
classobj.php
6 days ago
com.php
6 days ago
cubrid.php
6 days ago
curl.php
6 days ago
datetime.php
6 days ago
dir.php
6 days ago
eio.php
6 days ago
errorfunc.php
6 days ago
exec.php
6 days ago
fileinfo.php
6 days ago
filesystem.php
6 days ago
filter.php
6 days ago
fpm.php
6 days ago
ftp.php
6 days ago
funchand.php
6 days ago
functionsList.php
6 days ago
gmp.php
6 days ago
gnupg.php
6 days ago
hash.php
6 days ago
ibase.php
6 days ago
ibmDb2.php
6 days ago
iconv.php
6 days ago
image.php
6 days ago
imap.php
6 days ago
info.php
6 days ago
ingres-ii.php
6 days ago
inotify.php
6 days ago
json.php
6 days ago
ldap.php
6 days ago
libxml.php
6 days ago
lzf.php
6 days ago
mailparse.php
6 days ago
mbstring.php
6 days ago
misc.php
6 days ago
msql.php
6 days ago
mysql.php
6 days ago
mysqli.php
6 days ago
mysqlndMs.php
6 days ago
mysqlndQc.php
6 days ago
network.php
6 days ago
oci8.php
6 days ago
opcache.php
6 days ago
openssl.php
6 days ago
outcontrol.php
6 days ago
password.php
6 days ago
pcntl.php
6 days ago
pcre.php
6 days ago
pdf.php
6 days ago
pgsql.php
6 days ago
posix.php
6 days ago
ps.php
6 days ago
pspell.php
6 days ago
readline.php
6 days ago
rpminfo.php
6 days ago
rrd.php
6 days ago
sem.php
6 days ago
session.php
6 days ago
shmop.php
6 days ago
simplexml.php
6 days ago
sockets.php
6 days ago
sodium.php
6 days ago
solr.php
6 days ago
spl.php
6 days ago
sqlsrv.php
6 days ago
ssdeep.php
6 days ago
ssh2.php
6 days ago
stream.php
6 days ago
strings.php
6 days ago
swoole.php
6 days ago
uodbc.php
6 days ago
uopz.php
6 days ago
url.php
6 days ago
var.php
6 days ago
xdiff.php
6 days ago
xml.php
6 days ago
xmlrpc.php
6 days ago
yaml.php
6 days ago
yaz.php
6 days ago
zip.php
6 days ago
zlib.php
6 days ago
yaml.php
93 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ProfilePressVendor\Safe; |
| 4 | |
| 5 | use ProfilePressVendor\Safe\Exceptions\YamlException; |
| 6 | /** |
| 7 | * Convert all or part of a YAML document stream read from a file to a PHP variable. |
| 8 | * |
| 9 | * @param string $filename Path to the file. |
| 10 | * @param int $pos Document to extract from stream (-1 for all |
| 11 | * documents, 0 for first document, ...). |
| 12 | * @param int|null $ndocs If ndocs is provided, then it is filled with the |
| 13 | * number of documents found in stream. |
| 14 | * @param array $callbacks Content handlers for YAML nodes. Associative array of YAML |
| 15 | * tag => callable mappings. See |
| 16 | * parse callbacks for more |
| 17 | * details. |
| 18 | * @return mixed Returns the value encoded in input in appropriate |
| 19 | * PHP type. If pos is -1 an |
| 20 | * array will be returned with one entry for each document found |
| 21 | * in the stream. |
| 22 | * @throws YamlException |
| 23 | * |
| 24 | */ |
| 25 | function yaml_parse_file(string $filename, int $pos = 0, ?int &$ndocs = null, array $callbacks = null) |
| 26 | { |
| 27 | error_clear_last(); |
| 28 | $result = \yaml_parse_file($filename, $pos, $ndocs, $callbacks); |
| 29 | if ($result === \false) { |
| 30 | throw YamlException::createFromPhpError(); |
| 31 | } |
| 32 | return $result; |
| 33 | } |
| 34 | /** |
| 35 | * Convert all or part of a YAML document stream read from a URL to a PHP variable. |
| 36 | * |
| 37 | * @param string $url url should be of the form "scheme://...". PHP |
| 38 | * will search for a protocol handler (also known as a wrapper) for that |
| 39 | * scheme. If no wrappers for that protocol are registered, PHP will emit |
| 40 | * a notice to help you track potential problems in your script and then |
| 41 | * continue as though filename specifies a regular file. |
| 42 | * @param int $pos Document to extract from stream (-1 for all |
| 43 | * documents, 0 for first document, ...). |
| 44 | * @param int|null $ndocs If ndocs is provided, then it is filled with the |
| 45 | * number of documents found in stream. |
| 46 | * @param array $callbacks Content handlers for YAML nodes. Associative array of YAML |
| 47 | * tag => callable mappings. See |
| 48 | * parse callbacks for more |
| 49 | * @return mixed Returns the value encoded in input in appropriate |
| 50 | * PHP type. If pos is |
| 51 | * -1 an array will be returned with one entry |
| 52 | * for each document found in the stream. |
| 53 | * @throws YamlException |
| 54 | * |
| 55 | */ |
| 56 | function yaml_parse_url(string $url, int $pos = 0, ?int &$ndocs = null, array $callbacks = null) |
| 57 | { |
| 58 | error_clear_last(); |
| 59 | $result = \yaml_parse_url($url, $pos, $ndocs, $callbacks); |
| 60 | if ($result === \false) { |
| 61 | throw YamlException::createFromPhpError(); |
| 62 | } |
| 63 | return $result; |
| 64 | } |
| 65 | /** |
| 66 | * Convert all or part of a YAML document stream to a PHP variable. |
| 67 | * |
| 68 | * @param string $input The string to parse as a YAML document stream. |
| 69 | * @param int $pos Document to extract from stream (-1 for all |
| 70 | * documents, 0 for first document, ...). |
| 71 | * @param int|null $ndocs If ndocs is provided, then it is filled with the |
| 72 | * number of documents found in stream. |
| 73 | * @param array $callbacks Content handlers for YAML nodes. Associative array of YAML |
| 74 | * tag => callable mappings. See |
| 75 | * parse callbacks for more |
| 76 | * details. |
| 77 | * @return mixed Returns the value encoded in input in appropriate |
| 78 | * PHP type. If pos is -1 an |
| 79 | * array will be returned with one entry for each document found |
| 80 | * in the stream. |
| 81 | * @throws YamlException |
| 82 | * |
| 83 | */ |
| 84 | function yaml_parse(string $input, int $pos = 0, ?int &$ndocs = null, array $callbacks = null) |
| 85 | { |
| 86 | error_clear_last(); |
| 87 | $result = \yaml_parse($input, $pos, $ndocs, $callbacks); |
| 88 | if ($result === \false) { |
| 89 | throw YamlException::createFromPhpError(); |
| 90 | } |
| 91 | return $result; |
| 92 | } |
| 93 |