From: Nicolas LÅ“uillet Date: Tue, 10 Feb 2015 12:35:34 +0000 (+0100) Subject: move dir check into constructor X-Git-Tag: 2.0.0-alpha.0~83^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=92504e0dd489c0d11abc87bee42ffca717db0480;p=github%2Fwallabag%2Fwallabag.git move dir check into constructor --- 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