PHP code example of wildlyinaccurate / rpminfo
1. Go to this page and download the library: Download wildlyinaccurate/rpminfo library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wildlyinaccurate / rpminfo example snippets
$query = new RPMInfo\Query('package-name');
$info = $query->getInfo();
// Package information can be accessed using array or object syntax:
$info['name'];
$info->name;
// The following fields are available:
$info->name;
$info->version;
$info->release;
$info->install_date;
$info->group;
$info->size;
$info->signature;
$info->url;
$info->summary;
$info->description;
$info->relocations;
$info->vendor;
$info->build_date;
$info->build_host;
$info->source_rpm;
$info->license;
$packageInfo = <<<EOL
Name : basesystem Relocations: (not relocatable)
Version : 8.0 Vendor: CentOS
EOL;
$parser = new RPMInfo\Parser;
$info = $parser->parse($packageInfo);
echo $info->name; // "basesystem"
echo $info->relocations; // "(not relocatable)"
echo $info->version; // "8.0"
echo $info->vendor; // "CentOS"