rpm_get_tag
(PECL rpmreader >= 0.1.0)
rpm_get_tag — Retrieves a header tag from an RPM file
说明
rpm_get_tag ( resource$rpmr
, int $tagnum
) : mixed
rpm_get_tag() will retrieve a given tag from the RPM file's header and return it.
参数
rpmr
A file pointer resource successfully opened by rpm_open().
tagnum
The tag number to retrieve from the RPM header. This value can be specified using the list of constants defined by this module.
返回值
The return value can be of various types depending on the
tagnum
supplied to the function.
范例
Example #1 rpm_get_tag() example
<?php
$file = "/path/to/file.rpm";
$rpmr = rpm_open($file);
$name = rpm_get_tag($rpmr, RPMREADER_NAME);
echo "$name<br>\n";
rpm_close($rpmr);
?>
参见
rpm_open() - Opens an RPM file rpm_close() - Closes an RPM file
User Contributed Notes 1 note
up down 0 nrsocial at gmail dot com ¶5 years ago
When getting the tags RPMREADER_REQUIREFLAGS, RPMREADER_CONFLICTFLAGS, RPMREADER_PROVIDEFLAGS, OBSOLETEFLAGS, the values correspond to the following:
2 - <
4 - >
8 - = OR ==
10 - <= OR =<
12 - >= OR =>
add a note
官方地址:https://www.php.net/manual/en/function.rpm-get-tag.php