register() публичный статический Метод

public static register ( string $scope, array $versionedVariables, boolean $deprecationWarnings = FALSE ) : void
$scope string
$versionedVariables array
$deprecationWarnings boolean
Результат void
Пример #1
0
 /**
  * Constructor - takes an array of manifest data in the
  * same structure as in the manifest JSON file, or an
  * extension key in which case the expected manifest
  * is resolved using that and naming convention of the
  * manifest file. Or takes a full path to the manifest
  * file in which case the manifest is read from there.
  *
  * Note: applies CompatibilityRegistry-resolved versioned
  * manifest configuration values immediately.
  *
  * @param mixed $seedArrayOrExtensionKeyOrManifestPath
  */
 public function __construct($seedArrayOrExtensionKeyOrManifestPath)
 {
     if (is_array($seedArrayOrExtensionKeyOrManifestPath)) {
         $this->manifest = $seedArrayOrExtensionKeyOrManifestPath;
     } else {
         $possibleExtensionKey = ExtensionNamingUtility::getExtensionKey($seedArrayOrExtensionKeyOrManifestPath);
         if (ExtensionManagementUtility::isLoaded($possibleExtensionKey)) {
             $this->manifest = $this->loadManifestFile(GeneralUtility::getFileAbsFileName(sprintf('EXT:%s/flux.json', $possibleExtensionKey)));
         } else {
             $this->manifest = $this->loadManifestFile($seedArrayOrExtensionKeyOrManifestPath);
         }
     }
     if (!empty($this->manifest['compatibility'])) {
         $scope = $this->manifest['package'] . '/ManifestOverlay';
         CompatibilityRegistry::register($scope, $this->manifest['compatibility']);
         RecursiveArrayUtility::mergeRecursiveOverrule($this->manifest, CompatibilityRegistry::get($scope));
     }
 }
Пример #2
0
<?php

if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['flux']['setup'] = unserialize($_EXTCONF);
// Configure the CompatibilityRegistry so it will return the right values based on TYPO3 version:
\FluidTYPO3\Flux\Utility\CompatibilityRegistry::register('FluidTYPO3\\Flux\\Backend\\Preview', array('6.2.0' => 'FluidTYPO3\\Flux\\Backend\\LegacyPreview', '7.1.0' => 'FluidTYPO3\\Flux\\Backend\\Preview'));
\FluidTYPO3\Flux\Utility\CompatibilityRegistry::register('FluidTYPO3\\Flux\\Hooks\\ContentIconHookSubscriber->addSubIcon', array('6.2.0' => 'FluidTYPO3\\Flux\\Hooks\\LegacyContentIconHookSubscriber->addSubIcon', '7.1.0' => 'FluidTYPO3\\Flux\\Hooks\\ContentIconHookSubscriber->addSubIcon'));
if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['flux'])) {
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['flux'] = array('groups' => array('system'));
}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin('FluidTYPO3.Flux', 'API', array('Flux' => 'renderChildContent'), array());
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript($_EXTKEY, 'setup', '
	plugin.tx_flux.view {
		templateRootPath = EXT:flux/Resources/Private/Templates/
		partialRootPath = EXT:flux/Resources/Private/Partials/
		layoutRootPath = EXT:flux/Resources/Private/Layouts/
	}
	plugin.tx_flux.settings {
		flexform {
			rteDefaults = richtext:rte_transform[flag=rte_enabled|mode=ts_css]
		}
	}
');
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['getFlexFormDSClass']['flux'] = 'FluidTYPO3\\Flux\\Backend\\DynamicFlexForm';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = 'FluidTYPO3\\Flux\\Backend\\TceMain';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] = 'FluidTYPO3\\Flux\\Backend\\TceMain';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass'][] = 'FluidTYPO3\\Flux\\Backend\\TceMain';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'][] = 'FluidTYPO3\\Flux\\Backend\\TceMain->clearCacheCommand';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tstemplate.php']['includeStaticTypoScriptSources']['flux'] = 'FluidTYPO3\\Flux\\Backend\\TypoScriptTemplate->preprocessIncludeStaticTypoScriptSources';
Пример #3
0
 /**
  * @param array $versionedValues
  * @param string $version
  * @param mixed $default
  * @param mixed $expected
  * @test
  * @dataProvider getRegisterAndRetrieveTestValues
  */
 public function testRegisterAndRetieve(array $versionedValues, $version, $default, $expected)
 {
     CompatibilityRegistry::register('foo', $versionedValues, FALSE);
     $this->assertEquals($expected, CompatibilityRegistry::get('foo', $version, $default));
 }