From df3b2b652f29b74b524f3ceeb37169244ff5732f Mon Sep 17 00:00:00 2001 From: Brandon Amaro Date: Mon, 18 May 2020 01:49:36 -0700 Subject: Bug fix and new features. --- examples/librpm.php | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'examples') diff --git a/examples/librpm.php b/examples/librpm.php index 98a7f8d..bed896e 100644 --- a/examples/librpm.php +++ b/examples/librpm.php @@ -59,22 +59,74 @@ abstract class Common { if (isset($this->info['Requirename'])) { return $this->_dep($this->info['Requirename'], $this->info['Requireflags'], $this->info['Requireversion']); } + else + { + return NULL; + } case 'Conflicts': if (isset($this->info['Conflictname'])) { return $this->_dep($this->info['Conflictname'], $this->info['Conflictflags'], $this->info['Conflictversion']); } + else + { + return NULL; + } case 'Obsoletes': if (isset($this->info['Obsoletename'])) { return $this->_dep($this->info['Obsoletename'], $this->info['Obsoleteflags'], $this->info['Obsoleteversion']); } + else + { + return NULL; + } case 'Provides': if (isset($this->info['Providename'])) { return $this->_dep($this->info['Providename'], $this->info['Provideflags'], $this->info['Provideversion']); } + else + { + return NULL; + } + case 'Recommends': + if (isset($this->info['Recommendname'])) { + return $this->_dep($this->info['Recommendname'], $this->info['Recommendflags'], $this->info['Recommendversion']); + } + else + { + return NULL; + } + case 'Suggests': + if (isset($this->info['Suggestname'])) { + return $this->_dep($this->info['Suggestname'], $this->info['Suggestflags'], $this->info['Suggestversion']); + } + else + { + return NULL; + } + case 'Supplements': + if (isset($this->info['Supplementname'])) { + return $this->_dep($this->info['Supplementname'], $this->info['Supplementflags'], $this->info['Supplementversion']); + } + else + { + return NULL; + } + case 'Enhances': + if (isset($this->info['Enhancename'])) { + return $this->_dep($this->info['Enhancename'], $this->info['Enhanceflags'], $this->info['Enhanceversion']); + } + else + { + return NULL; + } case 'Files': if (isset($this->info['Basenames'])) { return $this->_files(); } + else + { + return NULL; + } default: if (isset($this->info[$name])) { return $this->info[$name]; -- cgit