Class CriticalI_Package

Description

Implements interfaces:

  • IteratorAggregate (internal interface)
  • ArrayAccess (internal interface)

A Package is a collection of one or more installed package versions.

It can be treated as a list (array) of installed versions. Accessing versions by numeric index provides a list of installed version in ascending order. Accessing versions by string index allows you access them by version number.

Located in /Core/lib/CriticalI/Package.php (line 13)


	
			
Direct descendents
Class Description
 class CriticalI_Project_Package CriticalI_Project_Package is a CriticalI_Package that has been installed within a project.
 class CriticalI_Remote_Package CriticalI_Remote_Package is a collection of CriticalI_Package versions available from one or more remote repository.
Variable Summary
 mixed $name
 mixed $versions
Method Summary
 CriticalI_Package __construct (string $name, string $verString, [array $dirs = array()])
 string clean_name ()
 int count ()
 ArrayIterator getIterator ()
 int index_of_version (string $ver)
 string name ()
 boolean offsetExists (string $idx)
 void offsetSet (string $idx, CriticalI_Package_Version $value)
 void offsetUnset (string $idx)
 void populate_versions_from_string (string $str, array $directories)
 string versions_string ()
Variables
mixed $name (line 14)
  • access: protected
mixed $versions (line 15)
  • access: protected
Methods
Constructor __construct (line 24)

Constructor

  • access: public
CriticalI_Package __construct (string $name, string $verString, [array $dirs = array()])
  • string $name: The name of the package
  • string $verString: A comma-separated list of installed version numbers
  • array $dirs: List of install directories keyed by package-version

Redefined in descendants as:
clean_name (line 43)

Return a cleaned version of this packages name with spaces and special characters removed.

  • access: public
string clean_name ()
count (line 227)

Return the count of versions of this package

  • access: public
int count ()
getIterator (line 149)

Return an iterator for the versions list

  • access: public
ArrayIterator getIterator ()

Implementation of:
IteratorAggregate::getIterator
index_of_version (line 135)

Returns the numeric index of a given version number, or false if it does not exist.

  • access: public
int index_of_version (string $ver)
  • string $ver: The version number to search for (as a string)
name (line 34)

Return the name of the package

  • access: public
string name ()
newest (line 75)

Return the newest version of the package

  • access: public
offsetExists (line 158)

Tests for existence of an array index

  • access: public
boolean offsetExists (string $idx)
  • string $idx: The index to test

Implementation of:
ArrayAccess::offsetExists
offsetGet (line 171)

Retrieves the value at an array index.

  • access: public
CriticalI_Package_Version offsetGet (string $idx)
  • string $idx: The index to get

Implementation of:
ArrayAccess::offsetGet
offsetSet (line 184)

Sets the value at an array index

  • access: public
void offsetSet (string $idx, CriticalI_Package_Version $value)

Implementation of:
ArrayAccess::offsetSet
offsetUnset (line 212)

Deletes an entry at an array index

  • access: public
void offsetUnset (string $idx)
  • string $idx: The index to unset

Implementation of:
ArrayAccess::offsetUnset
oldest (line 67)

Return the oldest version of this package

  • access: public
populate_versions_from_string (line 53)

Populates the list of versions from a string containing a comma- separated list of installed version numbers.

  • access: public
void populate_versions_from_string (string $str, array $directories)
  • string $str: The versions string
  • array $directories: List of install directories keyed by package-version
satisfy_dependency (line 116)

Return the version that satisfies the dependency required by the given version dependency string or null if not found.

Version dependency strings have a number of modifiers that affect how they will be interpreted. If no modifiers are specified, any version number that is greater than or equal to the specified version is considered a match as long as the major version numbers are the same. That is, if 1.5.287 is specified, versions 1.5.287 and 1.6.4 will match, however 1.5.14 and 2.3.0 will not. If the version number is followed by an exclamation mark (e.g. 1.5.287!), only the exact version number will be considered a match. If the version number is followed by a plus sign (e.g. 1.5.287+), any version number greater than or equal to that version will be considered a match, even if the major version numbers differ. If the version number is followed by a minus sign (e.g. 1.5.287-), any version number less than or equal to that version will be considered a match, even if the major version numbers differ. A range may also be specified using a dash to separate the numbers (e.g. 1.5.287-1.6.2), in which case any version number between or including the two end numbers shall be considered a match. Finally, an asterisk (*) may be specified to indicate any version.

  • access: public
CriticalI_Package_Version satisfy_dependency (string $version)
  • string $version: The version dependency specification
versions_string (line 84)

Returns a comma-separated list of version strings for the versions this package contains.

  • access: public
string versions_string ()

Documentation generated on Wed, 25 Apr 2012 09:46:44 -0700 by phpDocumentor 1.4.3