]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
move dir check into constructor 1068/head
authorNicolas Lœuillet <nicolas@loeuillet.org>
Tue, 10 Feb 2015 12:35:34 +0000 (13:35 +0100)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Tue, 10 Feb 2015 12:35:34 +0000 (13:35 +0100)
src/Wallabag/CoreBundle/Security/Authentication/Provider/WsseProvider.php

index c9b9b692f01d08f06c3ce16995d80e5676b72b51..7e6a5dfb3960f30f78043df38a0485cddf6b1c52 100644 (file)
@@ -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