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' |
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' |
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 |
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 |
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() |
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 |
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() |
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 |
array getLanguageDescription(
string
$languageCode
)
|
|
Returns the language description of the specified language-country code.
eg. en_US => English (US)
Parameters:
API Tags:
Return: | GalleryStatus a status code string language description |
Deprecated: | use GalleryCoreApi::getLanguageDescription() remove after next api bump. |
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) |
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 |
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 |
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 |
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:
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) |
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 |
void unpackPackage(
$packageFile,
$outputDirecory
)
|
|
Parameters:
|
$packageFile: |
|
|
$outputDirecory: |
|
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:
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:
string _getApiQueryParams(
)
|
|
Retrieve the core, module and theme API versions.
API Tags:
Return: | the API version numbers in http query format. |
Access: | private |