@@ -58,7 +58,7 @@ public function generateKeys(bool $override = false): bool
58
58
// ignore failures to load keys
59
59
}
60
60
61
- if ('' !== $ this ->decryptionKey && !file_exists ($ this ->pathPrefix .'encrypt.public.php ' )) {
61
+ if ('' !== $ this ->decryptionKey && !is_file ($ this ->pathPrefix .'encrypt.public.php ' )) {
62
62
$ this ->export ('encrypt.public ' , $ this ->encryptionKey );
63
63
}
64
64
@@ -99,7 +99,7 @@ public function reveal(string $name): ?string
99
99
$ this ->lastMessage = null ;
100
100
$ this ->validateName ($ name );
101
101
102
- if (!file_exists ($ file = $ this ->pathPrefix .$ name .'. ' .substr_replace (md5 ($ name ), '.php ' , -26 ))) {
102
+ if (!is_file ($ file = $ this ->pathPrefix .$ name .'. ' .substr_replace (md5 ($ name ), '.php ' , -26 ))) {
103
103
$ this ->lastMessage = sprintf ('Secret "%s" not found in "%s". ' , $ name , $ this ->getPrettyPath (\dirname ($ this ->pathPrefix ).\DIRECTORY_SEPARATOR ));
104
104
105
105
return null ;
@@ -133,7 +133,7 @@ public function remove(string $name): bool
133
133
$ this ->lastMessage = null ;
134
134
$ this ->validateName ($ name );
135
135
136
- if (!file_exists ($ file = $ this ->pathPrefix .$ name .'. ' .substr_replace (md5 ($ name ), '.php ' , -26 ))) {
136
+ if (!is_file ($ file = $ this ->pathPrefix .$ name .'. ' .substr_replace (md5 ($ name ), '.php ' , -26 ))) {
137
137
$ this ->lastMessage = sprintf ('Secret "%s" not found in "%s". ' , $ name , $ this ->getPrettyPath (\dirname ($ this ->pathPrefix ).\DIRECTORY_SEPARATOR ));
138
138
139
139
return false ;
@@ -152,7 +152,7 @@ public function list(bool $reveal = false): array
152
152
{
153
153
$ this ->lastMessage = null ;
154
154
155
- if (!file_exists ($ file = $ this ->pathPrefix .'list.php ' )) {
155
+ if (!is_file ($ file = $ this ->pathPrefix .'list.php ' )) {
156
156
return [];
157
157
}
158
158
@@ -184,11 +184,11 @@ private function loadKeys(): void
184
184
return ;
185
185
}
186
186
187
- if (file_exists ($ this ->pathPrefix .'decrypt.private.php ' )) {
187
+ if (is_file ($ this ->pathPrefix .'decrypt.private.php ' )) {
188
188
$ this ->decryptionKey = (string ) include $ this ->pathPrefix .'decrypt.private.php ' ;
189
189
}
190
190
191
- if (file_exists ($ this ->pathPrefix .'encrypt.public.php ' )) {
191
+ if (is_file ($ this ->pathPrefix .'encrypt.public.php ' )) {
192
192
$ this ->encryptionKey = (string ) include $ this ->pathPrefix .'encrypt.public.php ' ;
193
193
} elseif ('' !== $ this ->decryptionKey ) {
194
194
$ this ->encryptionKey = sodium_crypto_box_publickey ($ this ->decryptionKey );
0 commit comments