static void clearRepositoryCache(
[
$sources = array()], [
$repositoryClassName = 'GalleryRepository']
)
|
|
Clear the cached version of the repositories saved by a call to getRepositories()
Parameters:
|
$sources: |
|
|
$repositoryClassName: |
|
static array getRepositories(
[array
$sources = array()], [string
$repositoryClassName = 'GalleryRepository']
)
|
|
Return a set of all the repositories that are currently active. The error count indicates the number of repositories that failed to initialize for some reason (perhaps from a malformed local copy of the index). The fix for this is to download a new version of the repository.
Parameters:
array |
$sources: |
(optional) an array of source names, eg 'official', 'community' If this is left empty, use the value stored in core.repositories. |
string |
$repositoryClassName: |
(optional) the name of the repository class to use. should be GalleryRepository, except for test code. |
API Tags:
Return: | GalleryStatus a status code array repository name => GalleryRepository the repository int error count (repositories that failed to load for some reason) |
static array translateRepositoryName(
mixed
$source
)
|
|
Translate the repository tag to its localized name
API Tags:
Return: | GalleryStatus a status code string the localized name |
Information Tags:
boolean comparePluginListEntries(
array
$plugin1, array
$plugin2
)
|
|
Compares two plugin list entries.
A plugin list entry is an element of the array returned by getRepositoryPluginList. This is a callback for sorting the plugin list by (group label, plugin name).
Parameters:
array |
$plugin1: |
first plugin list entry |
array |
$plugin2: |
second plugin list entry |
API Tags:
boolean createPluginsDirectory(
)
|
|
Checks if the plugins directory exists and creates a subdirectory for each plugin type.
API Tags:
Return: | indicates whether the plugins directory is correctly set up string user-friendly error message |
Information Tags:
Todo: | Delete on the next major API bump as it is not referenced. |
array downloadAndUnpack(
string
$pluginType, string
$pluginId, string
$packageName, string
$relativePackageUrl
)
|
|
Downloads a file from the repository.
If the file is a package, it will be put in the local cache and unpacked in the plugins/ directory. If it is a descriptor, it will be deserialized and returned to the calling function.
Parameters:
string |
$pluginType: |
|
string |
$pluginId: |
|
string |
$packageName: |
|
string |
$relativePackageUrl: |
URL of the package to download relative to repository URL |
API Tags:
Return: | GalleryStatus a status code array descriptor |
Information Tags:
Todo: | Split this into two separate functions, one that downloads the file, the other that returns the descriptor. The function that downloads the file should take the descriptor so that it can verify that the file that got downloaded is the right length. |
array downloadAndUnpackPackages(
array
$filesToDownload,
&$callback, string
$source, array
$callback
)
|
|
Retrieve all the specified files as one http request and separate into individual packages.
Parameters:
string |
$source: |
name of the repository to be accessed |
array |
$filesToDownload: |
list of files to download |
array |
$callback: |
progress notification callback |
|
&$callback: |
|
API Tags:
Return: | GalleryStatus a status code array string status messages indicating problems encounterd int count of packages installed |
API Tags:
See: | GalleryRepositoryIndex::update |
void downloadPackagesForPlugin(
string
$pluginType, string
$pluginId, array
$pluginDownloadData,
&$callback, GalleryRepository
$repository, array
$callback
)
|
|
Download the specified packages.
Parameters:
GalleryRepository |
$repository: |
|
string |
$pluginType: |
|
string |
$pluginId: |
|
array |
$pluginDownloadData: |
list of plugins to download |
array |
$callback: |
information for progress bar updates |
|
&$callback: |
|
array getAllUpgradeablePackages(
)
|
|
Creates a list of all upgradeable packages.
It goes through all installed plugins and checks if an update is available to any of their packages and adds it to a list if it is.
API Tags:
Return: | GalleryStatus a status code array package list |
array getDownloadFileList(
array
$pluginData
)
|
|
Creates a list of URLs that
Parameters:
array |
$pluginData: |
array(pluginType => array(pluginId => array(packages))) |
API Tags:
Return: | GalleryStatus a status code array list of packages with corresponding URLs |
API Tags:
See: | GalleryRepositoryIndex::getMetaData |
void getLanguagePackageFiles(
$locales
)
|
|
Parameters:
API Tags:
See: | GalleryRepositoryIndex::getLanguagePackageFiles |
void getPackageVersionAndBuild(
$pluginType,
$pluginId,
$packageName
)
|
|
Parameters:
|
$pluginType: |
|
|
$pluginId: |
|
|
$packageName: |
|
API Tags:
See: | GalleryRepositoryIndex::getPackageVersionAndBuild |
void getPluginName(
$pluginType,
$pluginId
)
|
|
Parameters:
API Tags:
See: | GalleryRepositoryIndex::getPluginName |
array getPluginUpgradeInfo(
string
$pluginType, string
$pluginId, [bool
$forBasePackageUpgrade = true]
)
|
|
Determines which packages of the specified plugin are newer in the repository.
Parameters:
string |
$pluginType: |
A plugin type (module|theme) |
string |
$pluginId: |
A plugin id |
bool |
$forBasePackageUpgrade: |
(optional) Include all packages that are upgradeable once the base package has been upgraded. Default true. |
API Tags:
Return: | GalleryStatus a status code array package list |
array getRepositoryPluginList(
string
$pluginType, [boolean
$showAllPlugins = false], [array
$coreApis = null]
)
|
|
Returns a list of plugins of the specified type.
It can return a list of compatible plugins with specific core APIs. By default, compatibility is determined by comparing the repository plugin requirements with the currently installed APIs, but API versions can be specified, so it is possible to, for example, get a compatibility list based on future API versions.
Parameters:
string |
$pluginType: |
|
boolean |
$showAllPlugins: |
show incompatible plugins |
array |
$coreApis: |
core APIs to base compatibility check on 'core'/'module'/'theme' => array(versionMajor, versionMinor) |
API Tags:
Return: | GalleryStatus a status code array plugin list |
Initializes the repository index and utilities.
Parameters:
API Tags:
array isCoreUpgradeAvailable(
)
|
|
Determines whether a core module upgrade is available.
API Tags:
Return: | GalleryStatus a status code boolean availability array repository core and plugin api versions |
API Tags:
See: | GalleryRepositoryIndex::existsInCache |
void pluginExistsInIndex(
$pluginType,
$pluginId
)
|
|
Parameters:
API Tags:
See: | GalleryRepositoryIndex::containsPlugin |
array preVerifyPackage(
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 |
$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) |
void removeObsoleteFiles(
string
$pluginType, string
$pluginId
)
|
|
Remove obsolete files when a plugin is updated.
Parameters:
string |
$pluginType: |
A plugin type (module|theme) |
string |
$pluginId: |
A plugin id |
API Tags:
Scan one plugin and update its entries in the GalleryPluginPackageMap.
API Tags:
void updatePackageMetaData(
$pluginType,
$pluginId,
$packageName,
$packageVersion,
$packageBuild,
$locked
)
|
|
Parameters:
|
$pluginType: |
|
|
$pluginId: |
|
|
$packageName: |
|
|
$packageVersion: |
|
|
$packageBuild: |
|
|
$locked: |
|
API Tags:
Deprecated: | Only called from this class so remove on next major api bump. |
See: | GalleryRepositoryUtilities::updatePackageMetaData |
GalleryStatus verifyPackageIntegrity(
string
$packageName, array
$descriptor
)
|
|
Verifies the integrity of the specified packages' unpacked files.
Parameters:
string |
$packageName: |
name of the package to check |
array |
$descriptor: |
descriptor of the plugin the package belongs to |
API Tags:
array _preverifyAggregatePackages(
array
$packages,
&$callback, array
$callback
)
|
|
Preverify that we will have no trouble unpacking and writing the packages we downloaded
Parameters:
array |
$packages: |
packages returned from splitAggregatePackage |
array |
$callback: |
progress notification callback |
|
&$callback: |
|
API Tags:
Return: | GalleryStatus a status code array string status messages indicating problems encounterd |