*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Extension_Browser {
return $exts[$key];
}
else {
- // throw new CRM_Extension_Exception("Unknown remote extension: $key");
return NULL;
}
}
/**
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
*/
/**
/**
* @inheritDoc
+ *
+ * @return array
*/
public function checkRequirements() {
$errors = array();
/**
* @inheritDoc
+ *
+ * @return array_keys
*/
public function getKeys() {
return array_keys($this->getRelPaths());
/**
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
*/
/**
/**
* @inheritDoc
+ *
+ * @return array
*/
public function checkRequirements() {
$errors = array();
/**
* @inheritDoc
+ *
+ * @return array_keys
*/
public function getKeys() {
$k2c = $this->getKeysToContainer();
/**
* @inheritDoc
+ *
+ * @param string $key
*/
public function getPath($key) {
return $this->getContainer($key)->getPath($key);
/**
* @inheritDoc
+ *
+ * @param string $key
*/
public function getResUrl($key) {
return $this->getContainer($key)->getResUrl($key);
<?php
+/*
+ +--------------------------------------------------------------------+
+ | CiviCRM version 4.7 |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM. |
+ | |
+ | CiviCRM is free software; you can copy, modify, and distribute it |
+ | under the terms of the GNU Affero General Public License |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
+ | |
+ | CiviCRM is distributed in the hope that it will be useful, but |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
+ | See the GNU Affero General Public License for more details. |
+ | |
+ | You should have received a copy of the GNU Affero General Public |
+ | License and the CiviCRM Licensing Exception along |
+ | with this program; if not, contact CiviCRM LLC |
+ | at info[AT]civicrm[DOT]org. If you have questions about the |
+ | GNU Affero General Public License or the licensing of CiviCRM, |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ +--------------------------------------------------------------------+
+ */
+
+/**
+ * @package CRM
+ * @copyright CiviCRM LLC (c) 2004-2015
+ */
/**
* The default container is just a basic container which can be configured via
/**
* @inheritDoc
+ *
+ * @return array
*/
public function checkRequirements() {
$errors = array();
/**
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
*/
/**
/**
* Determine if any unmet requirements prevent use of this container.
- *
- * @return array
- * List of error messages; empty if OK.
*/
public function checkRequirements();
/**
* Get a list of extensions available in this container.
- *
- * @return array
- * List of keys (strings).
*/
public function getKeys();
*
* @param string $key
* Fully-qualified extension name.
- * @return string
- * Local path to the extension's main .php file.
- * @throws Exception
*/
public function getPath($key);
*
* @param string $key
* Fully-qualified extension name.
- * @return string
- * Public URL.
- * @throws Exception
*/
public function getResUrl($key);
/**
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
*/
/**
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Extension_Downloader {
/**
$url = CRM_Utils_System::url('civicrm/admin/setting/path', "reset=1&civicrmDestination=${civicrmDestination}");
$errors[] = array(
'title' => ts('Directory Unwritable'),
- //'message' => ts('Your extensions directory: %1 is not web server writable. Please go to the <a href="%2">path setting page</a> and correct it.<br/>',
'message' => ts("Your extensions directory is not set or is not writable. Click <a href='%1'>here</a> to set the extensions directory.",
array(
- //1 => $this->containerDir,
1 => $url,
)
),
/**
* Class CRM_Extension_Exception
+ *
+ * @package CRM
+ * @copyright CiviCRM LLC (c) 2004-2015
*/
class CRM_Extension_Exception extends CRM_Core_Exception {
}
+--------------------------------------------------------------------+
*/
+/**
+ * @package CRM
+ * @copyright CiviCRM LLC (c) 2004-2015
+ */
+
/**
* An extension management operation failed because it would
* break a dependency.
+--------------------------------------------------------------------+
*/
+
+/**
+ * @package CRM
+ * @copyright CiviCRM LLC (c) 2004-2015
+ */
+
/**
* An extension could not be located
*/
+--------------------------------------------------------------------+
*/
+/**
+ * @package CRM
+ * @copyright CiviCRM LLC (c) 2004-2015
+ */
+
/**
* Error reading XML for an extension
*/
/**
* Metadata for an extension (e.g. the extension's "info.xml" file)
+ *
+ * @package CRM
+ * @copyright CiviCRM LLC (c) 2004-2015
*/
class CRM_Extension_Info {
* Copy attributes from an XML document to $this
*
* @param SimpleXMLElement $info
- * @return void
*/
public function parse($info) {
$this->key = (string) $info->attributes()->key;
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Extension_Manager {
/**
*
* @param string $tmpCodeDir
* Path to a local directory containing a copy of the new (inert) code.
- * @return void
* @throws CRM_Extension_Exception
*/
public function replace($tmpCodeDir) {
*
* @param array $keys
* List of extension keys.
- * @return void
* @throws CRM_Extension_Exception
*/
public function install($keys) {
foreach ($keys as $key) {
list ($info, $typeManager) = $this->_getInfoTypeHandler($key); // throws Exception
- //print_r(array('post post?', $info, 'k' => $key, 'os'=> $origStatuses[$key]));
switch ($origStatuses[$key]) {
case self::STATUS_INSTALLED:
*
* @param array $keys
* List of extension keys.
- * @return void
* @throws CRM_Extension_Exception
*/
public function enable($keys) {
*
* @param array $keys
* List of extension keys.
- * @return void
* @throws CRM_Extension_Exception
*/
public function disable($keys) {
*
* @param array $keys
* List of extension keys.
- * @return void
* @throws CRM_Extension_Exception
*/
public function uninstall($keys) {
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Extension_Manager_Base implements CRM_Extension_Manager_Interface {
/**
* @inheritDoc
+ *
+ * @param CRM_Extension_Info $info
*/
public function onPreInstall(CRM_Extension_Info $info) {
}
/**
* @inheritDoc
+ *
+ * @param CRM_Extension_Info $info
*/
public function onPostInstall(CRM_Extension_Info $info) {
}
/**
* @inheritDoc
+ *
+ * @param CRM_Extension_Info $info
*/
public function onPostPostInstall(CRM_Extension_Info $info) {
}
/**
* @inheritDoc
+ *
+ * @param CRM_Extension_Info $info
*/
public function onPreEnable(CRM_Extension_Info $info) {
}
/**
* @inheritDoc
+ *
+ * @param CRM_Extension_Info $info
*/
public function onPostEnable(CRM_Extension_Info $info) {
}
/**
* @inheritDoc
+ *
+ * @param CRM_Extension_Info $info
*/
public function onPreDisable(CRM_Extension_Info $info) {
}
/**
* @inheritDoc
+ *
+ * @param CRM_Extension_Info $info
*/
public function onPostDisable(CRM_Extension_Info $info) {
}
/**
* @inheritDoc
+ *
+ * @param CRM_Extension_Info $info
*/
public function onPreUninstall(CRM_Extension_Info $info) {
}
/**
* @inheritDoc
+ *
+ * @param CRM_Extension_Info $info
*/
public function onPostUninstall(CRM_Extension_Info $info) {
}
/**
* @inheritDoc
+ *
+ * @param CRM_Extension_Info $oldInfo
+ * @param CRM_Extension_Info $newInfo
*/
public function onPreReplace(CRM_Extension_Info $oldInfo, CRM_Extension_Info $newInfo) {
if ($this->autoReplace) {
/**
* @inheritDoc
+ *
+ * @param CRM_Extension_Info $oldInfo
+ * @param CRM_Extension_Info $newInfo
*/
public function onPostReplace(CRM_Extension_Info $oldInfo, CRM_Extension_Info $newInfo) {
if ($this->autoReplace) {
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
interface CRM_Extension_Manager_Interface {
/**
/**
* @param CRM_Extension_Info $info
- *
- * @return mixed
*/
public function onPreEnable(CRM_Extension_Info $info);
/**
* @param CRM_Extension_Info $info
- *
- * @return mixed
*/
public function onPostEnable(CRM_Extension_Info $info);
/**
* @param CRM_Extension_Info $oldInfo
* @param CRM_Extension_Info $newInfo
- *
- * @return mixed
*/
public function onPreReplace(CRM_Extension_Info $oldInfo, CRM_Extension_Info $newInfo);
/**
* @param CRM_Extension_Info $oldInfo
* @param CRM_Extension_Info $newInfo
- *
- * @return mixed
*/
public function onPostReplace(CRM_Extension_Info $oldInfo, CRM_Extension_Info $newInfo);
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Extension_Manager_Module extends CRM_Extension_Manager_Base {
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Extension_Manager_Payment extends CRM_Extension_Manager_Base {
/**
* @inheritDoc
+ *
+ * @param CRM_Extension_Info $info
*/
public function onPreInstall(CRM_Extension_Info $info) {
$paymentProcessorTypes = $this->_getAllPaymentProcessorTypes('class_name');
/**
* @inheritDoc
+ *
+ * @param CRM_Extension_Info $info
*/
public function onPostInstall(CRM_Extension_Info $info) {
$this->_runPaymentHook($info, 'install');
/**
* @inheritDoc
+ *
+ * @param CRM_Extension_Info $info
*/
public function onPreUninstall(CRM_Extension_Info $info) {
$paymentProcessorTypes = $this->_getAllPaymentProcessorTypes('class_name');
/**
* @inheritDoc
+ *
+ * @param CRM_Extension_Info $info
*/
public function onPreDisable(CRM_Extension_Info $info) {
// HMM? // if ($this->type == 'payment' && $this->status != 'missing') {
/**
* @inheritDoc
+ *
+ * @param CRM_Extension_Info $info
*/
public function onPreEnable(CRM_Extension_Info $info) {
$paymentProcessorTypes = $this->_getAllPaymentProcessorTypes('class_name');
/**
* @inheritDoc
+ *
+ * @param CRM_Extension_Info $info
*/
public function onPostEnable(CRM_Extension_Info $info) {
// HMM? // if ($this->type == 'payment' && $this->status != 'missing') {
* @param string $attr
* The attribute used to key the array.
* @return array
- * ($$attr => $id)
+ * ($attr => $id)
*/
private function _getAllPaymentProcessorTypes($attr) {
$ppt = array();
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Extension_Manager_Report extends CRM_Extension_Manager_Base {
- /**
- */
const REPORT_GROUP_NAME = 'report_template';
- /**
- */
public function __construct() {
parent::__construct(TRUE);
$this->groupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup',
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Extension_Manager_Search extends CRM_Extension_Manager_Base {
- /**
- */
const CUSTOM_SEARCH_GROUP_NAME = 'custom_search';
- /**
- */
public function __construct() {
parent::__construct(TRUE);
$this->groupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup',
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Extension_Mapper {
/**
* An URL for public extensions repository.
*/
- //const DEFAULT_EXTENSIONS_REPOSITORY = 'http://civicrm.org/extdir/ver={ver}|cms={uf}';
/**
* Extension info file name.
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Extension_System {
private static $singleton;
$url = CRM_Core_BAO_Setting::getItem('Extension Preferences', 'ext_repo_url', NULL, CRM_Extension_Browser::DEFAULT_EXTENSIONS_REPOSITORY);
// boolean false means don't try to check extensions
- // http://issues.civicrm.org/jira/browse/CRM-10575
+ // CRM-10575
if ($url === FALSE) {
$this->_repoUrl = FALSE;
}
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Extension_Upgrades {