|
|
|
@ -81,6 +81,9 @@ Class SiteController extends Controller {
@@ -81,6 +81,9 @@ Class SiteController extends Controller {
|
|
|
|
|
|
|
|
|
|
//获取联系方式 |
|
|
|
|
$titles = array(); |
|
|
|
|
$cacheKey = $this->getCacheKey('root', 'readme', $maxScanDeep); |
|
|
|
|
$cachedData = Common::getCacheFromFile($cacheKey); |
|
|
|
|
if (empty($cachedData)) { |
|
|
|
|
$readmeFile = $scanner->getDefaultReadme(); |
|
|
|
|
if (!empty($readmeFile)) { |
|
|
|
|
$titles = $scanner->getMDTitles($readmeFile['id']); |
|
|
|
@ -89,6 +92,12 @@ Class SiteController extends Controller {
@@ -89,6 +92,12 @@ Class SiteController extends Controller {
|
|
|
|
|
$content = file_get_contents($readmeFile['realpath']); |
|
|
|
|
$htmlReadme = $Parsedown->text($content); |
|
|
|
|
$htmlReadme = $scanner->fixMDUrls($readmeFile['realpath'], $htmlReadme); |
|
|
|
|
|
|
|
|
|
Common::saveCacheToFile($cacheKey, array('htmlReadme' => $htmlReadme, 'titles' => $titles)); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
$htmlReadme = $cachedData['htmlReadme']; |
|
|
|
|
$titles = $cachedData['titles']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|