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

Class: GalleryRepositoryUtilities

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

Class GalleryRepositoryUtilities

Method Summary
string   compareRevisions()   Compares two specified revisions.
array   compareVersions()   Compares two specified versions and, optionally, build numbers (timestamps). Returns the relation between the first and second specified versions.
array   downloadAggregatePackages()   Contact the repository and download the specified files with one request.
array   downloadFile()   Downloads a file from the specified URL.
array   extractRevision()   Extracts the revision number from a string generated by CVS' Id tag.
array   getFileRevision()   Extracts the revision number from a string generated by CVS' Id tag.
array   getFirstBytesFromFile()   Reads specified number of bytes from the file's beginning.
array   getLanguageBaseRevision()   Reads the strings.raw revision of the specified plugin.
array   getLanguageDescription()   Returns the language description of the specified language-country code.
array   getPluginPackages()   Gets version and build information about the installed packages of the specified plugin.
array   getPluginVersion()   Returns the version of the specified plugin.
array   getProvidedApis()   Returns the provided APIs relevant to the specified plugin type.
array   isPluginAvailable()   Determines whether the specified plugin is available in the local Gallery.
boolean   isPluginCompatible()   Checks plugin compatibility with a certain version of Gallery.
array   preVerifyPackage()   Verify that a package will install cleanly by examining all of its paths and making sure that any file operations that we intend to make will be successful.
array   splitAggregatePackage()   This method reads the aggregate download file and extracts the package files.
void   unpackPackage()  
GalleryStatus   updatePackageMetaData()   Saves the specified package meta data into the database.
GalleryStatus   verifyPackageIntegrity()   Verifies the integrity of the specified packages' unpacked files.
string   _getApiQueryParams()   Retrieve the core, module and theme API versions.

[ Top ]
Methods
compareRevisions  [line 129]

  string compareRevisions( string $revision1, string $revision2  )

Compares two specified revisions.

Parameters:
string   $revision1:  first revision (x[.y][.z][...])
string   $revision2:  second revision

API Tags:
Return:  'equal', 'older' or 'newer'


[ Top ]
compareVersions  [line 99]

  array compareVersions( string $version1, string $version2, [int $build1 = null], [int $build2 = null]  )

Compares two specified versions and, optionally, build numbers (timestamps). Returns the relation between the first and second specified versions.

Parameters:
string   $version1:  first version (x[.y][.z][...])
string   $version2:  second version
int   $build1:  first build (yyyymmddhhmmss)
int   $build2:  second build

API Tags:
Return:  GalleryStatus a status code string 'older', 'equal', 'newer'


[ Top ]
downloadAggregatePackages  [line 707]

  array downloadAggregatePackages( string $source, array $filesToDownload  )

Contact the repository and download the specified files with one request.

Parameters:
string   $source:  repository source
array   $filesToDownload:  list of files to download

API Tags:
Return:  GalleryStatus a status code string name of the temporary file containing the aggregated download


[ Top ]
downloadFile  [line 372]

  array downloadFile( string $url, [string $ignoreCompression = false]  )

Downloads a file from the specified URL.

It currently calls GalleryCoreApi::fetchWebPage to do all the work. If the gzinflate() function is available, then download the gzipped version of the file and unpack it locally to save bandwidth.

Parameters:
string   $url:  url to download from
string   $ignoreCompression:  don't try to get the compressed version of the file

API Tags:
Return:  boolean file was successfully downloaded string file contents


[ Top ]
extractRevision  [line 49]

  array extractRevision( string $string  )

Extracts the revision number from a string generated by CVS' Id tag.

The pattern is one of: <DOLLAR>Id: it.po 13690 2006-05-19 18:01:46Z mindless <DOLLAR> <DOLLAR>Revision: 13690 <DOLLAR>

Parameters:
string   $string:  to exract revision from

API Tags:
Return:  GalleryStatus a status code string revision

Information Tags:
Todo:  On next major api bump make private or inline in getFileRevision()

[ Top ]
getFileRevision  [line 79]

  array getFileRevision( string $file  )

Extracts the revision number from a string generated by CVS' Id tag.

The pattern is one of: <DOLLAR>Id: it.po 13690 2006-05-19 18:01:46Z mindless <DOLLAR> <DOLLAR>Revision: 13690 <DOLLAR>

Parameters:
string   $file:  to extract revision from

API Tags:
Return:  GalleryStatus a status code string revision


[ Top ]
getFirstBytesFromFile  [line 164]

  array getFirstBytesFromFile( string $path, int $bytes  )

Reads specified number of bytes from the file's beginning.

Parameters:
string   $path:  file path
int   $bytes:  bytes to read

API Tags:
Return:  GalleryStatus a status code string first line from file

Information Tags:
Todo:  On next major api bump make private or inline in getFileRevision()

[ Top ]
getLanguageBaseRevision  [line 187]

  array getLanguageBaseRevision( string $pluginType, string $pluginId  )

Reads the strings.raw revision of the specified plugin.

Parameters:
string   $pluginType: 
string   $pluginId: 

API Tags:
Return:  GalleryStatus a status code string strings.raw timestamp


[ Top ]
getLanguageDescription  [line 339]

  array getLanguageDescription( string $languageCode  )

Returns the language description of the specified language-country code.

eg. en_US => English (US)

Parameters:
string   $languageCode: 

API Tags:
Return:  GalleryStatus a status code string language description
Deprecated:  use GalleryCoreApi::getLanguageDescription() remove after next api bump.


[ Top ]
getPluginPackages  [line 308]

  array getPluginPackages( string $pluginType, string $pluginId  )

Gets version and build information about the installed packages of the specified plugin.

Parameters:
string   $pluginType: 
string   $pluginId: 

API Tags:
Return:  GalleryStatus a status code array[$packageName] => array('version' => $version, 'build' => $build)


[ Top ]
getPluginVersion  [line 351]

  array getPluginVersion( string $pluginType, string $pluginId  )

Returns the version of the specified plugin.

Parameters:
string   $pluginType: 
string   $pluginId: 

API Tags:
Return:  GalleryStatus a status code string version


[ Top ]
getProvidedApis  [line 278]

  array getProvidedApis( string $pluginType, [array $providedApis = null]  )

Returns the provided APIs relevant to the specified plugin type.

If no provided APIs are specified, currently installed API versions will be used.

Parameters:
string   $pluginType: 
array   $providedApis:  provided core API versions ('core', 'module', 'theme' => array(Major, Minor))

API Tags:
Return:  array provided core API version array provided plugin (based on its type) API version


[ Top ]
isPluginAvailable  [line 223]

  array isPluginAvailable( string $pluginType, string $pluginId  )

Determines whether the specified plugin is available in the local Gallery.

Parameters:
string   $pluginType: 
string   $pluginId: 

API Tags:
Return:  GalleryStatus a status code boolean availability


[ Top ]
isPluginCompatible  [line 247]

  boolean isPluginCompatible( string $pluginType, array $requiredCoreApi, array $requiredPluginApi, [array $providedApis = null]  )

Checks plugin compatibility with a certain version of Gallery.

Determines whether the specified plugin type's required APIs are compatible with specified provided APIs. If provided APIs are omitted, currently installed API versions will be used.

Parameters:
string   $pluginType: 
array   $requiredCoreApi:  required core API version
array   $requiredPluginApi:  required theme/module API version
array   $providedApis:  provided core API versions ('core', 'module', 'theme' => array(Major, Minor))

API Tags:
Return:  compatibility


[ Top ]
preVerifyPackage  [line 457]

  array preVerifyPackage( string $pluginType, string $pluginId, string $packageName, array $descriptor  )

Verify that a package will install cleanly by examining all of its paths and making sure that any file operations that we intend to make will be successful.

Parameters:
string   $pluginType:  the plugin type (eg. module, theme)
string   $pluginId:  the plugin id
string   $packageName:  name of the package to check
array   $descriptor:  descriptor of the plugin the package belongs to

API Tags:
Return:  of files that can't be overwritten (empty array if everything is ok)


[ Top ]
splitAggregatePackage  [line 584]

  array splitAggregatePackage( string $source, string $outputFile, &$callback, array $callback  )

This method reads the aggregate download file and extracts the package files.

The format of the file is: file: relative filename(.gz) lengthCRLF binary data if compressed or text if not compressed

file: relative filename(.gz) lengthCRLF binary data if compressed or text if not compressed

Parameters:
string   $source:  name of the repository to be accessed
string   $outputFile:  name of the temporary file containing the downloaded packages
array   $callback:  progress notification callback
   &$callback: 

API Tags:
Return:  GalleryStatus a status code array of packages that were downloaded


[ Top ]
unpackPackage  [line 676]

  void unpackPackage( $packageFile, $outputDirecory  )

Parameters:
   $packageFile: 
   $outputDirecory: 


[ Top ]
updatePackageMetaData  [line 406]

  GalleryStatus updatePackageMetaData( string $pluginType, string $pluginId, string $packageName, string $packageVersion, string $packageBuild, string $locked  )

Saves the specified package meta data into the database.

Parameters:
string   $pluginType: 
string   $pluginId: 
string   $packageName: 
string   $packageVersion: 
string   $packageBuild: 
string   $locked: 

API Tags:
Return:  a status code


[ Top ]
verifyPackageIntegrity  [line 514]

  GalleryStatus verifyPackageIntegrity( string $pluginType, string $pluginId, string $packageName, array $descriptor  )

Verifies the integrity of the specified packages' unpacked files.

Parameters:
string   $pluginType: 
string   $pluginId: 
string   $packageName:  name of the package to check
array   $descriptor:  descriptor of the plugin the package belongs to

API Tags:
Return:  a status code


[ Top ]
_getApiQueryParams  [line 686]

  string _getApiQueryParams( )

Retrieve the core, module and theme API versions.


API Tags:
Return:  the API version numbers in http query format.
Access:  private


[ Top ]

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