本文整理汇总了PHP中t3lib_extMgm::getExtensionKeyByPrefix方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_extMgm::getExtensionKeyByPrefix方法的具体用法?PHP t3lib_extMgm::getExtensionKeyByPrefix怎么用?PHP t3lib_extMgm::getExtensionKeyByPrefix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t3lib_extMgm
的用法示例。
在下文中一共展示了t3lib_extMgm::getExtensionKeyByPrefix方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* @return void
*/
public function execute()
{
$contexts = array('BE', 'FE');
if ($this->getExtensionKey()) {
$extensionList = array($this->getExtensionKey());
} else {
$extensionList = Tx_Smoothmigration_Utility_ExtensionUtility::getLoadedExtensionsFiltered();
}
foreach ($contexts as $context) {
if (is_array($GLOBALS['TYPO3_CONF_VARS'][$context]['XCLASS']) && count($GLOBALS['TYPO3_CONF_VARS'][$context]['XCLASS']) > 0) {
foreach ($GLOBALS['TYPO3_CONF_VARS'][$context]['XCLASS'] as $targetClass => $implementationClass) {
if (is_file($implementationClass)) {
$path = str_replace(PATH_typo3conf . 'ext/', '', $implementationClass);
$extKey = current(explode('/', $path));
} else {
$extKey = t3lib_extMgm::getExtensionKeyByPrefix(strtolower($implementationClass));
}
if (!in_array($extKey, $extensionList)) {
continue;
}
$this->issues[] = $this->createIssue($context, $targetClass, $implementationClass, $extKey);
}
}
}
}
示例2: getExtensionIcon
/**
* Get path to ext_icon.gif from processing instruction key
*
* @param string $key Like tx_realurl_rebuild
* @return string
*/
protected function getExtensionIcon($key)
{
$extIcon = '';
if (method_exists(t3lib_extMgm, 'getExtensionKeyByPrefix')) {
$parts = explode('_', $key);
if (is_array($parts) && count($parts) > 2) {
$extensionKey = t3lib_extMgm::getExtensionKeyByPrefix('tx_' . $parts[1]);
$extIcon = t3lib_extMgm::extRelPath($extensionKey) . 'ext_icon.gif';
}
}
return $extIcon;
}
示例3: attemptToLoadRegistryForGivenClassName
/**
* Try to load the entries for a given class name into the registry.
*
* First, figures out the extension the class belongs to.
* Then, tries to load the ext_autoload.php file inside the extension directory, and adds its contents to the $classNameToFileMapping.
*
* @param string $className Class Name
*/
protected static function attemptToLoadRegistryForGivenClassName($className)
{
$classNameParts = explode('_', $className);
$extensionPrefix = array_shift($classNameParts) . '_' . array_shift($classNameParts);
$extensionKey = t3lib_extMgm::getExtensionKeyByPrefix($extensionPrefix);
if (!$extensionKey || array_key_exists($extensionKey, self::$extensionHasAutoloadConfiguration)) {
// extension key could not be determined or we already tried to load the extension's autoload configuration
return;
}
$possibleAutoloadConfigurationFileName = t3lib_extMgm::extPath($extensionKey) . 'ext_autoload.php';
if (file_exists($possibleAutoloadConfigurationFileName)) {
self::$extensionHasAutoloadConfiguration[$extensionKey] = TRUE;
$extensionClassNameToFileMapping = (require $possibleAutoloadConfigurationFileName);
self::$classNameToFileMapping = array_merge($extensionClassNameToFileMapping, self::$classNameToFileMapping);
} else {
self::$extensionHasAutoloadConfiguration[$extensionKey] = FALSE;
}
}
示例4: getExtensionKeyByPrefixForNotLoadedExtensionReturnsFalse
/**
* @test
* @see t3lib_extMgm::getExtensionKeyByPrefix
*/
public function getExtensionKeyByPrefixForNotLoadedExtensionReturnsFalse()
{
t3lib_extMgm::clearExtensionKeyMap();
$uniqueSuffix = uniqid('test');
$extensionKey = 'unloadedextension' . $uniqueSuffix;
$extensionPrefix = 'tx_unloadedextension' . $uniqueSuffix;
$this->assertFalse(t3lib_extMgm::getExtensionKeyByPrefix($extensionPrefix));
}