FluidTYPO3\Flux\Utility\CompatibilityRegistry::register PHP Method

register() public static method

public static register ( string $scope, array $versionedVariables, boolean $deprecationWarnings = FALSE ) : void
$scope string
$versionedVariables array
$deprecationWarnings boolean
return void
    public static function register($scope, array $versionedVariables, $deprecationWarnings = FALSE)
    {
        if (TRUE === $deprecationWarnings && NULL === static::resolveVersionedValue($versionedVariables, self::VERSION_DEFAULT)) {
            GeneralUtility::deprecationLog(sprintf('FluidTYPO3.Flux: CompatibilityRegistry was given versioned variables in scope %s but the versioned values ' . 'do not contain at least one value that applies on this version (%s)', $scope, static::resolveVersion(self::VERSION_DEFAULT)));
        }
        static::$registry[$scope] = $versionedVariables;
    }

Usage Example

Ejemplo n.º 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));
     }
 }
All Usage Examples Of FluidTYPO3\Flux\Utility\CompatibilityRegistry::register