aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-01-23 21:13:41 +0100
committerArthurHoaro <arthur@hoa.ro>2020-07-23 21:19:21 +0200
commitb0428aa9b02b058b72c40b6e8dc2298d55bf692f (patch)
treec57176b24d76836a73608fb273b1094fcb8de785 /index.php
parent485b168a9677d160b0c0426e4f282b9bd0c632c1 (diff)
downloadShaarli-b0428aa9b02b058b72c40b6e8dc2298d55bf692f.tar.gz
Shaarli-b0428aa9b02b058b72c40b6e8dc2298d55bf692f.tar.zst
Shaarli-b0428aa9b02b058b72c40b6e8dc2298d55bf692f.zip
Migrate cache purge function to a proper class
And update dependencies and tests. Note that SESSION['tags'] has been removed a log ago
Diffstat (limited to 'index.php')
-rw-r--r--index.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/index.php b/index.php
index c639a3bc..73d9e022 100644
--- a/index.php
+++ b/index.php
@@ -53,7 +53,6 @@ require_once __DIR__ . '/vendor/autoload.php';
53// Shaarli library 53// Shaarli library
54require_once 'application/bookmark/LinkUtils.php'; 54require_once 'application/bookmark/LinkUtils.php';
55require_once 'application/config/ConfigPlugin.php'; 55require_once 'application/config/ConfigPlugin.php';
56require_once 'application/feed/Cache.php';
57require_once 'application/http/HttpUtils.php'; 56require_once 'application/http/HttpUtils.php';
58require_once 'application/http/UrlUtils.php'; 57require_once 'application/http/UrlUtils.php';
59require_once 'application/updater/UpdaterUtils.php'; 58require_once 'application/updater/UpdaterUtils.php';
@@ -78,6 +77,7 @@ use Shaarli\Languages;
78use Shaarli\Netscape\NetscapeBookmarkUtils; 77use Shaarli\Netscape\NetscapeBookmarkUtils;
79use Shaarli\Plugin\PluginManager; 78use Shaarli\Plugin\PluginManager;
80use Shaarli\Render\PageBuilder; 79use Shaarli\Render\PageBuilder;
80use Shaarli\Render\PageCacheManager;
81use Shaarli\Render\ThemeUtils; 81use Shaarli\Render\ThemeUtils;
82use Shaarli\Router; 82use Shaarli\Router;
83use Shaarli\Security\LoginManager; 83use Shaarli\Security\LoginManager;
@@ -530,6 +530,7 @@ function showLinkList($PAGE, $linkDb, $conf, $pluginManager, $loginManager)
530 */ 530 */
531function renderPage($conf, $pluginManager, $bookmarkService, $history, $sessionManager, $loginManager) 531function renderPage($conf, $pluginManager, $bookmarkService, $history, $sessionManager, $loginManager)
532{ 532{
533 $pageCacheManager = new PageCacheManager($conf->get('resource.page_cache'));
533 $updater = new Updater( 534 $updater = new Updater(
534 UpdaterUtils::read_updates_file($conf->get('resource.updates')), 535 UpdaterUtils::read_updates_file($conf->get('resource.updates')),
535 $bookmarkService, 536 $bookmarkService,
@@ -543,6 +544,8 @@ function renderPage($conf, $pluginManager, $bookmarkService, $history, $sessionM
543 $conf->get('resource.updates'), 544 $conf->get('resource.updates'),
544 $updater->getDoneUpdates() 545 $updater->getDoneUpdates()
545 ); 546 );
547
548 $pageCacheManager->invalidateCaches();
546 } 549 }
547 } catch (Exception $e) { 550 } catch (Exception $e) {
548 die($e->getMessage()); 551 die($e->getMessage());
@@ -1029,7 +1032,7 @@ function renderPage($conf, $pluginManager, $bookmarkService, $history, $sessionM
1029 try { 1032 try {
1030 $conf->write($loginManager->isLoggedIn()); 1033 $conf->write($loginManager->isLoggedIn());
1031 $history->updateSettings(); 1034 $history->updateSettings();
1032 invalidateCaches($conf->get('resource.page_cache')); 1035 $pageCacheManager->invalidateCaches();
1033 } catch (Exception $e) { 1036 } catch (Exception $e) {
1034 error_log( 1037 error_log(
1035 'ERROR while writing config file after configuration update.' . PHP_EOL . 1038 'ERROR while writing config file after configuration update.' . PHP_EOL .
@@ -1914,6 +1917,7 @@ $app->group('/api/v1', function () {
1914 1917
1915$app->group('', function () { 1918$app->group('', function () {
1916 $this->get('/login', '\Shaarli\Front\Controller\LoginController:index')->setName('login'); 1919 $this->get('/login', '\Shaarli\Front\Controller\LoginController:index')->setName('login');
1920 $this->get('/logout', '\Shaarli\Front\Controller\LogoutController:index')->setName('logout');
1917 $this->get('/picture-wall', '\Shaarli\Front\Controller\PictureWallController:index')->setName('picwall'); 1921 $this->get('/picture-wall', '\Shaarli\Front\Controller\PictureWallController:index')->setName('picwall');
1918})->add('\Shaarli\Front\ShaarliMiddleware'); 1922})->add('\Shaarli\Front\ShaarliMiddleware');
1919 1923