Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Package_Manager Class Reference
Inheritance diagram for Package_Manager:
MySource_Object Package_Manager_Bulkmail Package_Manager_Calendar Package_Manager_CMS Package_Manager_Core Package_Manager_Data Package_Manager_Ecommerce Package_Manager_Filesystem Package_Manager_Funnelback Package_Manager_Google_Maps Package_Manager_Import_Tools Package_Manager_IPB Package_Manager_LDAP Package_Manager_News Package_Manager_SAML Package_Manager_Search Package_Manager_Sharepoint Package_Manager_Squid Package_Manager_Squiz_Suite Package_Manager_TRIM Package_Manager_Web_Services

Public Member Functions

 Package_Manager ()
 
 getPackageName ()
 
 checkPackageDetails ($update_assets=Array(), $deferred_assets=Array())
 
 updatePackageDetails ($update_assets=Array())
 
 _loadPackageAssets ()
 
 _recurseLoadPackageAssets (Array &$assets, $full_path, $base_path)
 
 _getInstallOrder ($update_assets=Array(), $deferred=Array())
 
 _createAssetMapScreensXML ($deferred=Array())
 
 checkRequirementsFromFile ($file, $deferred_assets=Array(), $need_feedback=false)
 
 getTypeAncestors ($type_code)
 
 getTypeInfo ($type_code, $field='')
 
 installUserPreferences (&$preferences)
 
 installSystemAssets ()
 
 _postInstall ()
 
 _installDALQueries ()
 
- Public Member Functions inherited from MySource_Object
 MySource_Object ()
 
 __sleep ()
 
 __wakeup ()
 

Static Public Member Functions

 getSystemAssetTypes ()
 

Data Fields

 $name = ''
 
 $version = ''
 
 $description = ''
 
 $assets = Array()
 
 $_base_path = ''
 
 $_full_path = ''
 
- Data Fields inherited from MySource_Object
 $_tmp
 

Detailed Description

Definition at line 32 of file package_manager.inc.

Member Function Documentation

_createAssetMapScreensXML (   $deferred = Array())

Generates a segment of an XML document for the Asset_Map.inc to use to send to the flash

Parameters
Array$deferredAn array of asset types to defer this install private

Definition at line 541 of file package_manager.inc.

_getInstallOrder (   $update_assets = Array(),
  $deferred = Array() 
)

Generates an array holding the type_codes for the order in which the assets should be installed in order to respect the heirarchy defined in the asset.xml files

Parameters
Array$update_assetsAssets that are going to be updated.
Array$deferredAny asset types that are going to be deferred this installation pass private

Definition at line 463 of file package_manager.inc.

_installDALQueries ( )

Generates the baked Database Abstraction Layer (DAL) queries for the package

Returns
boolean public

Definition at line 897 of file package_manager.inc.

_loadPackageAssets ( )

Recursivly searches through the passed package's directory for asset.xml files and enter's them into the $this->assets array with the details

private

Definition at line 361 of file package_manager.inc.

_postInstall ( )

Post install script for package; runs at end of update packages

protected

Definition at line 885 of file package_manager.inc.

_recurseLoadPackageAssets ( Array &  $assets,
  $full_path,
  $base_path 
)

Recusively load information for the assets in this package

Parameters
Array&$assetsthe assets to load the information for
string$full_paththe absolute path to the directory where the assets exist
string$base_paththe base path where the assets exists eg. for cms base_path=package/cms
Returns
void private

Definition at line 383 of file package_manager.inc.

checkPackageDetails (   $update_assets = Array(),
  $deferred_assets = Array() 
)

Checks to see if the installation/upgrade of this package is able to go ahead

Will return 'true' if all assets are okay, otherwise will return an array of assetids that failed requirements.

Parameters
array$update_assetsan array of asset types to check details for if empty, will check all assets
array$deferred_assetsan array of previously deferred assets
Returns
mixed public

Definition at line 147 of file package_manager.inc.

checkRequirementsFromFile (   $file,
  $deferred_assets = Array(),
  $need_feedback = false 
)

checks the requirements of the passed asset.xml file see checkRequirements() for more info

We need to pass the list of deferred assets to this function, because while it can handle direct requirements it can't normally handle assets that have to be deferred because their parents have had to be deferred (eg. if type B has to be deferred because type A needs to be installed, then it couldn't pick up that type C (which depends on B) needs to be deferred too

Parameters
string$filethe code name for the asset that you want to check
array$deferred_assetsa list of previously deferred assets
boolean$need_feedback
array$ignore_assetsif the requirement is an asset, but is in this list, the requirement is considered to have passed
Returns
mixed public

Definition at line 624 of file package_manager.inc.

getPackageName ( )

Returns the name of the package that this management class is working for

public

Definition at line 128 of file package_manager.inc.

getSystemAssetTypes ( )
static

Returns an array of all the asset types in the package that are to be treated as system assets NOTE: Assets will be installed in the order they appear in this list

Returns
array public

Definition at line 834 of file package_manager.inc.

getTypeAncestors (   $type_code)

Returns an array of all assets types that are parents for the passed asset that is in the this package, in the order Array ('parent', 'grand-parent', 'great-grand-parent', ..., 'asset')

Parameters
string$type_codethe code name for the asset that you want to check
Returns
array(string) public

Definition at line 731 of file package_manager.inc.

getTypeInfo (   $type_code,
  $field = '' 
)

Returns an array of asset information or a specific piece of information

Parameters
string$type_codethe code name for the asset that you want to check
string$fieldif exists returns this information from the array for this specific field
Returns
mixed public

Definition at line 772 of file package_manager.inc.

installSystemAssets ( )

Installs System Assets for this package

Returns
int the number of system assets created (-1 reserved for error) protected

Definition at line 847 of file package_manager.inc.

installUserPreferences ( $preferences)

Iterate through the asset preference classes to add preference vars to an array

Returns
array public

Definition at line 791 of file package_manager.inc.

Constructor

Definition at line 82 of file package_manager.inc.

updatePackageDetails (   $update_assets = Array())

Installs/Updates the passed package in the system

Parameters
array$update_assetsan array of asset types to update details for if empty, will do all assets
Returns
mixed success status, or an array of type codes that has been deferred for later checking public

Definition at line 203 of file package_manager.inc.


The documentation for this class was generated from the following file: