略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: rpminfo

2024-11-13

rpminfo

(PECL rpminfo >= 0.1.0)

rpminfoGet information from a RPM file

说明

rpminfo(string $path, bool $full = false, string &$error = ?): array

Retrieve information about a local file, a RPM package.

参数

path

Path of the RPM file.

full

If true all information headers for the file are retrieved, else only a minimal set.

error

If provided, will receive the possible error message, and will avoid a runtime warning.

返回值

An array of information or NULL on error.

范例

示例 #1 A rpminfo() example

<?php
rpmaddtag
(RPMTAG_BUILDTIME);
$info rpminfo("./php-pecl-rpminfo-0.4.2-1.el8.remi.7.4.x86_64.rpm");
print_r($info);
?>

以上例程会输出:

Array
(
    [Name] => php-pecl-rpminfo
    [Version] => 0.4.2
    [Release] => 1.el8
    [Summary] => RPM information
    [Buildtime] => 1586244821
    [Arch] => x86_64
)

参见

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/function.rpminfo.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3