MCPcopy Create free account
hub / github.com/error311/FileRise / hasAnyUsers

Method hasAnyUsers

src/FileRise/Domain/UserModel.php:33–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31 }
32
33 public static function hasAnyUsers(): bool
34 {
35 self::ensureUserCaseMigration();
36 $usersFile = USERS_DIR . USERS_FILE;
37 if (!is_file($usersFile)) {
38 return false;
39 }
40
41 $lines = file($usersFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ?: [];
42 foreach ($lines as $line) {
43 $parts = explode(':', trim($line));
44 if (count($parts) >= 3 && preg_match(REGEX_USER, $parts[0])) {
45 return true;
46 }
47 }
48 return false;
49 }
50
51 public static function isInitialSetupAllowed(): bool
52 {

Callers 1

isInitialSetupAllowedMethod · 0.95

Calls 1

Tested by

no test coverage detected