From 92504e0dd489c0d11abc87bee42ffca717db0480 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 10 Feb 2015 13:35:34 +0100 Subject: [PATCH] move dir check into constructor --- .../Security/Authentication/Provider/WsseProvider.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Wallabag/CoreBundle/Security/Authentication/Provider/WsseProvider.php b/src/Wallabag/CoreBundle/Security/Authentication/Provider/WsseProvider.php index c9b9b692..7e6a5dfb 100644 --- a/src/Wallabag/CoreBundle/Security/Authentication/Provider/WsseProvider.php +++ b/src/Wallabag/CoreBundle/Security/Authentication/Provider/WsseProvider.php @@ -17,6 +17,11 @@ class WsseProvider implements AuthenticationProviderInterface { $this->userProvider = $userProvider; $this->cacheDir = $cacheDir; + + // If cache directory does not exist we create it + if (!is_dir($this->cacheDir)) { + mkdir($this->cacheDir, 0777, true); + } } public function authenticate(TokenInterface $token) @@ -54,11 +59,6 @@ class WsseProvider implements AuthenticationProviderInterface throw new NonceExpiredException('Previously used nonce detected'); } - // If cache directory does not exist we create it - if (!is_dir($this->cacheDir)) { - mkdir($this->cacheDir, 0777, true); - } - file_put_contents($this->cacheDir.'/'.$nonce, time()); // Validate Secret -- 2.41.0