[ Index ]

PHP Cross Reference of Akelos Framework

title

Body

[close]

/AkPlugin/ -> AkPluginManager.php (summary)

Plugin manager

Author: Bermi Ferrer 2007
Copyright: Copyright (c) 2002-2007, Akelos Media, S.L. http://www.akelos.org
License: GNU Lesser General Public License
File Size: 646 lines (23 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 3 files
 AkPluginInstaller.php
 AkPlugin.php
 AkInstaller.php

Defines 1 class

AkPluginManager:: (36 methods):
  getAvailableRepositories()
  addRepository()
  removeRepository()
  getPlugins()
  getInstalledPlugins()
  installPlugin()
  guessBestInstallMethod()
  canUseSvn()
  updatePlugin()
  uninstallPlugin()
  getDiscoveredRepositories()
  getRepositoryForPlugin()
  _runInstaller()
  _getRepositoriesFromRemotePage()
  _copyRemoteDir()
  _copyRemoteFile()
  _updateRemotePluginsList()
  _addAvailablePlugins_()
  _parseRemoteAndGetDirectoriesAndFiles()
  _getRepositoriesConfigPath()
  _getRepositoriesCahePath()
  _shouldUseSvnExternals()
  _shouldUseSvnCheckout()
  _installUsingCheckout()
  _updateUsingCheckout()
  _installUsingLocalDirectory()
  _updateUsingLocalDirectory()
  _installUsingExport()
  _updateUsingExport()
  _installUsingExternals()
  _updateUsingExternals()
  _updateUsingHttp()
  _setExternals()
  _uninstallExternals()
  _getExternals()
  _installUsingHttp()


Class: AkPluginManager  - X-Ref

Plugin manager

getAvailableRepositories($force_reload = false)   X-Ref
Gets a list of available repositories.

param: boolean $force_reload Forces reloading, useful for testing and when running as an application server.
return: array   List of repository URLs

addRepository($repository_path)   X-Ref
Ads a repository to the know repositories list.

param: string $repository_path  An Apache mod_svn interface to subversion.
return: void  

removeRepository($repository_path)   X-Ref
Removes a repository to the know repositories list.

param: string $repository_path  An Apache mod_svn interface to subversion.
return: boolean Returns false if the repository was not available

getPlugins($force_update = false)   X-Ref
Gets a list of available plugins.

Goes through each trusted plugin server and retrieves the name of the
folders (plugins) on the repository path.

param: boolean $force_update If it is not set to true, it will only check remote sources once per hour
return: array   Returns an array containing "plugin_name" => "repository URL"

getInstalledPlugins()   X-Ref
Retrieves a list of installed plugins

return: array  Returns an array with the plugins available at AK_PLUGINS_DIR

installPlugin($plugin_name, $repository = null, $options = array()   X-Ref
Installs a plugin

Install a plugin from a remote resource.

Plugins can have an Akelos installer at located at "plugin_name/installer/plugin_name_installer.php"
If the installer is available, it will run the "PluginNameInstaller::install()" method, which will trigger
all the up_* methods for the installer.

param: string  $plugin_name Plugin name
param: unknown $repository   An Apache mod_svn interface to subversion. If not provided it will use a trusted repository.
param: array $options  
return: mixed Returns false if the plugin can't be found.

guessBestInstallMethod($options = array()   X-Ref
No description

canUseSvn()   X-Ref
No description

updatePlugin($plugin_name, $repository = null)   X-Ref
Updates a plugin if there are changes.

Uses subversion update if available. If http update is used, it will
download the whole plugin unless there is a CHANGELOG file, in which case
it will only perform the update if there are changes.

param: string  $plugin_name Plugin name
param: string $repository   An Apache mod_svn interface to subversion. If not provided it will use a trusted repository.
return: null

uninstallPlugin($plugin_name)   X-Ref
Uninstalls an existing plugin

Plugins can have an Akelos installer at located at "plugin_name/installer/plugin_name_installer.php"
If the installer is available, it will run the "PluginNameInstaller::uninstall()" method, which will trigger
all the down_* methods for the installer.

param: string  $plugin_name Plugin name
return: void  

getDiscoveredRepositories()   X-Ref
Gets a list of repositories available at the web page defined by AK_PLUGINS_REPOSITORY_DISCOVERY_PAGE (http://wiki.akelos.org/plugins by default)

return: array An array of non trusted repositories available at http://wiki.akelos.org/plugins

getRepositoryForPlugin($plugin_name, $repository = null)   X-Ref
Returns the repository for a given $plugin_name

param: string  $plugin_name     The name of the plugin
param: string  $repository  If a repository name is provided it will check for the plugin name existance.
return: mixed Repository URL or false if plugin can't be found   

_runInstaller($plugin_name, $install_or_uninstall = 'install', $options = array()   X-Ref
Runs the plugin installer/uninstaller if available

Plugins can have an Akelos installer at located at "plugin_name/installer/plugin_name_installer.php"
If the installer is available, it will run the "PluginNameInstaller::install/uninstall()" method, which will trigger
all the up/down_* methods for the installer.

param: string  $plugin_name     The name of the plugin
param: string  $install_or_uninstall What to do, options are install or uninstall
return: void   

_getRepositoriesFromRemotePage()   X-Ref
Retrieves the URL's from the AK_PLUGINS_REPOSITORY_DISCOVERY_PAGE (http://wiki.akelos.org/plugins by default)

Plugins in that page must follow this convention:

* Only http:// protocol. No https:// or svn:// support yet
* The URL must en in plugins to be fetched automatically

return: array   An array of existing repository URLs

_copyRemoteDir($source, $destination)   X-Ref
Copy recursively a remote svn dir into a local path.

Downloads recursively the contents of remote directories from a mod_svn Apache subversion interface to a local destination.

File or directory permissions are not copied, so you will need to use installers to fix it if required.

param: string  $source      An Apache mod_svn interface to subversion URL.
param: string  $destination Destination directory
return: void   

_copyRemoteFile($source, $destination)   X-Ref
Copies a remote file into a local destination

param: string $source      Source URL
param: string  $destination Destination directory
return: void   

_updateRemotePluginsList()   X-Ref
Performs an update of available cached plugins.

return: boolean   

_addAvailablePlugins_($repository, &$plugins_list)   X-Ref
Modifies $plugins_list adding the plugins available at $repository

param: string $repository    Repository URL
param: array   $plugins_list Plugins list in the format 'plugin_name' => 'repository'
return: void   

_parseRemoteAndGetDirectoriesAndFiles($remote_path)   X-Ref
Parses a remote Apache svn web page and returns a list of available files and directories

param: string $remote_path Repository URL
return: array   an array like array($directories, $files). Use list($directories, $files) = $this->_parseRemoteAndGetDirectoriesAndFiles($remote_path) for getting the results of this method

_getRepositoriesConfigPath()   X-Ref
Trusted repositories location

By default trusted repositories are located at config/plugin_repositories.txt

return: string  Trusted repositories  path

_getRepositoriesCahePath()   X-Ref
Cached informations about available plugins

return: string  Plugin information cache path. By default AK_TMP_DIR.DS.'plugin_repositories.yaml'

_shouldUseSvnExternals()   X-Ref
No description

_shouldUseSvnCheckout()   X-Ref
No description

_installUsingCheckout($name, $uri, $rev = null, $force = false)   X-Ref
No description

_updateUsingCheckout($name)   X-Ref
No description

_installUsingLocalDirectory($name, $path, $rev = null)   X-Ref
No description

_updateUsingLocalDirectory($name)   X-Ref
No description

_installUsingExport($name, $uri, $rev = null, $force = false)   X-Ref
No description

_updateUsingExport($name, $uri)   X-Ref
No description

_installUsingExternals($name, $uri, $rev = null, $force = false)   X-Ref
No description

_updateUsingExternals($name)   X-Ref
No description

_updateUsingHttp($name, $uri)   X-Ref
No description

_setExternals($items, $extras = '')   X-Ref
No description

_uninstallExternals($name)   X-Ref
No description

_getExternals()   X-Ref
No description

_installUsingHttp($name, $uri)   X-Ref
No description



Generated: Mon Oct 27 12:43:49 2008 Cross-referenced by PHPXref 0.6