本文整理汇总了PHP中TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray方法的典型用法代码示例。如果您正苦于以下问题:PHP ExtensionManagementUtility::getLoadedExtensionListArray方法的具体用法?PHP ExtensionManagementUtility::getLoadedExtensionListArray怎么用?PHP ExtensionManagementUtility::getLoadedExtensionListArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Utility\ExtensionManagementUtility
的用法示例。
在下文中一共展示了ExtensionManagementUtility::getLoadedExtensionListArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
/**
* Main function, returning the HTML content
*
* @return string HTML
*/
function main()
{
$content = '';
$this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
$this->installTool = $this->objectManager->get('TYPO3\\CMS\\Extensionmanager\\Utility\\InstallUtility');
$databaseUpdateUtility = $this->objectManager->get('SJBR\\StaticInfoTables\\Utility\\DatabaseUpdateUtility');
// Clear the class cache
$classCacheManager = $this->objectManager->get('SJBR\\StaticInfoTables\\Cache\\ClassCacheManager');
$classCacheManager->reBuild();
// Process the database updates of this base extension (we want to re-process these updates every time the update script is invoked)
$extensionSitePath = ExtensionManagementUtility::extPath(GeneralUtility::camelCaseToLowerCaseUnderscored($this->extensionName));
$content .= '<p>' . nl2br(LocalizationUtility::translate('updateTables', $this->extensionName)) . '</p>';
$this->importStaticSqlFile($extensionSitePath);
// Get the extensions which want to extend static_info_tables
$loadedExtensions = array_unique(ExtensionManagementUtility::getLoadedExtensionListArray());
foreach ($loadedExtensions as $extensionKey) {
$extensionInfoFile = ExtensionManagementUtility::extPath($extensionKey) . 'Configuration/DomainModelExtension/StaticInfoTables.txt';
if (file_exists($extensionInfoFile)) {
// We need to reprocess the database structure update sql statements (ext_tables)
$this->processDatabaseUpdates($extensionKey);
// Now we process the static data updates (ext_tables_static+adt)
// Note: The Install Tool Utility does not handle sql update statements
$databaseUpdateUtility->doUpdate($extensionKey);
$content .= '<p>' . nl2br(LocalizationUtility::translate('updateLanguageLabels', $this->extensionName)) . ' ' . $extensionKey . '</p>';
}
}
if (!$content) {
// Nothing to do
$content .= '<p>' . nl2br(LocalizationUtility::translate('nothingToDo', $this->extensionName)) . '</p>';
}
// Notice for old language packs
$content .= '<p>' . nl2br(LocalizationUtility::translate('update.oldLanguagePacks', $this->extensionName)) . '</p>';
return $content;
}
示例2: init
/**
* hook function
*
* @param $params
* @param $pObj
*
* @return void
* @todo add a more explaining description why this hook is required
*/
public function init(&$params, $pObj)
{
// exclude extensions, which are not worth to check them
$extensionsToCheck = array_diff(ExtensionManagementUtility::getLoadedExtensionListArray(), $this->ignoredExtensions, scandir(PATH_typo3 . 'sysext'));
// check extensions, which are worth to check
foreach ($extensionsToCheck as $extensionName) {
$extPath = ExtensionManagementUtility::extPath($extensionName);
if (file_exists($extPath . 'Meta/theme.yaml') && file_exists($extPath . 'Configuration/TypoScript/setup.txt')) {
$pObj->add(new Theme($extensionName));
}
}
}
示例3: toggleExtensionInstallationStateAction
/**
* Toggle extension installation state action
*
* @param string $extension
*/
protected function toggleExtensionInstallationStateAction($extension)
{
$installedExtensions = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray();
if (in_array($extension, $installedExtensions)) {
// uninstall
$this->installUtility->uninstall($extension);
} else {
// install
$this->managementService->resolveDependenciesAndInstall($this->installUtility->enrichExtensionWithDetails($extension));
}
$this->redirect('index', 'List', NULL, array(self::TRIGGER_RefreshModuleMenu => TRUE));
}
示例4: getAllInstalledFluidEnabledExtensions
/**
* @param boolean $includeCoreExtensions
* @return array
*/
public static function getAllInstalledFluidEnabledExtensions($includeCoreExtensions = false)
{
if (true === is_array(self::$cache)) {
return self::$cache;
}
$allExtensions = ExtensionManagementUtility::getLoadedExtensionListArray();
$fluidExtensions = [];
foreach ($allExtensions as $extensionKey) {
$fluidTemplateFolderPath = ExtensionManagementUtility::extPath($extensionKey, 'Resources/Private/Templates');
$isCore = strpos($fluidTemplateFolderPath, 'sysext');
$hasTemplates = file_exists($fluidTemplateFolderPath);
if (true === $hasTemplates) {
if (false === $isCore || true === $includeCoreExtensions && true === $isCore) {
array_push($fluidExtensions, $extensionKey);
}
}
}
self::$cache = $fluidExtensions;
return self::$cache;
}
示例5: toggleExtensionInstallationStateAction
/**
* Toggle extension installation state action
*
* @param string $extensionKey
*/
protected function toggleExtensionInstallationStateAction($extensionKey)
{
$installedExtensions = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray();
try {
if (in_array($extensionKey, $installedExtensions)) {
// uninstall
$this->installUtility->uninstall($extensionKey);
} else {
// install
$extension = $this->extensionModelUtility->mapExtensionArrayToModel($this->installUtility->enrichExtensionWithDetails($extensionKey));
if ($this->managementService->installExtension($extension) === FALSE) {
$this->redirect('unresolvedDependencies', 'List', NULL, array('extensionKey' => $extensionKey));
}
}
} catch (\TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException $e) {
$this->addFlashMessage(htmlspecialchars($e->getMessage()), '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
} catch (\TYPO3\Flow\Package\Exception\PackageStatesFileNotWritableException $e) {
$this->addFlashMessage(htmlspecialchars($e->getMessage()), '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
}
$this->redirect('index', 'List', NULL, array(self::TRIGGER_RefreshModuleMenu => TRUE));
}
示例6: getExtensibleExtensions
/**
* Get all loaded extensions which try to extend EXT:news
*
* @return array
*/
protected function getExtensibleExtensions()
{
$loadedExtensions = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray();
// Get the extensions which want to extend news
$extensibleExtensions = array();
foreach ($loadedExtensions as $extensionKey) {
try {
$extensionInfoFile = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($extensionKey, 'Resources/Private/extend-news.txt');
if (file_exists($extensionInfoFile)) {
$info = \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($extensionInfoFile);
$classes = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(LF, $info, TRUE);
foreach ($classes as $class) {
$extensibleExtensions[$class][$extensionKey] = 1;
}
}
} catch (Exception $e) {
$message = sprintf('Class cache could not been been build. Error "%s" with extension "%s"!', $e->getMessage(), $extensionKey);
\TYPO3\CMS\Core\Utility\GeneralUtility::devLog($message, 'news');
}
}
return $extensibleExtensions;
}
示例7: loadRequireJs
/**
* Call function if you need the requireJS library
* this automatically adds the JavaScript path of all loaded extensions in the requireJS path option
* so it resolves names like TYPO3/CMS/MyExtension/MyJsFile to EXT:MyExtension/Resources/Public/JavaScript/MyJsFile.js
* when using requireJS
*
* @return void
*/
public function loadRequireJs()
{
// load all paths to map to package names / namespaces
if (count($this->requireJsConfig) === 0) {
// first, load all paths for the namespaces, and configure contrib libs.
$this->requireJsConfig['paths'] = array('jquery-ui' => 'contrib/jqueryui', 'jquery' => 'contrib/jquery');
// get all extensions that are loaded
$loadedExtensions = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray();
foreach ($loadedExtensions as $packageName) {
$fullJsPath = 'EXT:' . $packageName . '/Resources/Public/JavaScript/';
$fullJsPath = GeneralUtility::getFileAbsFileName($fullJsPath);
$fullJsPath = \TYPO3\CMS\Core\Utility\PathUtility::getRelativePath(PATH_typo3, $fullJsPath);
$fullJsPath = rtrim($fullJsPath, '/');
if ($fullJsPath) {
$this->requireJsConfig['paths']['TYPO3/CMS/' . GeneralUtility::underscoredToUpperCamelCase($packageName)] = $this->backPath . $fullJsPath;
}
}
// check if additional AMD modules need to be loaded if a single AMD module is initialized
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['RequireJS']['postInitializationModules'])) {
$this->addInlineSettingArray('RequireJS.PostInitializationModules', $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['RequireJS']['postInitializationModules']);
}
}
$this->addRequireJs = TRUE;
}
示例8: loadRequireJs
/**
* Call function if you need the requireJS library
* this automatically adds the JavaScript path of all loaded extensions in the requireJS path option
* so it resolves names like TYPO3/CMS/MyExtension/MyJsFile to EXT:MyExtension/Resources/Public/JavaScript/MyJsFile.js
* when using requireJS
*
* @return void
*/
public function loadRequireJs()
{
// load all paths to map to package names / namespaces
if (empty($this->requireJsConfig)) {
// In order to avoid browser caching of JS files, adding a GET parameter to the files loaded via requireJS
if (GeneralUtility::getApplicationContext()->isDevelopment()) {
$this->requireJsConfig['urlArgs'] = 'bust=' . $GLOBALS['EXEC_TIME'];
} else {
$this->requireJsConfig['urlArgs'] = 'bust=' . GeneralUtility::hmac(TYPO3_version . PATH_site);
}
// first, load all paths for the namespaces, and configure contrib libs.
$this->requireJsConfig['paths'] = array('jquery-ui' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/jquery-ui', 'datatables' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/jquery.dataTables', 'nprogress' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/nprogress', 'moment' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/moment', 'cropper' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/cropper.min', 'imagesloaded' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/imagesloaded.pkgd.min', 'bootstrap' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/bootstrap/bootstrap', 'twbs/bootstrap-datetimepicker' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/bootstrap-datetimepicker', 'autosize' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/autosize', 'taboverride' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/taboverride.min', 'twbs/bootstrap-slider' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/bootstrap-slider.min', 'jquery/autocomplete' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/jquery.autocomplete');
// get all extensions that are loaded
$loadedExtensions = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray();
foreach ($loadedExtensions as $packageName) {
$fullJsPath = 'EXT:' . $packageName . '/Resources/Public/JavaScript/';
$fullJsPath = GeneralUtility::getFileAbsFileName($fullJsPath);
$fullJsPath = \TYPO3\CMS\Core\Utility\PathUtility::getRelativePath(PATH_typo3, $fullJsPath);
$fullJsPath = rtrim($fullJsPath, '/');
if ($fullJsPath) {
$this->requireJsConfig['paths']['TYPO3/CMS/' . GeneralUtility::underscoredToUpperCamelCase($packageName)] = $this->backPath . $fullJsPath;
}
}
// check if additional AMD modules need to be loaded if a single AMD module is initialized
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['RequireJS']['postInitializationModules'])) {
$this->addInlineSettingArray('RequireJS.PostInitializationModules', $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['RequireJS']['postInitializationModules']);
}
}
$this->addRequireJs = true;
}
示例9: getRequiredExtensionListArrayReturnsUniqueList
/**
* @test
*/
public function getRequiredExtensionListArrayReturnsUniqueList()
{
$GLOBALS['TYPO3_CONF_VARS']['EXT']['requiredExt'] = 'foo,bar,foo';
$this->assertEquals(array('foo', 'bar'), array_intersect(array('foo', 'bar'), \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray()));
}
示例10: loadRequireJs
/**
* Call function if you need the requireJS library
* this automatically adds the JavaScript path of all loaded extensions in the requireJS path option
* so it resolves names like TYPO3/CMS/MyExtension/MyJsFile to EXT:MyExtension/Resources/Public/JavaScript/MyJsFile.js
* when using requireJS
*
* @return void
*/
public function loadRequireJs()
{
if (!empty($this->requireJsConfig)) {
return;
}
$this->addRequireJs = true;
$loadedExtensions = ExtensionManagementUtility::getLoadedExtensionListArray();
$isDevelopment = GeneralUtility::getApplicationContext()->isDevelopment();
$cacheIdentifier = 'requireJS_' . md5(implode(',', $loadedExtensions) . ($isDevelopment ? ':dev' : ''));
/** @var VariableFrontend $cache */
$cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('assets');
$this->requireJsConfig = $cache->get($cacheIdentifier);
// if we did not get a configuration from the cache, compute and store it in the cache
if (empty($this->requireJsConfig)) {
$this->requireJsConfig = $this->computeRequireJsConfig($isDevelopment, $loadedExtensions);
$cache->set($cacheIdentifier, $this->requireJsConfig);
}
}
示例11: extensionSelector
/**
* Returns a selector-box with loaded extension keys
*
* @param string $prefix Form element name prefix
* @param array $value The current values selected
* @return string HTML select element
*/
public function extensionSelector($prefix, $value)
{
$loadedExtensions = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray();
// make box:
$opt = array();
$opt[] = '<option value=""></option>';
foreach ($loadedExtensions as $extensionKey) {
$sel = '';
if (is_array($value)) {
$sel = in_array($extensionKey, $value) ? ' selected="selected"' : '';
}
$opt[] = '<option value="' . htmlspecialchars($extensionKey) . '"' . $sel . '>' . htmlspecialchars($extensionKey) . '</option>';
}
return '<select name="' . $prefix . '[]" multiple="multiple" size="' . MathUtility::forceIntegerInRange(count($opt), 5, 10) . '">' . implode('', $opt) . '</select>';
}
示例12: makeAdvancedOptionsForm
/**
* Create advanced options form
* Sets content in $this->content
*
* @param array $inData Form configurat data
* @return void
*/
public function makeAdvancedOptionsForm($inData)
{
$loadedExtensions = ExtensionManagementUtility::getLoadedExtensionListArray();
$loadedExtensions = array_combine($loadedExtensions, $loadedExtensions);
$this->standaloneView->assign('extensions', $loadedExtensions);
$this->standaloneView->assign('inData', $inData);
}
示例13: getExtensibleExtensions
/**
* Get all loaded extensions which try to extend EXT:static_info_tables
*
* @return array
*/
protected function getExtensibleExtensions()
{
$loadedExtensions = array_unique(ExtensionManagementUtility::getLoadedExtensionListArray());
// Get the extensions which want to extend static_info_tables
$extensibleExtensions = array();
foreach ($loadedExtensions as $extensionKey) {
$extensionInfoFile = ExtensionManagementUtility::extPath($extensionKey) . 'Configuration/DomainModelExtension/StaticInfoTables.txt';
if (file_exists($extensionInfoFile)) {
$info = GeneralUtility::getUrl($extensionInfoFile);
$classes = GeneralUtility::trimExplode(LF, $info, TRUE);
foreach ($classes as $class) {
$extensibleExtensions[$class][$extensionKey] = 1;
}
}
}
return $extensibleExtensions;
}
示例14: detectExtensionsContainingViewHelpers
/**
* @return array
*/
protected function detectExtensionsContainingViewHelpers()
{
$detected = array();
foreach (ExtensionManagementUtility::getLoadedExtensionListArray() as $extensionKey) {
if (!in_array($extensionKey, $this->blackistedSystemExtensionKeys)) {
if (is_dir(GeneralUtility::getFileAbsFileName('EXT:' . $extensionKey . '/Classes/ViewHelpers'))) {
$detected[] = isset($this->systemExtensionKeyMap[$extensionKey]) ? $this->systemExtensionKeyMap[$extensionKey] : $extensionKey;
}
}
}
return $detected;
}
示例15: getInstalledExtensions
/**
* Get a list of installed extensions
*
* @return array of installed extensions
*/
public static function getInstalledExtensions()
{
if (self::$installedExtensions !== NULL) {
return self::$installedExtensions;
}
if (t3lib_div::int_from_ver(TYPO3_version) < 6001000) {
/** @var $extensionList tx_em_Extensions_List */
$extensionList = t3lib_div::makeInstance('tx_em_Extensions_List');
list($list, ) = $extensionList->getInstalledExtensions();
$list = array_keys($list);
} else {
$list = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray();
}
self::$installedExtensions = $list;
return $list;
}