getLastBookmark(); $shaarliCache = $shaarli->makeList(); if ($params['config']['useCache'] === true) { Cache::setCache('shaarli.html', $shaarliCache, 'feed'); } $lastShaare = $shaarliCache; } $lastAppsUpdates = Cache::getCache('gitea.html', 'feed'); if ($lastAppsUpdates === null) { $gitea = new Gitea($params); $gitea->getLastRepo(); $repoCache = $gitea->makeList(); Cache::unValidateCache('gitea.html', 'feed'); Cache::unValidateCache('home.html', 'page'); if ($params['config']['useCache'] === true) { Cache::setCache('gitea.html', $repoCache, 'feed'); } $lastAppsUpdates = $repoCache; } $lastPost = Cache::getCache('posts.html', 'feed'); if ($lastPost === null) { $post = new Blogs($params); $post->getLastPost(); $postCache = $post->makeList(); Cache::unValidateCache('posts.html', 'feed'); Cache::unValidateCache('home.html', 'page'); if ($params['config']['useCache'] === true) { Cache::setCache('posts.html', $postCache, 'feed'); } $lastPost = $postCache; } $lastPics = Cache::getCache('nanogal.html', 'feed'); if ($lastPics === null) { $nanogal = new NanoGal($params); Cache::unValidateCache('nanogal.html', 'feed'); Cache::unValidateCache('home.html', 'page'); $nanogal->getLastBookmark(); $nanogalCache = $nanogal->makeList(); if ($params['config']['useCache'] === true) { Cache::setCache('nanogal.html', $nanogalCache, 'feed'); } $lastPics = $nanogalCache; } $homeContent = file_get_contents('../datas/pages/home.md'); $homeContent = preg_replace("/<% lastPost %>/", $lastPost, $homeContent); $homeContent = preg_replace("/<% lastShaare %>/", $lastShaare, $homeContent); $homeContent = preg_replace("/<% lastAppsUpdates %>/", $lastAppsUpdates, $homeContent); $homeContent = preg_replace("/<% lastPics %>/", $lastPics, $homeContent); require __DIR__ . '/../../template/'.$params['config']['theme'].'/home.php'; $content = ob_get_contents(); ob_end_clean(); return $content; } function title() { return $this->title; } }