diff options
author | Arnold Daniels <arnold@jasny.net> | 2016-06-23 16:08:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-23 16:08:53 +0200 |
commit | aff077dd5769dc8e499d300dc7aaf18608bb7999 (patch) | |
tree | 00c0f4d30cfb7c8d9c894c0bb2b474a44cb6c6ff | |
parent | fe611bba2c3e624a2d97aa6090a7b76e41b222a4 (diff) | |
parent | 3d0286d51313523cdd5f50e27165279a633d97d2 (diff) | |
download | sso-aff077dd5769dc8e499d300dc7aaf18608bb7999.zip sso-aff077dd5769dc8e499d300dc7aaf18608bb7999.tar.gz sso-aff077dd5769dc8e499d300dc7aaf18608bb7999.tar.bz2 |
Merge pull request #32 from Octen/configuration-cache-options
Adding configuration for cache by options
-rw-r--r-- | src/Server.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Server.php b/src/Server.php index 80864d8..8d1ecd4 100644 --- a/src/Server.php +++ b/src/Server.php @@ -17,7 +17,7 @@ abstract class Server /** * @var array */ - protected $options; + protected $options = ['files_cache_directory' => '/tmp', 'files_cache_ttl' => 36000]; /** * Cache that stores the special session data for the brokers. @@ -44,7 +44,7 @@ abstract class Server */ public function __construct(array $options = []) { - $this->options = $options; + $this->options = $options + $this->options; $this->cache = $this->createCacheAdapter(); } @@ -55,8 +55,8 @@ abstract class Server */ protected function createCacheAdapter() { - $adapter = new Adapter\File('/tmp'); - $adapter->setOption('ttl', 10 * 3600); + $adapter = new Adapter\File($this->options['files_cache_directory']); + $adapter->setOption('ttl', $this->options['files_cache_ttl']); return new Cache($adapter); } |