public static function dump(Event $event)
    {
        $composer = $event->getComposer();

        $extra = $composer->getPackage()->getExtra();
        $includeAssetsDir = realpath($extra['bolt-web-path']) === realpath($extra['bolt-root-path']);

        /** @var PackageDescriptor[] $extensions */
        $extensions = [];

        $finder = self::getInstalledComposerJson();
        foreach ($finder as $jsonFile) {
            $jsonData = json_decode($jsonFile->getContents(), true);
            if (isset($jsonData['type']) && $jsonData['type'] === 'bolt-extension') {
                $webPath = sprintf('extensions/vendor/%s', $jsonData['name']);

                if ($includeAssetsDir && !empty($jsonData['extra']['bolt-assets'])) {
                    $webPath .= '/' . trim($jsonData['extra']['bolt-assets'], '/');
                }

                $extensions[$jsonData['name']] = PackageDescriptor::parse($composer, $webPath, $jsonFile->getPath(), $jsonData);
            }
        }

        $vendorDir = $composer->getConfig()->get('vendor-dir');
        $fs = new Filesystem();
        $fs->dumpFile($vendorDir . '/autoload.json', json_encode($extensions, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
    }
public static function dump(Event $event)
    {
        $composer = $event->getComposer();

        $extra = $composer->getPackage()->getExtra();
        $includeAssetsDir = realpath($extra['bolt-web-path']) === realpath($extra['bolt-root-path']);

        /** @var PackageDescriptor[] $extensions */
        $extensions = [];

        $finder = self::getInstalledComposerJson();
        foreach ($finder as $jsonFile) {
            $jsonData = json_decode($jsonFile->getContents(), true);
            if (isset($jsonData['type']) && $jsonData['type'] === 'bolt-extension') {
                $webPath = sprintf('extensions/vendor/%s', $jsonData['name']);

                if ($includeAssetsDir && !empty($jsonData['extra']['bolt-assets'])) {
                    $webPath .= '/' . trim($jsonData['extra']['bolt-assets'], '/');
                }

                $extensions[$jsonData['name']] = PackageDescriptor::parse($composer, $webPath, $jsonFile->getPath(), $jsonData);
            }
        }

        $vendorDir = $composer->getConfig()->get('vendor-dir');
        $fs = new Filesystem();
        $fs->dumpFile($vendorDir . '/autoload.json', json_encode($extensions, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
    }
public static function dump ( Event $ event ) { $ composer = $ event -> getComposer ( ) ; $ extra = $ composer -> getPackage ( ) -> getExtra ( ) ; $ includeAssetsDir = realpath ( $ extra [ 'bolt-web-path' ] ) === realpath ( $ extra [ 'bolt-root-path' ] ) ; /** @var PackageDescriptor[] $extensions */ $ extensions = [ ] ; $ finder = self :: getInstalledComposerJson ( ) ; foreach ( $ finder as $ jsonFile ) { $ jsonData = json_decode ( $ jsonFile -> getContents ( ) , true ) ; if ( isset ( $ jsonData [ 'type' ] ) && $ jsonData [ 'type' ] === 'bolt-extension' ) { $ webPath = sprintf ( 'extensions/vendor/%s' , $ jsonData [ 'name' ] ) ; if ( $ includeAssetsDir && ! empty ( $ jsonData [ 'extra' ] [ 'bolt-assets' ] ) ) { $ webPath .= '/' . trim ( $ jsonData [ 'extra' ] [ 'bolt-assets' ] , '/' ) ; } $ extensions [ $ jsonData [ 'name' ] ] = PackageDescriptor :: parse ( $ composer , $ webPath , $ jsonFile -> getPath ( ) , $ jsonData ) ; } } $ vendorDir = $ composer -> getConfig ( ) -> get ( 'vendor-dir' ) ; $ fs = new Filesystem ( ) ; $ fs -> dumpFile ( $ vendorDir . '/autoload.json' , json_encode ( $ extensions , JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ) ) ; }
Dump the metadata for extension loading on the 'post-autoload-dump' event.

@param Event $event
Dump the metadata for extension loading on the post - autoload - dump event .