Skip to content

Commit

Permalink
If not being used in Laravel (such as during testing) use system dire…
Browse files Browse the repository at this point in the history
…ctory for cache
  • Loading branch information
DivineOmega committed Nov 16, 2018
1 parent 22afc4d commit 1e0e5bf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Factories/PasswordExposedCheckerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public function instance()
*/
private function getCacheDirectory()
{
return storage_path('password-exposed-cache/');
if (function_exists('storage_path')) {
return storage_path('password-exposed-cache/');
}

return sys_get_temp_dir().'/password-exposed-cache/';
}
}

0 comments on commit 1e0e5bf

Please sign in to comment.