From 1d16a53c480ea7eb93ba118f6ffd69131eb5f3c5 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 21 Aug 2016 20:36:16 -0400 Subject: Store comment sorting direction in user metadata --- app/Core/Base.php | 1 + app/Core/Cache/BaseCache.php | 35 +----------------------------- app/Core/Cache/CacheInterface.php | 45 +++++++++++++++++++++++++++++++++++++++ app/Core/User/UserSession.php | 22 ------------------- 4 files changed, 47 insertions(+), 56 deletions(-) create mode 100644 app/Core/Cache/CacheInterface.php (limited to 'app/Core') diff --git a/app/Core/Base.php b/app/Core/Base.php index df82febd..3b7c5e66 100644 --- a/app/Core/Base.php +++ b/app/Core/Base.php @@ -56,6 +56,7 @@ use Pimple\Container; * @property \Kanboard\Core\Helper $helper * @property \Kanboard\Core\Paginator $paginator * @property \Kanboard\Core\Template $template + * @property \Kanboard\Decorator\MetadataCacheDecorator $userMetadataCacheDecorator * @property \Kanboard\Model\ActionModel $actionModel * @property \Kanboard\Model\ActionParameterModel $actionParameterModel * @property \Kanboard\Model\AvatarFileModel $avatarFileModel diff --git a/app/Core/Cache/BaseCache.php b/app/Core/Cache/BaseCache.php index 04f8d220..b51c4c0c 100644 --- a/app/Core/Cache/BaseCache.php +++ b/app/Core/Cache/BaseCache.php @@ -8,41 +8,8 @@ namespace Kanboard\Core\Cache; * @package Kanboard\Core\Cache * @author Frederic Guillot */ -abstract class BaseCache +abstract class BaseCache implements CacheInterface { - /** - * Store an item in the cache - * - * @access public - * @param string $key - * @param string $value - */ - abstract public function set($key, $value); - - /** - * Retrieve an item from the cache by key - * - * @access public - * @param string $key - * @return mixed Null when not found, cached value otherwise - */ - abstract public function get($key); - - /** - * Remove all items from the cache - * - * @access public - */ - abstract public function flush(); - - /** - * Remove an item from the cache - * - * @access public - * @param string $key - */ - abstract public function remove($key); - /** * Proxy cache * diff --git a/app/Core/Cache/CacheInterface.php b/app/Core/Cache/CacheInterface.php new file mode 100644 index 00000000..19bd6ef7 --- /dev/null +++ b/app/Core/Cache/CacheInterface.php @@ -0,0 +1,45 @@ +sessionStorage->boardCollapsed[$project_id] = $is_collapsed; } - - /** - * Set comments sorting - * - * @access public - * @param string $order - */ - public function setCommentSorting($order) - { - $this->sessionStorage->commentSorting = $order; - } - - /** - * Get comments sorting direction - * - * @access public - * @return string - */ - public function getCommentSorting() - { - return empty($this->sessionStorage->commentSorting) ? 'ASC' : $this->sessionStorage->commentSorting; - } } -- cgit v1.2.3