X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FExtension%2FMapper.php;h=f765afb7a52a743de5ae727bed002ccbefa7d7c0;hb=acef22a2302a1ef7c0280affc2322cb249cb4378;hp=0766cf98dee4c7447e3bb1b6e2482a43b3a32b98;hpb=c24be2289c776d9ee74980d0db74996804bd0eff;p=civicrm-core.git diff --git a/CRM/Extension/Mapper.php b/CRM/Extension/Mapper.php index 0766cf98de..f765afb7a5 100755 --- a/CRM/Extension/Mapper.php +++ b/CRM/Extension/Mapper.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.6 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2014 | + | Copyright CiviCRM LLC (c) 2004-2015 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -23,7 +23,7 @@ | GNU Affero General Public License or the licensing of CiviCRM, | | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ -*/ + */ /** * This class proivdes various helper functions for locating extensions @@ -42,19 +42,19 @@ * module-extensions. * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2014 + * @copyright CiviCRM LLC (c) 2004-2015 * $Id$ * */ 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}'; /** - * Extension info file name + * Extension info file name. */ const EXT_TEMPLATES_DIRNAME = 'templates'; @@ -118,7 +118,8 @@ class CRM_Extension_Mapper { * @param string $clazz * Extension class name. * - * @return string name of extension key + * @return string + * name of extension key */ public function classToKey($clazz) { return str_replace('_', '.', $clazz); @@ -130,7 +131,8 @@ class CRM_Extension_Mapper { * * @param $clazz * - * @return string full path the extension .php file + * @return string + * full path the extension .php file */ public function classToPath($clazz) { $elements = explode('_', $clazz); @@ -145,7 +147,8 @@ class CRM_Extension_Mapper { * @param string $key * A string which might be an extension key. * - * @return boolean true if given string is an extension name + * @return bool + * true if given string is an extension name */ public function isExtensionKey($key) { // check if the string is an extension name or the class @@ -159,7 +162,8 @@ class CRM_Extension_Mapper { * @param string $clazz * A string which might be an extension class name. * - * @return boolean true if given string is an extension class name + * @return bool + * true if given string is an extension class name */ public function isExtensionClass($clazz) { @@ -201,7 +205,8 @@ class CRM_Extension_Mapper { * @param string $key * Extension key. * - * @return string name of extension's main class + * @return string + * name of extension's main class */ public function keyToClass($key) { return str_replace('.', '_', $key); @@ -215,7 +220,8 @@ class CRM_Extension_Mapper { * @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 */ public function keyToPath($key) { $info = $this->keyToInfo($key); @@ -228,7 +234,8 @@ class CRM_Extension_Mapper { * * @param string $key * Extension key. - * @return string local path of the extension source tree + * @return string + * local path of the extension source tree */ public function keyToBasePath($key) { if ($key == 'civicrm') { @@ -245,7 +252,8 @@ class CRM_Extension_Mapper { * @param string $key * Extension key. * - * @return string url for resources in this extension + * @return string + * url for resources in this extension */ public function keyToUrl($key) { if ($key == 'civicrm') { @@ -264,9 +272,10 @@ class CRM_Extension_Mapper { /** * Fetch the list of active extensions of type 'module' * - * @param $fresh - * Bool whether to forcibly reload extensions list from canonical store. - * @return array - array(array('prefix' => $, 'file' => $)) + * @param bool $fresh + * whether to forcibly reload extensions list from canonical store. + * @return array + * array(array('prefix' => $, 'file' => $)) */ public function getActiveModuleFiles($fresh = FALSE) { $config = CRM_Core_Config::singleton(); @@ -316,9 +325,10 @@ class CRM_Extension_Mapper { } /** - * Get a list of base URLs for all active modules + * Get a list of base URLs for all active modules. * - * @return array (string $extKey => string $baseUrl) + * @return array + * (string $extKey => string $baseUrl) */ public function getActiveModuleUrls() { // TODO optimization/caching @@ -351,7 +361,8 @@ class CRM_Extension_Mapper { /** * Get a list of all installed modules, including enabled and disabled ones * - * @return array CRM_Core_Module + * @return array + * CRM_Core_Module */ public function getModules() { $result = array(); @@ -371,7 +382,8 @@ class CRM_Extension_Mapper { * @param string $clazz * Extension class name. * - * @return string path to extension's templates directory + * @return string + * path to extension's templates directory */ public function getTemplatePath($clazz) { $path = $this->container->getPath($this->classToKey($clazz)); @@ -381,7 +393,7 @@ class CRM_Extension_Mapper { $pathElm = explode(DIRECTORY_SEPARATOR, $path); array_pop($pathElm); return implode(DIRECTORY_SEPARATOR, $pathElm) . DIRECTORY_SEPARATOR . self::EXT_TEMPLATES_DIRNAME; - */ + */ } /** @@ -392,7 +404,8 @@ class CRM_Extension_Mapper { * @param string $clazz * Extension class name. * - * @return string extension's template name + * @return string + * extension's template name */ public function getTemplateName($clazz) { $info = $this->keyToInfo($this->classToKey($clazz)); @@ -406,4 +419,5 @@ class CRM_Extension_Mapper { $this->cache->delete($this->cacheKey . '/moduleFiles'); } } + }