/** * Parse an addon's README file. * * @param string $Path The base path to search from. * @return string */ protected function parseReadme($Path) { $ReadmePaths = array('/readme', '/README', '/readme.md', '/README.md', '/readme.txt', '/README.txt'); $Description = ''; // Get the list of potential files to analyze. $Entries = UpdateModel::findFiles($Path, $ReadmePaths); if ($Entries === false) { return ''; } foreach ($Entries as $Entry) { $ReadMeContents = file_get_contents($Entry['Path']); $Description = Gdn_Format::markdown($ReadMeContents); } $FolderPath = substr($Path, 0, -4); Gdn_FileSystem::removeFolder($FolderPath); return $Description; }