summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2018-02-08 13:24:38 +0100
committerRemi Collet <remi@remirepo.net>2018-02-08 13:24:38 +0100
commitb412ee5342b1ed43278ef87d75dfd9701a6fba7c (patch)
tree9c697ec32d9c96d5e64675c580662add9bf7e8bd /README.md
parent759a0b1cd5880d3571a2c0c9f57a28db903b341a (diff)
new function: array rpmdbinfo(string name [, bool full]);
Diffstat (limited to 'README.md')
-rw-r--r--README.md22
1 files changed, 21 insertions, 1 deletions
diff --git a/README.md b/README.md
index a53d7e4..9461c22 100644
--- a/README.md
+++ b/README.md
@@ -41,9 +41,10 @@ Allow to compare 2 EVR (epoch:version-release) strings. The return value is < 0
## rpminfo
- array rpminfo(string path [, bool full ]);
+ array rpminfo(string path [, bool full [, string &error]]);
Retrieve information from a rpm file, reading its metadata.
+If given `error` will be used to store error message instead of raising a warning.
The return value is a hash table, or false if it fails.
$ php -a
@@ -82,6 +83,25 @@ The return value is a hash table, or false if it fails.
php > echo $error;
Can't open 'missing.rpm': No such file or directory
+## rpmdbinfo
+
+ array rpmdbinfo(string path [, bool full ]);
+
+Retrieve information from rpm database about an installed package.
+The return value is an array of hash tables, or false if it fails.
+
+ $ php -a
+ php > print_r(rpmdbinfo("php"));
+ Array
+ (
+ [0] => Array
+ (
+ [Name] => php
+ [Version] => 7.2.2
+ [Release] => 1.fc27.remi
+ [Arch] => x86_64
+ )
+ )
----