Skip to content

Commit bb2d7ed

Browse files
committed
"refactoring"
1 parent 9dedd0e commit bb2d7ed

File tree

1 file changed

+3
-36
lines changed

1 file changed

+3
-36
lines changed

lib/Authentication/Util/Cache.php

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,9 @@ public function __construct()
1414

1515
}
1616

17-
public function fetchFromCache($key)
18-
{
19-
if ($this->checkIfExistInCache($key))
20-
{
21-
return $this->file_cache[$key];
22-
}
23-
24-
return false;
25-
}
26-
27-
public function storeInCache($key, $value)
28-
{
29-
if (!$this->checkIfExistInCache($key))
30-
{
31-
$this->file_cache[$key] = $value;
32-
return true;
33-
}
34-
35-
return false;
36-
}
37-
38-
public function checkIfExistInCache($key)
39-
{
40-
foreach ($this->file_cache as $cache_key => $cache_value)
41-
{
42-
if (isset($cache_value))
43-
{
44-
return true;
45-
}
46-
}
47-
48-
return false;
49-
}
50-
5117
public function updateCache($filePath, $merchantConfig)
5218
{
19+
echo "update call";
5320
$fileName = basename($filePath);
5421
$fileModTime = filemtime($filePath);
5522
$keyPass = $merchantConfig->getKeyPassword();
@@ -89,8 +56,8 @@ public function grabFileFromP12($merchantConfig)
8956
if (!isset($this->file_cache[$fileName]) || $this->file_cache[$fileName]['file_mod_time'] !== $fileModTime) {
9057
$this->updateCache($filePath, $merchantConfig);
9158
}
92-
93-
return $this->fetchFromCache($fileName);
59+
echo "just returning";
60+
return $this->file_cache[$fileName];
9461
}
9562

9663
private function getFilePath($merchantConfig)

0 commit comments

Comments
 (0)