ClearFoundation

ClearOS API

Class Software

Description

Software package management tools.

The software classes contains information about a given RPM package. The software constructor requires the pkgname - release and version are optional. Why do you need the release and version? Some packages can have multiple version installed, notably the kernel.

If you do not specify the release and version name (which is the typical way to call this constructor), then this class will assume that you mean the most recent version.

Located in /api/Software.class.php (line 93)

Engine
   |
   --Software
Direct descendents
Class Description
Horde Horde class.
Daemon System daemons manager.
RoundCube RoundCube class.
Awstats Awstats class.
MailFilter Mail filter class.
Mrtg MRTG class.
Flexshare Flexshare class.
Squirrelmail Squirrelmail class.
Altermime Altermime e-mail class.
Gallery Photo gallery class.
Class Constant Summary
 COMMAND_RPM = '/bin/rpm'
Variable Summary
mixed $copyright
mixed $description
mixed $installsize
mixed $installtime
mixed $packager
mixed $pkgname
mixed $release
mixed $summary
mixed $version
Method Summary
Software __construct (string $pkgname, [string $version = ""], [string $release = ""])
void __destruct ()
string GetCopyright ()
string GetDescription ()
integer GetInstallSize ()
integer GetInstallTime ()
string GetPackageName ()
string GetPackager ()
string GetRelease ()
string GetRpmInfo (string $tag)
string GetSummary ()
string GetVersion ()
boolean IsInstalled ()
Variables
mixed $copyright = null (line 100)
  • access: protected
mixed $description = null (line 101)
  • access: protected
mixed $installsize = null (line 102)
  • access: protected
mixed $installtime = null (line 103)
  • access: protected
mixed $packager = null (line 104)
  • access: protected
mixed $pkgname = null (line 99)
  • access: protected
mixed $release = null (line 105)
  • access: protected
mixed $summary = null (line 106)
  • access: protected
mixed $version = null (line 107)
  • access: protected

Inherited Variables

Inherited from Engine

Engine::$errors
Methods
Constructor __construct (line 123)

Software constructor.

Software __construct (string $pkgname, [string $version = ""], [string $release = ""])
  • string $pkgname: software package name
  • string $release: release number (optional)
  • string $version: version number (optional)

Redefinition of:
Engine::__construct()
Engine constructor.

Redefined in descendants as:
GetCopyright (line 146)

Returns the copyright of the software - eg GPL.

  • return: copyright
  • throws: EngineException, SoftwareNotInstalledException
string GetCopyright ()
GetDescription (line 167)

Returns a long description in text format.

Descriptions can be anywhere from one-sentence long to several paragraphs.

  • return: description
  • throws: EngineException, SoftwareNotInstalledException
string GetDescription ()
GetInstallSize (line 186)

Returns the installed size (not the download size).

  • return: install size in bytes
  • throws: EngineException, SoftwareNotInstalledException
integer GetInstallSize ()
GetInstallTime (line 205)

Returns install time in seconds since Jan 1, 1970.

  • return: install time
  • throws: EngineException, SoftwareNotInstalledException
integer GetInstallTime ()
GetPackageName (line 224)

Returns the package name.

  • return: package name
  • throws: EngineException, SoftwareNotInstalledException
string GetPackageName ()
GetPackager (line 240)

Returns the packager.

  • return: packager
  • throws: EngineException, SoftwareNotInstalledException
string GetPackager ()
GetRelease (line 261)

Returns the release.

The release is not necessarily numeric!

  • return: release
  • throws: EngineException, SoftwareNotInstalledException
string GetRelease ()
GetRpmInfo (line 367)

Generic function to grab information from the RPM database.

There are dozens of bits of information in an RPM file accessible via the "rpm -q --queryformat" command. See list of tags at http://www.rpm.org/max-rpm-snapshot/ch-queryformat-tags.html

  • return: value from queryformat command
  • throws: EngineException, SoftwareNotInstalledException
string GetRpmInfo (string $tag)
  • string $tag: queryformat tag in RPM
GetSummary (line 301)

Returns a one-line description.

  • return: description
  • throws: EngineException, SoftwareNotInstalledException
string GetSummary ()
GetVersion (line 282)

Returns the version.

The version is not necessarily numeric!

  • return: version
  • throws: EngineException, SoftwareNotInstalledException
string GetVersion ()
IsInstalled (line 320)

Returns true if the package is installed.

  • return: true if package is installed
  • throws: EngineException, SoftwareNotInstalledException
boolean IsInstalled ()

Inherited Methods

Inherited From Engine

Engine::__construct()
Engine::AddValidationError()
Engine::CheckValidationErrors()
Engine::CopyValidationErrors()
Engine::GetValidationErrors()
Engine::Log()
Engine::__destruct()
Class Constants
COMMAND_RPM = '/bin/rpm' (line 109)

Inherited Constants

Inherited from Engine

Engine::COMMAND_API

Documentation generated on Fri, 28 Aug 2009 20:32:19 -0400 by phpDocumentor 1.3.2