1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* simpleSAMLphp-casserver is a CAS 1.0 and 2.0 compliant CAS server in the form of a simpleSAMLphp module |
5
|
|
|
* |
6
|
|
|
* Copyright (C) 2013 Bjorn R. Jensen |
7
|
|
|
* |
8
|
|
|
* This library is free software; you can redistribute it and/or |
9
|
|
|
* modify it under the terms of the GNU Lesser General Public |
10
|
|
|
* License as published by the Free Software Foundation; either |
11
|
|
|
* version 2.1 of the License, or (at your option) any later version. |
12
|
|
|
* |
13
|
|
|
* This library is distributed in the hope that it will be useful, |
14
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16
|
|
|
* Lesser General Public License for more details. |
17
|
|
|
* |
18
|
|
|
* You should have received a copy of the GNU Lesser General Public |
19
|
|
|
* License along with this library; if not, write to the Free Software |
20
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
21
|
|
|
* |
22
|
|
|
*/ |
23
|
|
|
|
24
|
|
|
namespace SimpleSAML\Module\casserver\Cas\Ticket; |
25
|
|
|
|
26
|
|
|
class MemCacheTicketStore extends TicketStore |
27
|
|
|
{ |
28
|
|
|
/** @var string $prefix */ |
29
|
|
|
private $prefix = ''; |
30
|
|
|
|
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @param \SimpleSAML\Configuration $config |
34
|
|
|
*/ |
35
|
|
|
public function __construct(\SimpleSAML\Configuration $config) |
|
|
|
|
36
|
|
|
{ |
37
|
|
|
parent::__construct($config); |
38
|
|
|
|
39
|
|
|
$storeConfig = $config->getValue('ticketstore'); |
40
|
|
|
|
41
|
|
|
if (array_key_exists('prefix', $storeConfig)) { |
42
|
|
|
$this->prefix = $storeConfig['prefix']; |
43
|
|
|
} |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @param string $ticketId |
49
|
|
|
* @return array|null |
50
|
|
|
*/ |
51
|
|
|
public function getTicket($ticketId) |
52
|
|
|
{ |
53
|
|
|
$scopedTicketId = $this->scopeTicketId($ticketId); |
54
|
|
|
|
55
|
|
|
return \SimpleSAML\Memcache::get($scopedTicketId); |
|
|
|
|
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @param array $ticket |
61
|
|
|
* @return void |
62
|
|
|
*/ |
63
|
|
|
public function addTicket(array $ticket) |
64
|
|
|
{ |
65
|
|
|
$scopedTicketId = $this->scopeTicketId($ticket['id']); |
66
|
|
|
|
67
|
|
|
\SimpleSAML\Memcache::set($scopedTicketId, $ticket, $ticket['validBefore']); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @param string $ticketId |
73
|
|
|
* @return void |
74
|
|
|
*/ |
75
|
|
|
public function deleteTicket($ticketId) |
76
|
|
|
{ |
77
|
|
|
$scopedTicketId = $this->scopeTicketId($ticketId); |
78
|
|
|
|
79
|
|
|
\SimpleSAML\Memcache::delete($scopedTicketId); |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* @param string $ticketId |
85
|
|
|
* @return string |
86
|
|
|
*/ |
87
|
|
|
private function scopeTicketId($ticketId) |
88
|
|
|
{ |
89
|
|
|
return $this->prefix.'.'.$ticketId; |
90
|
|
|
} |
91
|
|
|
} |
92
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths