diff options
author | Remi Collet <remi@remirepo.net> | 2018-01-30 17:36:04 +0100 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2018-01-30 17:36:04 +0100 |
commit | 47013783578b41a000b755e2726f057ecd4cd1cb (patch) | |
tree | 6a56d22ecf1e798c7889a6fc15eaf6bc005941e7 /README.md | |
parent | cf809b71d4344aeb93378a577abc1ea18a3df323 (diff) |
add option to retrieve error message instead of raising a warning
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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 + ---- |