phpDocumentor GalleryCore
Classes
[ class tree: GalleryCore ] [ index: GalleryCore ] [ all elements ]

Class: GalleryRepositoryIndex

Source Location: /modules/core/classes/GalleryRepositoryIndex.class

Class GalleryRepositoryIndex

Property Summary
array   $_index   Repository index.
boolean   $_isLoaded   Indicates whether the index has been loaded from the filesystem.
string   $_source   The source of this index (released, experimental, community)
GalleryRepositoryUtilities   $_utilities   Repository utilities.

[ Top ]
Method Summary
GalleryRepositoryIndex   GalleryRepositoryIndex()  
boolean   containsPlugin()   Determines if the specified plugin exists in the index.
boolean   existsInCache()   Checks whether an index file exists in the local repository cache.
array   getAvailableLanguagesInPlugin()   Returns available languages for the specified plugin.
array   getDescriptorUrl()   Returns the specified plugin's descriptor URL relative to the repository root URL.
array   getLanguagePackageFiles()   The purpose of this method is to determine which language packages should be downloaded from
array   getMetaData()   Gets index meta data, which currently includes the local index timestamp (set when the index has been downloaded) and each plugin type count.
array   getPackageUrl()   Returns the specified plugin package's URL relative to the repository root URL.
array   getPackageVersionAndBuild()   Returns the version and build of the specified plugin package.
array   getPluginHeader()   Returns the specified plugin's build.
array   getPluginName()   Returns the specified plugin's name in the active language.
array   getPlugins()   Returns a list of plugins from the index of the specified type.
array   &getRawData()   Returns the complete index array. Used for testing purposes.
string   getRepositoryCacheDir()   Returns the path of the local repository cache.
GalleryStatus   load()   Loads and unserializes the index from the local filesystem into memory.
GalleryStatus   unserializeIndex()   Unserializes the index into memory.
GalleryStatus   update()   Downloads the repostory index from the Gallery server and writes it to the local repository cache.

[ Top ]
Properties
array   $_index [line 49]

Repository index.

API Tags:
Access:  private


[ Top ]
boolean   $_isLoaded [line 42]

Indicates whether the index has been loaded from the filesystem.

API Tags:
Access:  private


[ Top ]
string   $_source [line 56]

The source of this index (released, experimental, community)

API Tags:
Access:  private


[ Top ]
GalleryRepositoryUtilities   $_utilities [line 63]

Repository utilities.

API Tags:
Access:  private


[ Top ]
Methods
Constructor GalleryRepositoryIndex  [line 66]

  GalleryRepositoryIndex GalleryRepositoryIndex( $source  )

Parameters:
   $source: 


[ Top ]
containsPlugin  [line 292]

  boolean containsPlugin( string $pluginType, string $pluginId  )

Determines if the specified plugin exists in the index.

Parameters:
string   $pluginType: 
string   $pluginId: 


[ Top ]
existsInCache  [line 169]

  boolean existsInCache( )

Checks whether an index file exists in the local repository cache.



[ Top ]
getAvailableLanguagesInPlugin  [line 248]

  array getAvailableLanguagesInPlugin( string $pluginType, string $pluginId  )

Returns available languages for the specified plugin.

Parameters:
string   $pluginType: 
string   $pluginId: 

API Tags:
Return:  GalleryStatus a status code array languageCode => revision


[ Top ]
getDescriptorUrl  [line 344]

  array getDescriptorUrl( string $pluginType, string $pluginId  )

Returns the specified plugin's descriptor URL relative to the repository root URL.

Parameters:
string   $pluginType: 
string   $pluginId: 

API Tags:
Return:  GalleryStatus a status code string descriptor URL


[ Top ]
getLanguagePackageFiles  [line 521]

  array getLanguagePackageFiles( mixed $locales  )

The purpose of this method is to determine which language packages should be downloaded from

the repository for the supplied locale(s). To be included as a downloadable language package, two conditions must be met. 1) The plugin must be locally available and 2) the local module's requiredCoreApi and requiredPluginApi must be less than (<) the repository index's requiredCoreApi and requiredPluginApi respectively. The repository index's required api's are on a per plugin basis. If the plugin status does not contain the required api's (not installed), then the plugin is loaded and the values extracted from the class directly. A further check is made to insure that the language pack is an older build to prevent over- riding local modifications. An exact check of language package compatibility is not possible at the moment, so this check is primarily to ensure that plugins from a release branch get lang updates/packages from the release branch and not from the experimental branch repository.

Parameters:
mixed   $locales:  a single or an array of locale identifiers.

API Tags:
Return:  GalleryStatus a status code array[$pluginType] => array($pluginId => array('name' => $pluginName, 'files' => array('descriptor' => $descriptorUrl, 'en_gb' => url, 'pt_BR' => url...))


[ Top ]
getMetaData  [line 146]

  array getMetaData( )

Gets index meta data, which currently includes the local index timestamp (set when the index has been downloaded) and each plugin type count.


API Tags:
Return:  GalleryStatus a status code array 'timestamp' => integer (Unix timestamp) 'moduleCount' => integer 'themeCount' => integer


[ Top ]
getPackageUrl  [line 369]

  array getPackageUrl( string $pluginType, string $pluginId, string $package  )

Returns the specified plugin package's URL relative to the repository root URL.

Parameters:
string   $pluginType: 
string   $pluginId: 
string   $package:  package name

API Tags:
Return:  GalleryStatus a status code string package URL


[ Top ]
getPackageVersionAndBuild  [line 399]

  array getPackageVersionAndBuild( string $pluginType, string $pluginId, string $package  )

Returns the version and build of the specified plugin package.

If a language package is specified, the strings.raw and po revision are returned.

Parameters:
string   $pluginType: 
string   $pluginId: 
string   $package:  package name

API Tags:
Return:  GalleryStatus a status code string version/revision string build/revision


[ Top ]
getPluginHeader  [line 224]

  array getPluginHeader( string $pluginType, string $pluginId  )

Returns the specified plugin's build.

Parameters:
string   $pluginType: 
string   $pluginId: 

API Tags:
Return:  GalleryStatus a status code string plugin build


[ Top ]
getPluginName  [line 305]

  array getPluginName( string $pluginType, string $pluginId  )

Returns the specified plugin's name in the active language.

If it's not available in the active language, fall back to 'en_US'.

Parameters:
string   $pluginType: 
string   $pluginId: 

API Tags:
Return:  GalleryStatus a status code string the plugin name


[ Top ]
getPlugins  [line 441]

  array getPlugins( string $pluginType, [boolean $showAllPlugins = false], [array $coreApis = null]  )

Returns a list of plugins from the index of the specified type.

The list can include only plugins that are compatible with the specified core APIs (core and theme/module) if the second parameter is set. If no APIs are specified for the compatibility check, the currently installed API versions are used.

Parameters:
string   $pluginType:  'module' or 'theme'
boolean   $showAllPlugins:  return all plugins, even incompatible ones
array   $coreApis:  core APIs to base compatibility check on 'core'/'module'/'theme' => array(versionMajor, versionMinor)

API Tags:
Return:  plugin list


[ Top ]
getRawData  [line 486]

  array &getRawData( )

Returns the complete index array. Used for testing purposes.


API Tags:
Return:  the index
Access:  private


[ Top ]
getRepositoryCacheDir  [line 495]

  string getRepositoryCacheDir( )

Returns the path of the local repository cache.


API Tags:
Return:  index path


[ Top ]
load  [line 179]

  GalleryStatus load( )

Loads and unserializes the index from the local filesystem into memory.


API Tags:
Return:  a status code


[ Top ]
unserializeIndex  [line 207]

  GalleryStatus unserializeIndex( &$index  )

Unserializes the index into memory.

Parameters:
   &$index: 

API Tags:
Return:  a status code


[ Top ]
update  [line 76]

  GalleryStatus update( )

Downloads the repostory index from the Gallery server and writes it to the local repository cache.


API Tags:
Return:  a status code


[ Top ]

Documentation generated on Fri, 08 Oct 2010 05:03:33 -0700 by phpDocumentor 1.3.0RC6