reader = $readFactory->create(BP); } /** * Get the list of files and directory paths from magento-base extra/map section. * * @return string [] * @throws \Magento\Setup\Exception */ public function getPaths() { // Locate composer.json for magento2-base module $filesPathList = []; $vendorDir = require VENDOR_PATH; $basePackageComposerFilePath = $vendorDir . '/' . self::MAGENTO_BASE_PACKAGE_COMPOSER_JSON_FILE; if (!$this->reader->isExist($basePackageComposerFilePath)) { throw new \Magento\Setup\Exception( 'Could not locate ' . self::MAGENTO_BASE_PACKAGE_COMPOSER_JSON_FILE . ' file.' ); } if (!$this->reader->isReadable($basePackageComposerFilePath)) { throw new \Magento\Setup\Exception( 'Could not read ' . self::MAGENTO_BASE_PACKAGE_COMPOSER_JSON_FILE . ' file.' ); } // Fill array with list of files and directories from extra/map section $composerJsonFileData = json_decode($this->reader->readFile($basePackageComposerFilePath), true); if (!isset($composerJsonFileData[self::COMPOSER_KEY_EXTRA][self::COMPOSER_KEY_MAP])) { return $filesPathList; } $extraMappings = $composerJsonFileData[self::COMPOSER_KEY_EXTRA][self::COMPOSER_KEY_MAP]; foreach ($extraMappings as $map) { $filesPathList[] = $map[1]; } return $filesPathList; } }