Class CriticalI_Package_List

Description

Implements interfaces:

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

CriticalI_Package_List is the collection of installed packages. It is a

singleton whose instance can be obtained by calling the static function list(). The actual instance behaves like many other objects in the system in that it is a first class object that behaves like an array. Packages are keyed in the list by their name.

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


	
			
Variable Summary
 static mixed $list
 static mixed $statusListener
 mixed $packageInfo
 mixed $packages
Method Summary
 static void add (CriticalI_Package_Wrapper $wrappedPackage)
 static void add_package_to_autoloader (string $package, [string $version = null])
 static void add_to_version_list (string $list, string $value)
 static void add_version_to_packages_file (CriticalI_Package_Directory $pkg, string $basedir)
 static void clean_root_directory ()
 static void clear ()
 static void debug_status (CriticalI_Package $package, string $message)
 static void delete_all_and_remove_directory (string $directory)
 static void info_status (CriticalI_Package $package, string $message)
 static void perform (CriticalI_ChangeManager_Plan $plan)
 static void rebuild ()
 static void remove (CriticalI_Package_Version $packageVersion)
 static void remove_from_version_list (string $list, string $value)
 static void remove_version_from_packages_file (string $name, string $version)
 static void update_system_in_packages_file (string $oldVersion, string $newVersion)
 CriticalI_Package_List __construct ([ $load = true])
 array commandVersions ()
 void find_matching_versions ( $specs)
 ArrayIterator getIterator ()
 boolean offsetExists (string $idx)
 CriticalI_Package offsetGet (string $idx)
 void offsetSet (string $idx, CriticalI_Package $value)
 void offsetUnset (string $idx)
Variables
static mixed $list = null (line 14)
  • access: protected
static mixed $statusListener = null (line 15)
  • access: protected
mixed $packageInfo (line 18)
  • access: protected
mixed $packages (line 17)
  • access: protected
Methods
static add (line 194)

Add (install) a new wrapped package to the repository

This is a low level method that does not perform any dependency checking. For higher level functionality and validation, construct a CriticalI_ChangeManager_Plan and pass it to the perform() method.

  • access: public
void add (CriticalI_Package_Wrapper $wrappedPackage)
static add_package_to_autoloader (line 125)

Convenience method for including a given package and its dependencies in the runtime autoload directory list. The package must be installed for this to work (otherwise an exception will result).

  • access: public
void add_package_to_autoloader (string $package, [string $version = null])
  • string $package: The name of the package to add
  • string $version: Optional version specification (same as for dependencies)
static add_to_version_list (line 429)

Add a version to a version list string and maintain sort order

  • access: protected
void add_to_version_list (string $list, string $value)
  • string $list: The comma-separated list of versions
  • string $value: The value to add
static add_version_to_packages_file (line 349)

Update the installation list file with a single added package directory

  • access: protected
void add_version_to_packages_file (CriticalI_Package_Directory $pkg, string $basedir)
  • CriticalI_Package_Directory $pkg: The newly added directory
  • string $basedir: The bare directory name (no path) where it was installed
static clean_root_directory (line 485)

Return a cleaned version of the global variable $CRITICALI_ROOT for

use in installations

  • access: protected
void clean_root_directory ()
static clear (line 64)

Forces CriticalI_Package_List to skip loading of packages and present an empty list for subsequent class to get.

  • access: public
void clear ()
static debug_status (line 641)

Send a debug-level status message

  • access: protected
void debug_status (CriticalI_Package $package, string $message)
  • CriticalI_Package $package: The package the operation is occurring on (may be null)
  • string $message: The message
static delete_all_and_remove_directory (line 458)

Equivalent to performing "rm -rf" on a directory

  • access: protected
void delete_all_and_remove_directory (string $directory)
  • string $directory: The directory to remove
static get (line 54)

Returns the shared list instance

  • access: public
static info_status (line 630)

Send an informational status message

  • access: protected
void info_status (CriticalI_Package $package, string $message)
  • CriticalI_Package $package: The package the operation is occurring on (may be null)
  • string $message: The message
static perform (line 155)

Perform the set of operations prescribed by a CriticalI_ChangeManager_Plan

  • access: public
void perform (CriticalI_ChangeManager_Plan $plan)
static rebuild (line 71)

Rebuild the installation list file and repopulate the list

  • access: public
void rebuild ()
static remove (line 247)

Remove (uninstall) a package version from the repository

This is a low level method that does not perform any dependency checking. For higher level functionality and validation, construct a CriticalI_ChangeManager_Plan and pass it to the perform() method.

  • access: public
void remove (CriticalI_Package_Version $packageVersion)
static remove_from_version_list (line 442)

Remove a version from a version list string and maintain sort order

  • access: protected
void remove_from_version_list (string $list, string $value)
  • string $list: The comma-separated list of versions
  • string $value: The value to remove
static remove_version_from_packages_file (line 380)

Update the installation list file by removing a single deleted package directory

  • access: protected
void remove_version_from_packages_file (string $name, string $version)
  • string $name: The package name
  • string $version: The version name
static run_installers_for (line 495)

Run any specified installers for a package

  • access: protected
void run_installers_for (CriticalI_Package_Version $pkg)
static set_status_listener (line 46)

Set the status listener

  • access: public
void set_status_listener (CriticalI_Package_StatusListener $listener)
static system_upgrade (line 290)

Upgrade the criticali system to a new wrapped package

This is a low level method that does not perform any dependency checking. For higher level functionality and validation, construct a CriticalI_ChangeManager_Plan and pass it to the perform() method.

  • access: public
void system_upgrade (CriticalI_Package_Version $to, CriticalI_Package_Version $from)
static update_system_in_packages_file (line 408)

Update the criticali system version listed in the package directory

  • access: protected
void update_system_in_packages_file (string $oldVersion, string $newVersion)
  • string $oldVersion: The old version
  • string $newVersion: The new version
Constructor __construct (line 25)

Constructor.

This class may not be directly instantiated.

  • access: protected
CriticalI_Package_List __construct ([ $load = true])
  • $load
commandVersions (line 599)

Return the list of package versions that declare commands

  • access: public
array commandVersions ()
find_matching_versions (line 607)

Searches the list of packages to assemble a collection of Versions from an array of specs.

  • access: protected
void find_matching_versions ( $specs)
  • $specs
getIterator (line 556)

Return an iterator for the package list

  • access: public
ArrayIterator getIterator ()

Implementation of:
IteratorAggregate::getIterator
offsetExists (line 565)

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 574)

Retrieves the package at an array index.

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

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

Sets the value at an array index

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

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

Deletes an entry at an array index

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

Implementation of:
ArrayAccess::offsetUnset
run_uninstallers_for (line 525)

Run any specified uninstallers for a package

  • access: protected
void run_uninstallers_for (CriticalI_Project_PackageVersion $pkg)

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