diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 88 |
1 files changed, 85 insertions, 3 deletions
@@ -2,7 +2,11 @@ Retrieve RPM information from PHP code using librpm. -**Notice**: this is a experimental extension, a work in progress, so don't expect a stable API yet. +This extension can be considered as stable, and be used on production environement. + +But be aware that if its API will probably stay stable, +some changes may occur before version 1.0.0. + ---- @@ -97,8 +101,86 @@ The return value is an array of hash tables, or false if it fails. [0] => Array ( [Name] => php - [Version] => 7.2.2 - [Release] => 1.fc27.remi + [Version] => 7.3.5 + [Release] => 1.fc31.remi + [Summary] => PHP scripting language for creating dynamic web sites + [Arch] => x86_64 + ) + ) + +Retrieve information from rpm database about installed packages using glob or regex. +The return value is an array of hash tables, or false if it fails. + + $ php -a + php > print_r(rpmdbsearch("php-pecl-r*", RPMTAG_NAME, RPMMIRE_GLOB)); + Array + ( + [0] => Array + ( + [Name] => php-pecl-radius + [Version] => 1.4.0 + [Release] => 0.10.b1.fc31 + [Summary] => Radius client library + [Arch] => x86_64 + ) + [1] => Array + ( + [Name] => php-pecl-redis5 + [Version] => 5.2.0 + [Release] => 1.fc31.remi.7.3 + [Summary] => Extension for communicating with the Redis key-value store + [Arch] => x86_64 + ) + [2] => Array + ( + [Name] => php-pecl-rpminfo + [Version] => 0.2.3 + [Release] => 1.fc31.remi.7.3 + [Summary] => RPM information + [Arch] => x86_64 + ) + ) + + $ php -a + php > print_r(rpmdbsearch("^php-pecl-r", RPMTAG_NAME, RPMMIRE_REGEX)); + Array + ( + [0] => Array + ( + [Name] => php-pecl-radius + [Version] => 1.4.0 + [Release] => 0.10.b1.fc31 + [Summary] => Radius client library + [Arch] => x86_64 + ) + [1] => Array + ( + [Name] => php-pecl-redis5 + [Version] => 5.2.0 + [Release] => 1.fc31.remi.7.3 + [Summary] => Extension for communicating with the Redis key-value store + [Arch] => x86_64 + ) + [2] => Array + ( + [Name] => php-pecl-rpminfo + [Version] => 0.2.3 + [Release] => 1.fc31.remi.7.3 + [Summary] => RPM information + [Arch] => x86_64 + ) + ) + + $ php -a + php > print_r(rpmdbsearch(PHP_BINARY, RPMTAG_INSTFILENAMES)); + Array + ( + [0] => Array + ( + [Name] => php-cli + [Version] => 7.3.15 + [Release] => 1.fc31.remi + [Summary] => Command-line interface for PHP [Arch] => x86_64 ) ) |