From 47013783578b41a000b755e2726f057ecd4cd1cb Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 30 Jan 2018 17:36:04 +0100 Subject: add option to retrieve error message instead of raising a warning --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index d572920..cbdc106 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ The return value is a hash table, or false if it fails. [Release] => 1.fc25.remi [Arch] => x86_64 ) + php > print_r(rpminfo("tests/bidon.rpm", true)); Array ( @@ -66,6 +67,16 @@ The return value is a hash table, or false if it fails. ... [IsSource] => ) + + php > var_dump(rpminfo("missing.rpm")); + Warning: rpminfo(): Can't open 'missing.rpm': No such file or directory in php shell code on line 1 + bool(false) + + php > var_dump(rpminfo("missing.rpm", false, $error)); + bool(false) + php > echo $error; + Can't open 'missing.rpm': No such file or directory + ---- -- cgit