projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
INFRA-132 - CRM/Case - Misc
[civicrm-core.git]
/
CRM
/
Extension
/
Mapper.php
diff --git
a/CRM/Extension/Mapper.php
b/CRM/Extension/Mapper.php
index 76ee2b9777ced528f858ff65024b4fdac0196c84..fdf7c3c2ae7ad936ef2123c09202842d7a06dc87 100755
(executable)
--- a/
CRM/Extension/Mapper.php
+++ b/
CRM/Extension/Mapper.php
@@
-1,7
+1,7
@@
<?php
/*
+--------------------------------------------------------------------+
<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.
5
|
+ | CiviCRM version 4.
6
|
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
@@
-51,7
+51,7
@@
class CRM_Extension_Mapper {
/**
* An URL for public extensions repository
*/
/**
* An URL for public extensions repository
*/
- //
CONST
DEFAULT_EXTENSIONS_REPOSITORY = 'http://civicrm.org/extdir/ver={ver}|cms={uf}';
+ //
const
DEFAULT_EXTENSIONS_REPOSITORY = 'http://civicrm.org/extdir/ver={ver}|cms={uf}';
/**
* Extension info file name
/**
* Extension info file name
@@
-84,6
+84,13
@@
class CRM_Extension_Mapper {
protected $civicrmUrl;
protected $civicrmUrl;
+ /**
+ * @param CRM_Extension_Container_Interface $container
+ * @param CRM_Utils_Cache_Interface $cache
+ * @param null $cacheKey
+ * @param null $civicrmPath
+ * @param null $civicrmUrl
+ */
public function __construct(CRM_Extension_Container_Interface $container, CRM_Utils_Cache_Interface $cache = NULL, $cacheKey = NULL, $civicrmPath = NULL, $civicrmUrl = NULL) {
$this->container = $container;
$this->cache = $cache;
public function __construct(CRM_Extension_Container_Interface $container, CRM_Utils_Cache_Interface $cache = NULL, $cacheKey = NULL, $civicrmPath = NULL, $civicrmUrl = NULL) {
$this->container = $container;
$this->cache = $cache;
@@
-95,19
+102,19
@@
class CRM_Extension_Mapper {
$this->civicrmUrl = rtrim($config->resourceBase, '/');
}
if ($civicrmPath) {
$this->civicrmUrl = rtrim($config->resourceBase, '/');
}
if ($civicrmPath) {
- $this->civicrmPath = rtrim($civicrmPath,'/');
+ $this->civicrmPath = rtrim($civicrmPath,
'/');
} else {
global $civicrm_root;
} else {
global $civicrm_root;
- $this->civicrmPath = rtrim($civicrm_root,'/');
+ $this->civicrmPath = rtrim($civicrm_root,
'/');
}
}
/**
* Given the class, provides extension's key.
*
}
}
/**
* Given the class, provides extension's key.
*
- * @access public
*
*
- * @param string $clazz extension class name
+ * @param string $clazz
+ * Extension class name.
*
* @return string name of extension key
*/
*
* @return string name of extension key
*/
@@
-118,12
+125,9
@@
class CRM_Extension_Mapper {
/**
* Given the class, provides extension path.
*
/**
* Given the class, provides extension path.
*
- * @access public
*
* @param $clazz
*
*
* @param $clazz
*
- * @internal param string $key extension key
- *
* @return string full path the extension .php file
*/
public function classToPath($clazz) {
* @return string full path the extension .php file
*/
public function classToPath($clazz) {
@@
-135,9
+139,9
@@
class CRM_Extension_Mapper {
/**
* Given the string, returns true or false if it's an extension key.
*
/**
* Given the string, returns true or false if it's an extension key.
*
- * @access public
*
*
- * @param string $key a string which might be an extension key
+ * @param string $key
+ * A string which might be an extension key.
*
* @return boolean true if given string is an extension name
*/
*
* @return boolean true if given string is an extension name
*/
@@
-149,9
+153,9
@@
class CRM_Extension_Mapper {
/**
* Given the string, returns true or false if it's an extension class name.
*
/**
* Given the string, returns true or false if it's an extension class name.
*
- * @access public
*
*
- * @param string $clazz a string which might be an extension class name
+ * @param string $clazz
+ * A string which might be an extension class name.
*
* @return boolean true if given string is an extension class name
*/
*
* @return boolean true if given string is an extension class name
*/
@@
-164,12
+168,13
@@
class CRM_Extension_Mapper {
}
/**
}
/**
- * @param string $key extension fully-qualified-name
+ * @param string $key
+ * Extension fully-qualified-name.
* @param bool $fresh
*
* @throws CRM_Extension_Exception
* @throws Exception
* @param bool $fresh
*
* @throws CRM_Extension_Exception
* @throws Exception
- * @return
object
CRM_Extension_Info
+ * @return CRM_Extension_Info
*/
public function keyToInfo($key, $fresh = FALSE) {
if ($fresh || !array_key_exists($key, $this->infos)) {
*/
public function keyToInfo($key, $fresh = FALSE) {
if ($fresh || !array_key_exists($key, $this->infos)) {
@@
-189,9
+194,9
@@
class CRM_Extension_Mapper {
/**
* Given the key, provides extension's class name.
*
/**
* Given the key, provides extension's class name.
*
- * @access public
*
*
- * @param string $key extension key
+ * @param string $key
+ * Extension key.
*
* @return string name of extension's main class
*/
*
* @return string name of extension's main class
*/
@@
-203,9
+208,9
@@
class CRM_Extension_Mapper {
* Given the key, provides the path to file containing
* extension's main class.
*
* Given the key, provides the path to file containing
* extension's main class.
*
- * @access public
*
*
- * @param string $key extension key
+ * @param string $key
+ * Extension key.
*
* @return string path to file containing extension's main class
*/
*
* @return string path to file containing extension's main class
*/
@@
-218,8
+223,8
@@
class CRM_Extension_Mapper {
* Given the key, provides the path to file containing
* extension's main class.
*
* Given the key, provides the path to file containing
* extension's main class.
*
- * @
access public
- *
@param string $key extension key
+ * @
param string $key
+ *
Extension key.
* @return string local path of the extension source tree
*/
public function keyToBasePath($key) {
* @return string local path of the extension source tree
*/
public function keyToBasePath($key) {
@@
-233,9
+238,9
@@
class CRM_Extension_Mapper {
* Given the key, provides the path to file containing
* extension's main class.
*
* Given the key, provides the path to file containing
* extension's main class.
*
- * @access public
*
*
- * @param string $key extension key
+ * @param string $key
+ * Extension key.
*
* @return string url for resources in this extension
*/
*
* @return string url for resources in this extension
*/
@@
-256,7
+261,8
@@
class CRM_Extension_Mapper {
/**
* Fetch the list of active extensions of type 'module'
*
/**
* Fetch the list of active extensions of type 'module'
*
- * @param $fresh bool whether to forcibly reload extensions list from canonical store
+ * @param $fresh
+ * Bool whether to forcibly reload extensions list from canonical store.
* @return array - array(array('prefix' => $, 'file' => $))
*/
public function getActiveModuleFiles($fresh = FALSE) {
* @return array - array(array('prefix' => $, 'file' => $))
*/
public function getActiveModuleFiles($fresh = FALSE) {
@@
-323,6
+329,11
@@
class CRM_Extension_Mapper {
return $urls;
}
return $urls;
}
+ /**
+ * @param string $name
+ *
+ * @return bool
+ */
public function isActiveModule($name) {
$activeModules = $this->getActiveModuleFiles();
foreach ($activeModules as $activeModule) {
public function isActiveModule($name) {
$activeModules = $this->getActiveModuleFiles();
foreach ($activeModules as $activeModule) {
@@
-352,9
+363,9
@@
class CRM_Extension_Mapper {
/**
* Given the class, provides the template path.
*
/**
* Given the class, provides the template path.
*
- * @access public
*
*
- * @param string $clazz extension class name
+ * @param string $clazz
+ * Extension class name.
*
* @return string path to extension's templates directory
*/
*
* @return string path to extension's templates directory
*/
@@
-373,9
+384,9
@@
class CRM_Extension_Mapper {
* Given te class, provides the template name.
* @todo consider multiple templates, support for one template for now
*
* Given te class, provides the template name.
* @todo consider multiple templates, support for one template for now
*
- * @access public
*
*
- * @param string $clazz extension class name
+ * @param string $clazz
+ * Extension class name.
*
* @return string extension's template name
*/
*
* @return string extension's template name
*/