Compare commits

..

5 commits

Author SHA1 Message Date
bohwaz
7b63ba2606 Update size
FossilOrigin-Name: 614905965c3791fef7097d0696a011b6d942df51987e6233665921bbdae44220
2025-12-11 02:39:28 +00:00
bohwaz
a4405fe6c4 Update screenshot
FossilOrigin-Name: f87c59b6c4b25b538b11b44f2f225da74a0397e20f7a7c21ad0f2708a53bd27b
2025-12-11 02:38:43 +00:00
bohwaz
2408427373 Add last changes
FossilOrigin-Name: 671720c174bd166616acc7b0fb76ef27ad22a06868cd235512864cdbf4ec06b7
2025-12-11 02:35:35 +00:00
bohwaz
ef9f5f3235 Update webdav manager UI
FossilOrigin-Name: 065c89bc3641a6c5fdb464fa5a68322c6ebac4ece4258389d12b46bfffd19f33
2025-12-11 02:33:57 +00:00
bohwaz
e6c25f229a Upgrade dependencies
FossilOrigin-Name: 593379b27b4979bde3a6ef92ac05ad38dd60758a23d0c4f512deecc6c28bddaf
2025-11-27 19:27:29 +00:00
6 changed files with 1076 additions and 414 deletions

View file

@ -3,6 +3,9 @@ KD2FW_URL := https://fossil.kd2.org/kd2fw/doc/trunk/src/lib/KD2/
deps:
@-mkdir -p lib/KD2/WebDAV
@-mkdir -p lib/KD2/HTTP
wget -O lib/KD2/HTTP/Server.php '${KD2FW_URL}HTTP/Server.php'
wget -O lib/KD2/WebDAV/Exception.php '${KD2FW_URL}WebDAV/Exception.php'
wget -O lib/KD2/WebDAV/Server.php '${KD2FW_URL}WebDAV/Server.php'
wget -O lib/KD2/WebDAV/AbstractStorage.php '${KD2FW_URL}WebDAV/AbstractStorage.php'
wget -O webdav.js https://raw.githubusercontent.com/kd2org/webdav-manager.js/main/webdav.js

View file

@ -4,9 +4,9 @@
If you drop the [`index.php`](https://fossil.kd2.org/picodav/doc/trunk/index.php) file in a directory of your web-server, it will make the contents of this directory available via WebDAV, and will also provide a nice web UI to manage the files, using [WebDAV Manager.js](https://fossil.kd2.org/webdav-manager/).
![Web UI screenshot](https://raw.githubusercontent.com/kd2org/webdav-manager.js/main/scr_desktop.png)
![Web UI screenshot](scr.webp)
* Single-file WebDAV server! Only 85 KB!
* Single-file WebDAV server! Only 110 KB!
* No database!
* Very fast and lightweight!
* Compatible with tons of apps!

1451
index.php

File diff suppressed because it is too large Load diff

View file

@ -15,6 +15,8 @@ function clean_php_source(string $file): string
$php = file_get_contents('server.php');
$php = strtr($php, [
'//__KD2\HTTP\Server__' => clean_php_source('lib/KD2/HTTP/Server.php'),
'//__KD2\WebDAV\Exception__' => clean_php_source('lib/KD2/WebDAV/Exception.php'),
'//__KD2\WebDAV\Server__' => clean_php_source('lib/KD2/WebDAV/Server.php'),
'//__KD2\WebDAV\AbstractStorage__' => clean_php_source('lib/KD2/WebDAV/AbstractStorage.php'),
'/*__HTACCESS__*/' => var_export(file_get_contents('.htaccess'), true),

BIN
scr.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View file

@ -1,7 +1,14 @@
<?php
namespace KD2\HTTP
{
//__KD2\HTTP\Server__
}
namespace KD2\WebDAV
{
//__KD2\WebDAV\Exception__
//__KD2\WebDAV\Server__
//__KD2\WebDAV\AbstractStorage__
@ -207,6 +214,23 @@ namespace PicoDAV
return ['path' => $path];
}
public function fetch(string $uri): ?string
{
$r = $this->get($uri);
if (!$r) {
return null;
}
$r = file_get_contents($r['path']);
if ($r === false) {
return null;
}
return $r;
}
public function exists(string $uri): bool
{
return file_exists($this->path . $uri);
@ -446,8 +470,6 @@ namespace PicoDAV
}
else {
$method($source, $target);
$this->getResourceProperties($uri)->move($destination);
}
return $overwritten;