Neos\Flow\Package\PackageInterface::getComposerManifest PHP Метод

getComposerManifest() публичный Метод

Returns the composer manifest of this package or just contents of a specific key of the full configuration.
public getComposerManifest ( string $key = null ) : mixed
$key string
Результат mixed
    public function getComposerManifest($key = null);

Usage Example

 /**
  * @param PackageInterface $package
  * @return array
  */
 protected function getPrimaryNamespaceAndEntryPath(PackageInterface $package)
 {
     $autoloadConfigurations = $package->getComposerManifest('autoload');
     $firstAutoloadType = null;
     $firstAutoloadConfiguration = null;
     foreach ($autoloadConfigurations as $autoloadType => $autoloadConfiguration) {
         if (ClassLoader::isAutoloadTypeWithPredictableClassPath($autoloadType)) {
             $firstAutoloadType = $autoloadType;
             $firstAutoloadConfiguration = $autoloadConfiguration;
             break;
         }
     }
     $autoloadPaths = reset($firstAutoloadConfiguration);
     $firstAutoloadPath = is_array($autoloadPaths) ? reset($autoloadPaths) : $autoloadPaths;
     $namespace = key($firstAutoloadConfiguration);
     $autoloadPathPostfix = '';
     if ($firstAutoloadType === ClassLoader::MAPPING_TYPE_PSR0) {
         $autoloadPathPostfix = str_replace('\\', '/', trim($namespace, '\\'));
     }
     return [$namespace, Files::concatenatePaths([$package->getPackagePath(), $firstAutoloadPath, $autoloadPathPostfix]), $firstAutoloadType];
 }