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

Method testConnection

src/FileRise/Storage/WebDavAdapter.php:90–105  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

88 }
89
90 public function testConnection(): bool
91 {
92 $status = $this->request('PROPFIND', $this->buildUrlForRelative(''), null, ['Depth' => '0']);
93 if ($status >= 200 && $status < 300) {
94 $this->lastError = '';
95 return true;
96 }
97 if ($status === 401 || $status === 403) {
98 $this->lastError = 'Auth failed (HTTP ' . $status . ')';
99 } elseif ($status > 0) {
100 $this->lastError = 'HTTP ' . $status;
101 } elseif ($this->lastError === '') {
102 $this->lastError = 'Connection failed';
103 }
104 return false;
105 }
106
107 public function getLastError(): string
108 {

Callers 1

checkMethod · 0.80

Calls 2

requestMethod · 0.95
buildUrlForRelativeMethod · 0.95

Tested by

no test coverage detected